Example #1
0
 public ActionResult Create([Bind(Exclude = "Id")] Accounts accountsToCreate)
 {
     try
     {
         if (ModelState.IsValid)
         {
             _repository.CreateAccounts(accountsToCreate);
             return(RedirectToAction("Index"));
         }
     }
     catch (Exception ex)
     {
         ModelState.AddModelError("", ex);
         ViewData["CreateError"] = "Unable to create; view innerexception";
     }
     return(View("Create"));
 }