private void BtnEnter_Click(object sender, EventArgs e) { string YPass = Tb_YPass.Text; string NPass = Tb_NPass.Text; string EnterPass = Tb_EnterPass.Text; string PrivateKey = Tb_PrivateKey.Text; if (string.IsNullOrEmpty(YPass) || string.IsNullOrEmpty(NPass) || string.IsNullOrEmpty(EnterPass) || string.IsNullOrEmpty(PrivateKey)) { Tips.TipsErrorBox("请按要求输入该填写的项!"); } else { if (!NPass.Equals(EnterPass)) { Tips.TipsErrorBox("2次新密码输入不一致请重新输入!"); Tb_EnterPass.Text = ""; Tb_NPass.Text = ""; } else { //行为记录 BOperation.RecordHandle(LoginInMsg.AdminGuid, BOperationRecord.Level.Sensitive, "修改密码", "Exec Proc_User_ChangePass"); //执行数据更改操作 bool HasEror = false; string Message = ""; bu.ChangePass(LoginInMsg.AdminGuid, YPass, NPass, PrivateKey, ref HasEror, ref Message); if (!HasEror) { Tips.TipsErrorBox(Message); ClearBox(); } else { Tips.TipsInfoBox("恭喜~密码修改成功!"); ClearBox(); //"账号:" + LoginCode + "--" + log.LogWrite("行为记录", "账号:" + LoginInMsg.AdminLoginCode + "--" + "修改密码!"); } } } }
private void Btn_Add_Click(object sender, EventArgs e) { string Name = Tb_EmployeeName.Text; string Tel = Tb_EmployeeTel.Text; string Pass = Tb_Passwords.Text; if (string.IsNullOrEmpty(Name) || string.IsNullOrEmpty(Tel) || string.IsNullOrEmpty(Pass) ) { Tips.TipsErrorBox("信息填入不完整,请再确认一下!"); } else { BOperation.RecordHandle(SystemMsg.AdminGuid, BOperationRecord.Level.Nomal, "新增员工"); string ErrorMsg = string.Empty; Dictionary <string, object> Params = new Dictionary <string, object>(); Params.Add("GUID", Guid.NewGuid().ToString()); Params.Add("Code", Tb_EmlpoyeeCode.Text); Params.Add("Tel", Tel); Params.Add("Pass", Pass); Params.Add("Name", Name); Params.Add("Belong", SystemMsg.AdminGuid); Params.Add("Operator", GetRedioCheck()); Params.Add("Sex", GetEmployeeSex()); //执行存储操作 if (!be.AddEmployee(Params, ref ErrorMsg)) { Tips.TipsErrorBox(ErrorMsg); } else { Tips.TipsInfoBox("添加成功!"); Tb_EmployeeName.Text = ""; Tb_EmployeeTel.Text = ""; Tb_Passwords.Text = ""; Tb_EmlpoyeeCode.Text = DateTime.Now.ToString("yyyyMMddHHmmss"); //"账号:" + LoginCode + "--" + log.LogWrite("行为记录", "账号:" + SystemMsg.AdminLoginCode + "--" + "增加员工!"); } } }
/// <summary> /// 获取AdminMsg对象信息信息 /// </summary> /// <param name="code"></param> /// <param name="Pass"></param> /// <returns></returns> public Models.AdminMsg GetAdminMsg(string code, string Pass) { string IP = GetLocalIP(); Models.User user = this.GetUserInfo(code, Pass); AdminMsg msg = new AdminMsg(); msg.AdminGuid = user.UserGuid; msg.AdminLoginCode = user.UserCode; msg.AdminNickName = user.UserNickName; msg.AdminSex = user.UserSex; msg.Token = GetLoginToken(user.UserGuid, IP); msg.LoginTime = DateTime.Now; msg.LoginIP = IP; //用户行为记录 BOperation = new BOperationRecord(SqlConn); BOperation.RecordHandle(user.UserGuid, BOperationRecord.Level.Daily, string.Format("登入系统,IP:{0}", IP)); return(msg); }