예제 #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));
     }
 }
예제 #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());
     }
 }
예제 #3
0
 // GET: User/Edit/5
 public ActionResult EditUser(int id)
 {
     DataLibrary.Models.UserDetails usr = sqlusrDA.GetUserDetByID(id);
     return(View(usr));
 }