Exemplo n.º 1
0
 public ActionResult AddAuthor(Author author)
 {
     if (ModelState.IsValid)
     {
         authorManager.AddNewAuthor(author);
         if (Session["From"].ToString() == "add")
         {
             return(RedirectToAction("AddBook", "Book", null));
         }
         else if (Session["From"].ToString() == "edit")
         {
             return(RedirectToAction("EditBook", "Book", null));
         }
         else
         {
             return(RedirectToAction("Index", "Home", null));
         }
     }
     else
     {
         return(View());
     }
 }