Esempio n. 1
0
 public ActionResult Create(User user)
 {
     try
     {
         if (ModelState.IsValid)
         {
             // TODO: Add insert logic here
             res = API_User.SaveUser(user);
             if (res.Status)
             {
                 return(RedirectToAction("Index"));
             }
             else
             {
                 res.Data = user;
                 return(View(res));
             }
         }
         else
         {
             return(View(res));
         }
     }
     catch
     {
         return(View(res));
     }
 }
Esempio n. 2
0
 public ActionResult Edit(int Id, User user)
 {
     try
     {
         // TODO: Add update logic here
         if (Id > 0 && ModelState.IsValid)
         {
             user.SysUserID = Id;
             res            = API_User.SaveUser(user);
             if (res.Status)
             {
                 return(RedirectToAction("Index"));
             }
             else
             {
                 res.Data = user;
                 return(View(res));
             }
         }
         else
         {
             return(View(res));
         }
     }
     catch
     {
         return(View(res));
     }
 }