예제 #1
0
 public ActionResult Edit([Bind(Include = "BookID,BookName,BookGenre,BookYear")] BookInfo bookInfo)
 {
     if (ModelState.IsValid)
     {
         db.Entry(bookInfo).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(bookInfo));
 }
예제 #2
0
 public ActionResult Edit([Bind(Include = "CUSTOMERID,FirstName,Surname,TelephoneNumber,EmailAddress,Username,Password")] Customer customer)
 {
     if (ModelState.IsValid)
     {
         db.Entry(customer).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(customer));
 }
예제 #3
0
 public ActionResult Edit([Bind(Include = "BookID,ISBN,Title,Author,Barcode")] Books1 books1)
 {
     if (ModelState.IsValid)
     {
         db.Entry(books1).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(books1));
 }
예제 #4
0
 public ActionResult Edit([Bind(Include = "AuthorID,FirstName,MiddleName,Surname,DateOfBirth,PlaceOfBirth")] Author author)
 {
     if (ModelState.IsValid)
     {
         db.Entry(author).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(author));
 }
예제 #5
0
 public ActionResult Edit([Bind(Include = "BorrowerID,FirstName,MiddleName,LastName,DateOfBirth")] Borrower borrower)
 {
     if (ModelState.IsValid)
     {
         db.Entry(borrower).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.BorrowerID = new SelectList(db.Borrows, "BorrowID", "BorrowID", borrower.BorrowerID);
     return(View(borrower));
 }
예제 #6
0
 public ActionResult Edit([Bind(Include = "BorrowID,BorrowDate,BorrowReturn")] Borrow borrow)
 {
     if (ModelState.IsValid)
     {
         db.Entry(borrow).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.BorrowID = new SelectList(db.Borrowers, "BorrowerID", "FirstName", borrow.BorrowID);
     return(View(borrow));
 }
예제 #7
0
 public ActionResult Edit([Bind(Include = "BookCopyID,CustomerID,ReturnDate,BookID")] BookCopy bookCopy)
 {
     if (ModelState.IsValid)
     {
         db.Entry(bookCopy).State = EntityState.Modified;
         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));
 }