public ActionResult RegisterUserEdit(User user, int id) { var model = AuthenticationDB.GetUserByEmail(user.Email); if (model != null) { if (model.UserId != user.UserId) { ModelState.AddModelError("Warning Email", "Sorry: Email already Exists"); return(View(user)); } } else { model = AuthenticationDB.GetUserById(user.UserId); } model.FullName = user.FullName; model.Email = user.Email; model.IsActive = user.IsActive; model.Phone = user.Phone; model.CommunicationAddress = user.CommunicationAddress; AuthenticationDB.Save(model); return(RedirectToAction("RegisterUser")); }
public ActionResult RegisterUserEdit(int id) { var model = AuthenticationDB.GetUserById(id); // View Model Conversation here.... return(View(model)); }
public ActionResult ChangeStatus(int id) { var model = AuthenticationDB.GetUserById(id); model.IsActive = !model.IsActive; AuthenticationDB.Save(model); return(RedirectToAction("RegisterUser")); }