计算机毕业设计介绍:
5.2.3 权限设置
进入这个界面后,就可以对权限进行相关操作,权限设置流程图5-6,权限设置图5-7所示。
权限设置部分代码:
//保存数据,确保刷新时数据存在
public int Qxbh
{
get {
if (ViewState["Qxbh"] != null)
return (int)ViewState["Qxbh"];
else
return -1;
}
set { ViewState["Qxbh"] = value; }
}
//绑定业务员
public void qxDataBind() {
gvQx.DataSource = QxManager.getAllQx();
gvQx.DataBind();
}
//行变色事件
protected void gvQx_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)//判断事件行是不是数据行
{
e.Row.Attributes.Add("onmouseover", "currentcolor=this.style.backgroundColor;
this.style.backgroundColor='#CCFF99'");//改变鼠标所在行的颜色,并存储当前颜色
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=currentcolor");
//还原颜色
LinkButton lbtnDelete = (LinkButton)e.Row.FindControl("lbtnDelete");
//获得点击的按钮
lbtnDelete.Attributes.Add("onclick", "return confirm('你确定删除吗?')");
//弹出提示对话框
}
}
//实现分页
protected void gvQx_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
gvQx.PageIndex = e.NewPageIndex;
qxDataBind();
}
//编辑和删除事件
protected void gvQx_RowCommand(object sender, GridViewCommandEventArgs e)
{
Qxbh = Convert.ToInt32(e.CommandArgument);
if(e.CommandName == "De"){
QxManager.deleteQxByQxbh(Qxbh);
}
if(e.CommandName == "Ed"){
Qx qx = QxManager.getQxByQxbh(Qxbh);
this.txtbqxmcgx.Text = qx.Qxmc;
this.txtbqxurlgx.Text = qx.Qxurl;
this.txtbbzgx.Text = qx.Qxbz;
//lbltjmassage.Text = "eeee"+Qxbh;
}
qxDataBind();
}
〖资料来源:计算机毕业论文 www.xiaoniu168.com〗
第13页为计算机毕业论文部分......