public JsonResult DoChangePassword(string oldPwd, string newPwd, decimal id) { ResultModel <object> rst = new ResultModel <object>(); rst.ResultStatus = UserBLL.ChangePwd(id, oldPwd, newPwd, out rst.ResultMessage); return(Json(rst)); }
private void btnSave_Click(object sender, EventArgs e) { if (u != null) { if (ValidateInput()) { string pwd1 = txtPwd.Text.Trim(); string pwd2 = txtEditPwd.Text.Trim(); int id = Convert.ToInt32(lblID.Text.Trim()); try { if (pwd1 == u.Password) { if (ubll.ChangePwd(pwd2, id)) { MessageBox.Show("修改成功,请重新登录"); Application.Restart(); } } else { MessageBox.Show("初始密码错误,请重新输入"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } } } else { LoginError++; if (LoginError > 5) { MessageBox.Show("操作频繁,请稍后再试"); } } }