예제 #1
0
        public ActionResult UserSetPassword(int customerID, string id)
        {
            SetPasswordCustomerUserViewModel model = new SetPasswordCustomerUserViewModel();

            model.CustomerID = customerID;
            model.id         = id;
            return(View(model));
        }
예제 #2
0
        public ActionResult UserSetPassword(SetPasswordCustomerUserViewModel model)
        {
            if (ModelState.IsValid)
            {
                userManager.RemovePassword(model.id);
                var result = userManager.AddPassword(model.id, model.NewPassword);

                if (result.Succeeded)
                {
                    return(RedirectToAction("Users", "Customer", new { id = model.CustomerID }));
                }
                AddErrors(result);
            }

            return(View(model));
        }