public ActionResult DeleteConfirmed(int id) { DrugInventory drugInventory = db.DrugInventories.Find(id); db.DrugInventories.Remove(drugInventory); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "DrugInventoryID,DrugID,BatchNo,Quantity,PruchaseDate,ManufatureDate,ExpiryDate")] DrugInventory drugInventory) { if (ModelState.IsValid) { db.Entry(drugInventory).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.DrugID = new SelectList(db.Drugs, "DrugID", "Name", drugInventory.DrugID); return(View(drugInventory)); }
// GET: DrugInventories/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } DrugInventory drugInventory = db.DrugInventories.Find(id); if (drugInventory == null) { return(HttpNotFound()); } return(View(drugInventory)); }
// GET: DrugInventories/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } DrugInventory drugInventory = db.DrugInventories.Find(id); if (drugInventory == null) { return(HttpNotFound()); } ViewBag.DrugID = new SelectList(db.Drugs, "DrugID", "Name", drugInventory.DrugID); return(View(drugInventory)); }