public ActionResult UserSetPassword(int customerID, string id) { SetPasswordCustomerUserViewModel model = new SetPasswordCustomerUserViewModel(); model.CustomerID = customerID; model.id = id; return(View(model)); }
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)); }