Example #1
0
 public ActionResult Create(FormCollection collection)
 {
     try
     {
         myHandler = new BusinessLogicHandler();
         typeOf = new BookCategory();
         TryUpdateModel(typeOf);
         if (ModelState.IsValid)
         {
             myHandler.AddBookType(typeOf);
             return RedirectToAction("Index");
         }
         return View();
     }
     catch
     {
         return View();
     }
 }
Example #2
0
 public ActionResult ViewBookCategory(BookCategory bookCategory)
 {
     myHandler = new BusinessLogicHandler();
     if (ModelState.IsValid)
     {
         myHandler.AddBookType(bookCategory);
     }
     return Json(new { success = true });
 }