public ActionResult CreateUser(DataLibrary.Models.UserDetails collection) { try { if (ModelState.IsValid) { // TODO: Add insert logic here if (sqlusrDA.CreateUser(collection)) { return(RedirectToAction("UserDetail")); } else { return(View("Error")); } } else { return(View()); } } catch (Exception ex) { return(View("Error", ex)); } }
public ActionResult EditUser(int id, DataLibrary.Models.UserDetails collection) { try { // TODO: Add update logic here sqlusrDA.UpdateUser(collection); return(RedirectToAction("UserDetail")); } catch { return(View()); } }
// GET: User/Edit/5 public ActionResult EditUser(int id) { DataLibrary.Models.UserDetails usr = sqlusrDA.GetUserDetByID(id); return(View(usr)); }