protected void ChangePasswordButtonClick(object sender, EventArgs e) { AuthMultiView.ActiveViewIndex = 3; if (string.IsNullOrEmpty(NewPassText.Text) || string.IsNullOrEmpty(ConfirmPasswordText.Text) || NewPassText.Text != ConfirmPasswordText.Text) { MessageChangePasswordLabel.Text = "Please enter new valid password"; return; } var accessKey = Request.Params["sp"]; var response = _customerInfoRepository.ChangePassword(accessKey, NewPassText.Text); if (response.IsSuccessful) { CacheLayer.Clear(CacheKeys.CustomerInfosCacheKey); AuthMultiView.ActiveViewIndex = 1; MessageSignInLabel.Text = "Your password has been changed, sign in please."; MessageSignInLabel.Attributes["style"] = "color:green !important;"; var responseEmail = EmailHelper.EmailNewPasswordchange(response.Message.FirstOrDefault(), response.Message.LastOrDefault()); } else { MessageChangePasswordLabel.Text = response.Message.First(); } }
private void UpdatePassword() { if (string.IsNullOrWhiteSpace(tbNewPassword.Text) || string.IsNullOrWhiteSpace(tbConfirmPassword.Text) || tbNewPassword.Text != tbConfirmPassword.Text) { lblMessageResetPassword.Text = "Please enter new valid password"; return; } var accessKey = Request.Params["q"]; var response = _customerInfoRepository.ChangePassword(accessKey, tbNewPassword.Text); if (response.IsSuccessful) { CacheLayer.Clear(CacheKeys.CustomerInfosCacheKey); var responseEmail = EmailHelper.EmailNewPasswordchange(response.Message.FirstOrDefault(), response.Message.LastOrDefault()); lblMessageResetPassword.Text = "Your password has been changed, sign in please."; lblMessageResetPassword.Attributes["style"] = "color:green !important;"; } else { lblMessageResetPassword.Text = response.Message.First(); } }