public ActionResult Create([Bind(Include = "BookID,BookName,BookGenre,BookYear")] BookInfo bookInfo) { if (ModelState.IsValid) { db.BookInfoes.Add(bookInfo); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(bookInfo)); }
public ActionResult Create([Bind(Include = "CUSTOMERID,FirstName,Surname,TelephoneNumber,EmailAddress,Username,Password")] Customer customer) { if (ModelState.IsValid) { db.Customers.Add(customer); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(customer)); }
public ActionResult Create([Bind(Include = "BookID,ISBN,Title,Author,Barcode")] Books1 books1) { if (ModelState.IsValid) { db.Books1.Add(books1); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(books1)); }
public ActionResult Create([Bind(Include = "AuthorID,FirstName,MiddleName,Surname,DateOfBirth,PlaceOfBirth")] Author author) { if (ModelState.IsValid) { db.Authors.Add(author); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(author)); }
public ActionResult Create([Bind(Include = "BorrowerID,FirstName,MiddleName,LastName,DateOfBirth")] Borrower borrower) { if (ModelState.IsValid) { db.Borrowers.Add(borrower); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.BorrowerID = new SelectList(db.Borrows, "BorrowID", "BorrowID", borrower.BorrowerID); return(View(borrower)); }
public ActionResult Create([Bind(Include = "BorrowID,BorrowDate,BorrowReturn")] Borrow borrow) { if (ModelState.IsValid) { db.Borrows.Add(borrow); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.BorrowID = new SelectList(db.Borrowers, "BorrowerID", "FirstName", borrow.BorrowID); return(View(borrow)); }
public ActionResult Create([Bind(Include = "BookCopyID,CustomerID,ReturnDate,BookID")] BookCopy bookCopy) { if (ModelState.IsValid) { db.BookCopies.Add(bookCopy); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CustomerID = new SelectList(db.Customers, "CUSTOMERID", "FirstName", bookCopy.CustomerID); ViewBag.BookID = new SelectList(db.Books1, "BookID", "ISBN", bookCopy.BookID); ViewBag.BookCopyID = new SelectList(db.BookCopies, "BookCopyID", "BookID", bookCopy.BookCopyID); ViewBag.BookCopyID = new SelectList(db.BookCopies, "BookCopyID", "BookID", bookCopy.BookCopyID); ViewBag.BookID = new SelectList(db.Books1, "BookID", "ISBN", bookCopy.BookID); return(View(bookCopy)); }