private void OnModifyUserpswd() { User_ListModel userM = userBll.GetModel(this.textBoxUser.Text); if (userM == null) { MessageBox.Show("用户不存在:" + this.textBoxUser.Text); return; } if (userM.UserPassWord != this.textBoxOldpswd.Text) { MessageBox.Show("旧密码不正确"); return; } if (this.textBoxNewPswd.Text != this.textBoxRePswd.Text) { MessageBox.Show("两次输入密码不一致"); return; } userM.UserPassWord = this.textBoxRePswd.Text; if (this.userBll.Update(userM)) { MessageBox.Show("密码修改成功!"); ClearInput(); } else { MessageBox.Show("密码修改失败!"); } }
public int GetLoginRole(ref string userName) { userName = this.cb_UserRole.Text; User_ListModel userModel = bllUser.GetModel(this.cb_UserRole.Text); if (userModel == null) { MessageBox.Show("用户不存在"); return(-1); } if (userModel.RoleID == 3) { return(userModel.RoleID); } if (userModel.UserPassWord != this.tb_userPassword.Text) { MessageBox.Show("密码错误"); return(-2); } return(userModel.RoleID); }