public ActionResult DeleteConfirmed(int id)
        {
            Book_Inventory book_Inventory = db.Book_Inventory.Find(id);

            db.Book_Inventory.Remove(book_Inventory);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "book_id,book_title,book_author,book_descreption,price,book_img,category_id")] Book_Inventory book_Inventory)
 {
     if (ModelState.IsValid)
     {
         db.Entry(book_Inventory).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.category_id = new SelectList(db.categories, "category_id", "category_name", book_Inventory.category_id);
     return(View(book_Inventory));
 }
        // GET: Book_Inventory/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Book_Inventory book_Inventory = db.Book_Inventory.Find(id);

            if (book_Inventory == null)
            {
                return(HttpNotFound());
            }
            return(View(book_Inventory));
        }
        // GET: Book_Inventory/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Book_Inventory book_Inventory = db.Book_Inventory.Find(id);

            if (book_Inventory == null)
            {
                return(HttpNotFound());
            }
            ViewBag.category_id = new SelectList(db.categories, "category_id", "category_name", book_Inventory.category_id);
            return(View(book_Inventory));
        }