Esempio n. 1
0
        public ActionResult ChangePassword(ChangePasswordModel model)
        {
            if (ModelState.IsValid)
            {
                var changePasswordRequest = new ChangePasswordRequest(workContext.CurrentUser.Username,
                    true, model.NewPassword, model.OldPassword);
                var changePasswordResult = userRegistrationService.ChangePassword(changePasswordRequest);
                if (changePasswordResult.Success)
                {
                    SuccessNotification("Your password has been successfully changed");
                    return RedirectToRoute(SystemRouteNames.HomePage);
                }
                else
                {
                    ErrorNotification(changePasswordResult.ErrorMessages);
                }
            }

            //If we got this far, something failed, redisplay form
            return View(model);
        }
Esempio n. 2
0
 public ActionResult ChangePassword()
 {
     var model = new ChangePasswordModel();
     return View(model);
 }