コード例 #1
0
        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);
        }
コード例 #2
0
        public ActionResult ChangePassword()
        {
            if (!_workContext.CurrentCustomer.IsRegistered())
                return new HttpUnauthorizedResult();

            ChangePasswordViewModel model = new ChangePasswordViewModel();
            return View(model);
        }