public ActionResult ChangePassword(ChangePasswordViewModel model) { if (!_workContext.CurrentCustomer.IsRegistered()) return new HttpUnauthorizedResult(); if (ModelState.IsValid) { var customer = _workContext.CurrentCustomer; customer.Password = model.Password; _customerService.UpdateCustomer(customer); return RedirectToRoute("CustomerInfo"); } return View(model); }
public ActionResult ChangePassword() { if (!_workContext.CurrentCustomer.IsRegistered()) return new HttpUnauthorizedResult(); ChangePasswordViewModel model = new ChangePasswordViewModel(); return View(model); }