//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 btnsure_OnDirectClick(object sender, DirectEventArgs e) { if (!string.IsNullOrEmpty(PasswordField.Text.Trim())) { string pwd = ""; BG_User bgUser = BG_UserManager.GetBG_UserByUserID(UserID); pwd = bgUser.UserPwd; if (bgUser.UserPwd == PasswordField.Text.Trim()) { X.Msg.Alert("系统提示", "密码不能与原密码相同").Show(); return; } bgUser.UserPwd = PasswordField.Text.Trim(); if (BG_UserManager.ModifyBG_User(bgUser)) { X.Msg.Alert("系统提示", "密码修改成功").Show(); Window1.Close(); } BG_ChangePwd bgChangePwd = new BG_ChangePwd(); bgChangePwd.UserName = UserName; bgChangePwd.CrTime = DateTime.Now; bgChangePwd.DepName = DepName; bgChangePwd.NewPwd = bgUser.UserPwd; bgChangePwd.UserID = bgUser.UserID; bgChangePwd.OldPwd = pwd; BG_ChangePwdManager.AddBG_ChangePwd(bgChangePwd); } }
protected override void OnLoad(EventArgs e) { if (Session[Constant.UserName] != null && Session[Constant.UserLim] != null) { InComeSouce = new string[] { "财政拨款", "地方财政", "其他" }; userLim = Session[Constant.UserLim].ToString(); userName = Session[Constant.UserName].ToString(); userNum = Session[Constant.UserNum].ToString(); depID = Convert.ToInt32(Session[Constant.DepID]); depName = Session[Constant.DepName].ToString(); UserID = Convert.ToInt32(Session[Constant.UserID]); areaDepID = Convert.ToInt32(ConfigurationManager.AppSettings["AreaDepID"]); currentYear = DateTime.Now.Year.ToString(); //Session["CurrentYear"].ToString(); try { userLimStr = GetUserLimStr(userLim); } catch { } isLogin = (int)Session["IsLogin"]; listallocationstr = Session[Constant.listallocationstr].ToString(); } else { Session["IsLogin"] = 0; BG_User user = new BG_User(); user.IsLogin = 0; BG_UserManager.ModifyBG_User(user); ScriptManager.RegisterStartupScript(this, GetType(), "lgout", "window.top.location.href='" + ResolveClientUrl("~/login.aspx") + "'", true); } base.OnLoad(e); }
protected void btninit_OnDirectClick(object sender, DirectEventArgs e) { int uid = common.IntSafeConvert(UserID); BG_User bgUser = BG_UserManager.GetBG_UserByUserID(uid); bgUser.UserPwd = "12345"; if (BG_UserManager.ModifyBG_User(bgUser)) { X.Msg.Alert("系统提示", "用户密码已初始化").Show(); } }
public void DodelYes() { if (!string.IsNullOrEmpty(UserID.Text)) { int uid = StrToInt(UserID.Text); int depid = common.IntSafeConvert(BG_UserManager.GetBG_UserByUserID(uid).DepID); if (BG_UserManager.DeleteBG_UserByID(uid)) { Response.Redirect("STMember.aspx?depid=" + depid, true); } } }
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; }
private void mod(int uid) { BG_User user = BG_UserManager.GetBG_UserByUserID(uid); user.UserName = TextField1.Text.Replace(",", string.Empty).Replace(",", string.Empty); user.UserNum = TextField3.Text.Replace(",", string.Empty).Replace(",", string.Empty); user.UserIDNum = TextField4.Text.Replace(",", string.Empty).Replace(",", string.Empty); user.UserRem = txtRem.Text.Replace(",", string.Empty).Replace(",", string.Empty); string limit = string.Empty; int isvip = 0; string applyrem = ""; 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 (Radio9.Checked == true) //{ // applyrem = "000"; //} string applyrem1 = ""; string applyrem2 = ""; string applyrem3 = ""; applyrem1 = Radio9.Checked == true ? "1" : "0"; applyrem2 = Radio10.Checked == true ? "1" : "0"; applyrem3 = Radio11.Checked == true ? "1" : "0"; applyrem = applyrem1 + applyrem2 + applyrem3; user.UserLim = limit; string depname = ComboBox1.Text; //ComboBox1.RawValue.ToString(); DataTable dt = BG_DepartmentLogic.GetDepidByName(depname); if (dt.Rows.Count > 0) { user.DepID = StrToInt(dt.Rows[0]["DepID"].ToString()); } user.IsVIP = isvip; user.ApplyRem = applyrem; // faUser.UserPurStr = "000000"; if (BG_UserManager.ModifyBG_User(user)) { X.Msg.Show(new MessageBoxConfig { Title = "提示", Message = "修改成功", Width = 300, Buttons = Ext.Net.MessageBox.Button.OK, }); int depid = common.IntSafeConvert(user.DepID); Response.Redirect("STMember.aspx?depid=" + depid, true); //Response.Redirect("STMember.aspx", true); } }
public void Memberselect(string uid) { uid = uid.Contains("用户")?uid.Replace("用户", ""):uid; //FieldSet2.Hidden = !Radio4.Checked; TextField1.ReadOnly = true; Session["TextField1"] = 0; if (uid.Length <= 0) { return; } hidUserID.Value = uid; chkClear(); int id = StrToInt(uid); BG_User user = BG_UserManager.GetBG_UserByUserID(id); //BG_User user = BG_UserManager.GetBG_UserByUsid(id); if (user != null) { TextField1.Text = user.UserName; int depid = user.DepID; TextField3.Text = user.UserNum; TextField4.Text = user.UserIDNum; txtRem.Text = user.UserRem; UserID.Text = user.UserID.ToString(); string limit = user.UserLim; if (common.IntSafeConvert(user.IsVIP.ToString().Substring(0, 1)) == 1) { Radio7.Checked = true; } else if (common.IntSafeConvert(user.IsVIP.ToString().Substring(0, 1)) == 0) { Radio8.Checked = true; } //else //{ // Radio19.Checked = true; //} if (user.ApplyRem.Length > 0 && user.ApplyRem.Substring(0, 1) == "1") { Radio9.Checked = true; } else { Radio9.Checked = false; } if (user.ApplyRem.Length > 0 && user.ApplyRem.Substring(1, 1) == "1") { Radio10.Checked = true; } else { Radio10.Checked = false; } if (user.ApplyRem.Length > 0 && user.ApplyRem.Substring(2, 1) == "1") { Radio11.Checked = true; } else { Radio11.Checked = false; } if (limit.Length >= 5) { if (limit.Substring(0, 1) == "1") { Radio1.Checked = true; } if (limit.Substring(1, 1) == "1") { Radio2.Checked = true; } if (limit.Substring(2, 1) == "1") { Radio3.Checked = true; } if (limit.Substring(3, 1) == "1") { Radio4.Checked = true; } if (limit.Substring(4, 1) == "1") { Radio5.Checked = true; } if (limit.Substring(5, 1) == "1") { Radio6.Checked = true; } } BG_Department dp = BG_DepartmentManager.GetBG_DepartmentByDepID(depid); if (dp != null) { //ComboBox1.RawValue = dp.DepName; ComboBox1.Text = dp.DepName; if (dp.DepName.Contains("局长基金")) { Radio11.Enable(true); } else { Radio11.Disable(true); } } } }