public ChangePasswordModel SecondChangePasswordModel() { var secondChangePasswordModel = new ChangePasswordModel { OldPassword = null, NewPassword = null, ConfirmPassword = null }; return secondChangePasswordModel; }
public ChangePasswordModel ThirdChangePasswordModel() { var thirdChangePasswordModel = new ChangePasswordModel { OldPassword = null, NewPassword = null, ConfirmPassword = null }; return thirdChangePasswordModel; }
public ChangePasswordModel FirstChangePasswordModel() { var firstChangePasswordModel = new ChangePasswordModel { OldPassword = null, NewPassword = null, ConfirmPassword = null }; return firstChangePasswordModel; }
public ActionResult ChangePassword(ChangePasswordModel model) { if (!ModelState.IsValid) return View(model); var changePasswordSucceeded = false; try { var currentUser = MembershipService.GetUser(User.Identity.Name, true /* userIsOnline */); if (currentUser != null) changePasswordSucceeded = currentUser.ChangePassword(model.OldPassword, model.NewPassword); } catch (Exception) { changePasswordSucceeded = false; } if (changePasswordSucceeded) { return RedirectToAction("ChangePasswordSuccess"); } ModelState.AddModelError("", @"The current password is incorrect or the new password is invalid."); return View(model); }