Example #1
0
 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));
     }
 }
Example #2
0
 public ActionResult EditUser(int id, DataLibrary.Models.UserDetails collection)
 {
     try
     {
         // TODO: Add update logic here
         sqlusrDA.UpdateUser(collection);
         return(RedirectToAction("UserDetail"));
     }
     catch
     {
         return(View());
     }
 }
Example #3
0
 // GET: User/Edit/5
 public ActionResult EditUser(int id)
 {
     DataLibrary.Models.UserDetails usr = sqlusrDA.GetUserDetByID(id);
     return(View(usr));
 }