//protected void btnLogin_Click(object sender, DirectEventArgs e) //{ // string usname = TextBox1.Text; // string pwd = TextBox1.Text; // BG_User user = BG_UserLogic.UserLogin(usname, pwd); // if (user != null) // { // Session[Constant.UserID] = user.UserID; //用户ID // Session[Constant.UserName] = user.UserName; //用户名称 // Session[Constant.UserNum] = user.UserNum; //用户工号 // Session[Constant.UserLim] = user.UserLim; //用户权限 // Session[Constant.DepID] = user.DepID; //用户所属部门ID // BG_Department department = BG_DepartmentManager.GetBG_DepartmentByDepID(user.DepID); // Session[Constant.DepName] = department.DepName; //用户所属部门名称 // Response.Redirect("default.aspx", true); // } // else // { // X.Msg.Alert("Error", "密码或帐户名错误!").Show(); // } //} protected void ibtnLogin_Click(object sender, ImageClickEventArgs e) { string usname = txtUer.Text; string pwd = txtPwd.Text; BG_User user = BG_UserLogic.UserLogin(usname, pwd); if (user != null) { Session[Constant.UserID] = user.UserID; //用户ID Session[Constant.UserName] = user.UserName; //用户名称 Session[Constant.UserNum] = user.UserNum; //用户工号 Session[Constant.UserLim] = user.UserLim; //用户权限 Session[Constant.DepID] = user.DepID; //用户所属部门ID BG_Department department = BG_DepartmentManager.GetBG_DepartmentByDepID(user.DepID); Session[Constant.DepName] = department.DepName; //用户所属部门名称 Session["CurrentYear"] = BG_SysSettingLogic.GetLastYear(); Session["IsLogin"] = 1; BG_User userd = new BG_User(); user.IsLogin = 1; BG_UserManager.ModifyBG_User(userd); Session[Constant.listallocationstr] = GetXML().Trim(); Response.Redirect("default.aspx", true); } else { X.Msg.Alert("Error", "密码或帐户名错误!").Show(); } }
protected void ibtnLogin_Click(object sender, ImageClickEventArgs e) { string usname = txtUer.Text; string pwd = txtPwd.Text; BG_User user = BG_UserLogic.UserLogin(usname, pwd); if (user != null) { Session[Constant.UserID] = user.UserID; //用户ID Session[Constant.UserName] = user.UserName; //用户名称 Session[Constant.UserNum] = user.UserNum; //用户工号 Session[Constant.UserLim] = user.UserLim; //用户权限 Session[Constant.DepID] = user.DepID; //用户所属部门ID BG_Department department = BG_DepartmentManager.GetBG_DepartmentByDepID(user.DepID); Session[Constant.DepName] = department.DepName; //用户所属部门名称 Response.Redirect("default.aspx", true); } else { X.Msg.Alert("Error", "密码或帐户名错误!").Show(); } }
public string NodeLoad(string nodeID) { DataTable dt = BG_DepartmentLogic.GetAllBG_Department(AreaDepID); NodeCollection nodes = new Ext.Net.NodeCollection(); Node rootNode = new Node(); rootNode.Text = "部门管理"; rootNode.Icon = Icon.Folder; nodes.Add(rootNode); rootNode.Expanded = true; List <string> listdep = new List <string>(); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { string depname = dt.Rows[i]["DepName"].ToString(); string depid = dt.Rows[i]["DepID"].ToString(); listdep.Add(depname); Node node1 = new Node(); node1.NodeID = dt.Rows[i]["DepID"].ToString(); node1.Text = depname; node1.Icon = Icon.UserHome; int sedepid = common.IntSafeConvert((int)Session["depid"]); if (sedepid == common.IntSafeConvert(dt.Rows[i]["DepID"])) { node1.Expanded = true; } //node1.Leaf = true; rootNode.Children.Add(node1); DataTable dt1 = BG_UserLogic.GetDtUserByDepid(depid); if (dt1.Rows.Count > 0) { for (int j = 0; j < dt1.Rows.Count; j++) { Node node2 = new Node(); node2.NodeID = dt1.Rows[j]["UserID"].ToString() + "用户"; node2.Text = dt1.Rows[j]["UserName"].ToString(); node2.Icon = Icon.User; node2.Leaf = true; node1.Children.Add(node2); } } else { node1.EmptyChildren = true; } } } Session["sedep"] = listdep; return(nodes.ToJson()); }
private void PrintST() { DataTable dt = BG_UserLogic.GetPrintdt(); if (dt != null && dt.Rows.Count > 0) { MemoryStream ms = ExcelRender.RenderToExcelSetHead(GetNew(dt), "姓名#登录名#特殊权限#权限#部门名称"); Response.ContentType = "application/xls"; Response.AddHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode("人员详细.xls", System.Text.Encoding.UTF8)); Response.BinaryWrite(ms.ToArray()); Response.End(); } else { this.Response.Write("<script>alert('无数据不允许导出')</script>"); } }
private void add() { UserID.Text = ""; BG_User user = new BG_User(); user.UserIDNum = TextField4.Text; user.UserName = TextField1.Text.Replace(",", string.Empty).Replace(",", string.Empty); if (user.UserName == "" || user.UserName == (string)Session["depname"]) { X.Msg.Alert("提示", "人名不能与部门名重名!").Show(); return; } if (BG_UserLogic.IsUser(user.UserName)) { X.Msg.Alert("提示", "已经存在该姓名,请使用其他姓名添加!").Show(); return; } user.UserNum = TextField3.Text; user.UserRem = txtRem.Text.Replace(",", string.Empty).Replace(",", string.Empty); string limit = string.Empty; int isvip = 0; if (Radio1.Checked == true) { limit = "100000"; user.UserDescription = "管理员"; } if (Radio2.Checked == true) { limit = "010000"; user.UserDescription = "局领导"; } if (Radio3.Checked == true) { limit = "001000"; user.UserDescription = "审核员"; } if (Radio4.Checked == true) { limit = "000100"; user.UserDescription = "录入人员"; } if (Radio5.Checked == true) { limit = "000010"; user.UserDescription = "查询人员"; } if (Radio6.Checked == true) { limit = "000001"; user.UserDescription = "出纳员"; } if (Radio7.Checked == true) { isvip = 1; } if (Radio8.Checked == true) { isvip = 0; } //if (Radio19.Checked == true) //{ // isvip = 2; //} string applyrem = ""; string applyrem1 = ""; string applyrem2 = ""; string applyrem3 = ""; applyrem1 = Radio9.Checked == true ? "1" : "0"; applyrem2 = Radio10.Checked == true ? "1" : "0"; applyrem3 = Radio11.Checked == true ? "1" : "0"; user.UserLim = limit; //user.UserSta = StrToInt(cbbSta.Text); //if (cbbSta.Text == "禁用") //{ // user.UserSta = 2; //} //if (cbbSta.Text == "禁用") //{ // user.UserSta = 1; //} user.UserSta = 1; user.UserPwd = "12345"; int depid = common.IntSafeConvert(BG_DepartmentLogic.GetBG_DepartmentByName((string)Session["depname"]).DepID); user.DepID = depid; user.IsVIP = isvip; user.ApplyRem = applyrem; if (BG_UserManager.AddBG_User(user).UserID > 0) { Node node = new Node(); node.Text = user.UserName; node.Icon = Icon.User; node.Leaf = true; STMem.GetNodeById(depid).AppendChild(node); //X.Msg.Show(new MessageBoxConfig //{ // Title = "提示", // Message = "添加成功", // Width = 300, // Buttons = MessageBox.Button.OK, //}); Session["depname"] = "政策法规科"; Response.Redirect("STMember.aspx?depid=" + depid, true); } //STMem.ExpandAll(); //int depid = AreaDepID; }