Example #1
0
 protected void ChangePassword_Click(object sender, EventArgs e)
 {
     try
     {
         User NewUser = new User();
         NewUser.UserID = CurrentUserID;
         NewUser.UserEmail = EmailTextBox.Text;
         PRMS UserController = new PRMS();
         if (UserController.ChangePassword(NewUser, OldPassword.Text, NewPassword.Text))
         {
             PasswordConfirmation.Text = "Your password has been updated.";
             ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Password has updated successfully')", true);
         }
         else
         {
             PasswordConfirmation.Text = "Your old password is incorrect.";
         }
         ClientScript.RegisterStartupScript(this.GetType(), "Popup", "$('#ChangePasswordModal').modal('show')", true);
     }
     catch (Exception)
     {
         ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert(‘Error occurred with changing password. Please contact customer support for assistance if this issue persists.’)", true);
     }
 }