public ActionResult DeleteConfirmed(int id)
 {
     Inventory.Entities.Inventory item = db.Inventory.Find(id);
     db.Inventory.Remove(item);
     db.SaveChanges();
     return(RedirectToAction("Index"));
 }
 public ActionResult Edit([Bind(Include = "Id,Name,Cost,Quantity,Category")] Inventory.Entities.Inventory item)
 {
     if (ModelState.IsValid)
     {
         db.Entry(item).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View("Edit", item));
 }
        public ActionResult Create([Bind(Include = "Id,Name,Cost,Quantity,Category")] Inventory.Entities.Inventory item)
        {
            if (ModelState.IsValid)
            {
                db.Inventory.Add(item);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(item));
        }
 // GET: Books/Delete/5
 public ActionResult Delete(int?id)
 {
     if (id == null)
     {
         return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
     }
     Inventory.Entities.Inventory item = db.Inventory.Find(id);
     if (item == null)
     {
         return(HttpNotFound());
     }
     return(View(item));
 }