Esempio n. 1
0
        public ActionResult AddBook(AddBookViewModel model, string returnUrl)
        {
            var bookRepository = new BookRepository(ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString);
            var book           = new Book(model.ISBN, model.Title, model.Author);

            bookRepository.AddBook(book);
            TempData["Barcodes"] = bookRepository.AddCopiesOfBook(book, model.NumberOfCopies);

            return(Redirect("Success"));
        }