Esempio n. 1
0
 public ActionResult Create(Category category)
 {
     try
     {
         // TODO: Add insert logic here
         CategoriesDAL cat = new CategoriesDAL();
         cat.Create(category);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
        public ActionResult Create(Category category)
        {
            try
            {
                CategoriesDAL catDal = new CategoriesDAL();
                catDal.Create(category);

                return(RedirectToAction("Index"));
            }
            catch (Exception ex)
            {
                ViewBag.Error = ex.Message;
                return(View());
            }
        }