Esempio n. 1
0
        public ActionResult Create()
        {
            try
            {
                User user = new User();

                return View(user);
            }
            catch (SqlException sqlException)
            {
                return View("../Shared/DbError");
            }
            catch (Exception e)
            {
                return View("../Shared/Error");
            }
        }
Esempio n. 2
0
 public ActionResult Create(User user)
 {
     try
     {
         if (ModelState.IsValid)
         {
             userRepository.addUser(user);
             return RedirectToAction("Details", new { id = user.userName });
         }
         return View(user);
     }
     catch (SqlException sqlException)
     {
         return View("../Shared/DbError");
     }
     catch (Exception e)
     {
         return View("../Shared/Error");
     }
 }