예제 #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);
 }
예제 #2
0
 public ActionResult Index()
 {
     Books books = new Books();
     var allbooks = books.GetAllBooks();
     BooksViewModel model = new BooksViewModel();
     model.BookList = allbooks;
     return View(model);
 }