public ActionResult Edit([Bind(Include = "Category_id,Category_name")] Books_Category books_Category)
 {
     if (ModelState.IsValid)
     {
         db.Entry(books_Category).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(books_Category));
 }
예제 #2
0
 public ActionResult Edit([Bind(Include = "Book_borrow_id,Book_id,Issued_date,Due_date,Returned_date,Fine_amount")] Book_Register book_Register)
 {
     if (ModelState.IsValid)
     {
         db.Entry(book_Register).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Book_id = new SelectList(db.Books, "Book_id", "Book_name", book_Register.Book_id);
     return(View(book_Register));
 }