private void btnOK_Click(object sender, EventArgs e) { if (MD5_Crypt.GetHashStr(this.textBoxOldPwd.Text.Trim()) != this.mOldPwd) { this.lblTip.Text = "当前密码输入错误,请重新输入!"; this.lblTip.ForeColor = Color.Red; this.textBoxOldPwd.Focus(); this.textBoxOldPwd.SelectAll(); } else if (this.textBoxNewPwd.Text != this.textBoxReNewPwd.Text) { this.lblTip.Text = "新输入密码不匹配,请重新输入!"; this.ReInputPwd(); } else if (GetLength(this.textBoxNewPwd.Text.Trim()) < 4) { this.lblTip.Text = "密码长度至少4位"; this.ReInputPwd(); } else { RoleUserDAL rdal = new RoleUserDAL(); if (rdal.UpdateUserPwd(this.mUserCode, MD5_Crypt.GetHashStr(this.textBoxNewPwd.Text.Trim())) != -1) { if (this.mOldPwd != MD5_Crypt.GetHashStr(this.textBoxNewPwd.Text.Trim())) { UserLoginUtil.UpdateRemaindPasswrodByName(rdal.SelectUserByDM(this.mUserCode).RealName); PropertyUtil.Save(); } MessageManager.ShowMsgBox("INP-132201"); base.DialogResult = DialogResult.OK; } } }
private void btnOK_Click(object sender, EventArgs e) { if (this.txtName.Text.Trim() == "") { MessageManager.ShowMsgBox("INP-131101"); this.txtName.Focus(); } else if (this.HasNonChecked()) { MessageManager.ShowMsgBox("INP-131104"); this.tvFunc.Focus(); } else { try { RoleUserDAL rdal = new RoleUserDAL(); if (rdal.ExistRoleName(this.txtName.Text.Trim())) { MessageManager.ShowMsgBox("INP-131103"); this.txtName.Focus(); this.txtName.SelectAll(); return; } } catch (Exception) { MessageManager.ShowMsgBox("INP-131301"); return; } base.DialogResult = DialogResult.OK; } }
protected override object[] doService(object[] param) { bool flag = false; if ((param != null) && (param.Length == 2)) { string userName = param[0].ToString(); string str2 = param[1].ToString(); RoleUserDAL rdal = new RoleUserDAL(); flag = rdal.SelectUserPwd(userName).Equals(str2); } return(new object[] { flag }); }
private void NewUserForm_Load(object sender, EventArgs e) { List <Role> list = new RoleUserDAL().SelectAllRoleInfo(UserInfo.Yhdm); this.chklRole.BeginUpdate(); this.chklRole.Items.Clear(); foreach (Role role in list) { if (role.Name != "管理员") { this.chklRole.Items.Add(role); } } this.chklRole.EndUpdate(); }
private void btnOK_Click(object sender, EventArgs e) { string name = this.txtName.Text.Trim(); if (name.Length == 0) { MessageBoxHelper.Show("用户名不能为空!", "提示"); this.txtName.Focus(); } else { string str2 = this.txtPwd.Text.Trim(); if ((str2 == "") || (str2.Length < 4)) { MessageManager.ShowMsgBox("INP-132203"); this.txtPwd.Focus(); } else { RoleUserDAL rdal = new RoleUserDAL(); if (rdal.ExistUserName(name)) { MessageManager.ShowMsgBox("INP-132102"); this.txtName.Focus(); this.txtName.SelectAll(); } else if (this.chklRole.CheckedIndices.Count == 0) { MessageManager.ShowMsgBox("INP-132103"); this.chklRole.Focus(); } else { base.DialogResult = DialogResult.OK; } } } }
protected override object[] doService(object[] param) { List <string> list = new RoleUserDAL().SelectAllUserNames(); return(new object[] { list }); }