protected void PopupDoiMatKhau_WindowCallback(object source, DevExpress.Web.PopupWindowCallbackArgs e) { try { //Xu ly callback popup doi mat khau String strerror = ""; String result = CustomValidate.checkControlEmpty(pnPopupChangePassword, new String[] { "txtMatKhauCu", "txtMatKhauMoi", "txtXacNhanMatKhauMoi" }); if (result != null) { PopupDoiMatKhau.JSProperties["cpUpdateStatus"] = Constant.NOTIFY_FAILURE; PopupDoiMatKhau.JSProperties["cpMess"] = result; return; } HttpCookie cookie = Request.Cookies[Constant.USER_COOKIE]; if (cookie == null) { Response.Redirect("~/Login/Login.aspx"); } UsersDH ctlUser = new UsersDH(); String UserLog = Utils.Decrypt(cookie[Constant.NAME_COOKIE]); User objUser = ctlUser.validateLogin(UserLog, Utils.Encrypt(txtMatKhauCu.Text)); if (objUser == null) { PopupDoiMatKhau.JSProperties["cpUpdateStatus"] = Constant.NOTIFY_FAILURE; PopupDoiMatKhau.JSProperties["cpMess"] = "Mật khẩu cũ bạn nhập không chính xác."; return; } if (!txtMatKhauMoi.Text.Equals(txtXacNhanMatKhauMoi.Text)) { PopupDoiMatKhau.JSProperties["cpUpdateStatus"] = Constant.NOTIFY_FAILURE; PopupDoiMatKhau.JSProperties["cpMess"] = "Xác nhận mật khẩu không chính xác."; return; } ctlUser.updateUserPassword(UserLog, Utils.Encrypt(txtMatKhauMoi.Text)); PopupDoiMatKhau.JSProperties["cpUpdateStatus"] = Constant.NOTIFY_SUCCESS; PopupDoiMatKhau.JSProperties["cpMess"] = String.Format("Cập nhập mật khẩu cho tài khoản [{0}] thành công.", UserLog); return; } catch (Exception ex) { PopupDoiMatKhau.JSProperties["cpUpdateStatus"] = Constant.NOTIFY_FAILURE; PopupDoiMatKhau.JSProperties["cpMess"] = ex.Message + " " + ex.StackTrace; } }