public virtual ActionResult Edit(string idKey) { var model = ManageUserModelHelper.GetUserModelForEdit(idKey); if (model == null) { return(this.RedirectToAction <UsersController>(a => a.Index())); } return(View(model)); }
public virtual ActionResult Edit(UserModel model) { if (ModelState.IsValid) { Status status; if (model.Update(out status)) { ModelState.AddModelError("Error", "User information updated successfully!"); } else { ModelState.AddModelError("Error", status.Message()); } } else { ModelState.AddModelError("Error", "Please update the required fields!"); } model = ManageUserModelHelper.GetUserModelForEdit(model.IdKey.ToString()); return(View(model)); }