基于web的进销存管理系统 第7页
登录流程图5-2
图5-3 登录(JCXX_DL.aspx)
5.2.2登录成功后进入的主界面
主界面可以添加一些制度及其他方面的说明,更重要的是从这个界面可以依据不同的权限进入相应的界面进行相关操作,流程图5-4,主界面图5-5所示。
主界面涉及权限的部分代码:
protected void Page_Load(object sender, EventArgs e)
{
if (Session["ywy"] != null)
{
Ywy ywy = (Ywy)Session["ywy"];
IList<Js_qx> js_qxs = new List<Js_qx>();
js_qxs = Js_qxManager.getJs_qxsByJsbh(ywy.Jsbh);
int urlid = Convert.ToInt32(Request.QueryString["urlid"]);
if (urlid != 0)
{
if (js_qxs.Count > 0)
{
for (int i = 0; i < js_qxs.Count; i++)
{
Js_qx js_qx = (Js_qx)js_qxs[i];
if (js_qx.Qxbh == urlid)
Response.Redirect(QxManager.getQxByQxbh(urlid).Qxurl, true);
}
}
}
}
}
登录后进入其他模块流程图5-4
图5-5 主界面(Default.aspx)
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)//判断事件行是不是数据行
{www.751com.cn
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();
}
//更新修改项
protected void btngx_Click(object sender, EventArgs e)
{
Qx qx = new Qx();
if (this.Qxbh == -1)
{
lblgxmassage.Text = "请选择编辑项!";
}
else{
qx.Qxbh = this.Qxbh;
qx.Qxmc = txtbqxmcgx.Text;
qx.Qxurl = txtbqxurlgx.Text;
qx.Qxbz = txtbbzgx.Text;
lblgxmassage.Text = QxManager.modifyQx(qx);
qxDataBind();
cleanGX();
}
}
//添加新项
protected void btntj_Click(object sender, EventArgs e)
{
Qx qx = new Qx();
if (txtbqxmctj.Text == null || txtbqxmctj.Text == "")
{
lbltjmassage.Text = "请填写用户名!";
}
else
{
qx.Qxmc = txtbqxmctj.Text;
qx.Qxurl = txtbqxurltj.Text;
qx.Qxbz = txtbbztj.Text;
lbltjmassage.Text = QxManager.addQx(qx);
qxDataBind();
cleanTJ();
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] 下一页
基于web的进销存管理系统 第7页下载如图片无法显示或论文不完整,请联系qq752018766