コード例 #1
0
 public ActionResult Create(Author author)
 {
     try
     {
         myHandler = new BusinessLogicHandler();
         if (ModelState.IsValid)
         {
             myHandler.AddAuthor(author);
         }
         return RedirectToAction("Index");
     }
     catch
     {
         return View();
     }
 }
コード例 #2
0
 public ActionResult ViewAuthor(Author author)
 {
     myHandler = new BusinessLogicHandler();
     if (ModelState.IsValid)
     {
         myHandler.AddAuthor(author);
     }
     return Json(new { success = true });
 }