Exemplo n.º 1
0
 public ActionResult EditBook(EditBookViewModel form)
 {
     if (ModelState.IsValid)
     {
         Books.UpdateBook(form);
         Books books = new Books();
         var allbooks = books.GetAllBooks();
         BooksViewModel model = new BooksViewModel();
         model.BookList = allbooks;
         return View("Index", model);
     }
     else
         return View(form);
 }
Exemplo n.º 2
0
 public ActionResult Index()
 {
     Books books = new Books();
     var allbooks = books.GetAllBooks();
     BooksViewModel model = new BooksViewModel();
     model.BookList = allbooks;
     return View(model);
 }