示例#1
0
        public ActionResult NewBook(Models.Library library, string submit)
        {
            if (submit == "SaveNew")
            {
                var newBook = library.book;

                using (var ef = new LibraryEntities())
                {
                    ef.InsBook(newBook.name, newBook.authors, newBook.year, newBook.theme, newBook.idCategory);
                }
            }

            return(RedirectToAction("Books", "Book"));
        }