public ActionResult DeleteConfirmed(int id) { Bottling bottling = db.Bottlings.Find(id); db.Bottlings.Remove(bottling); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "BottlingID,BottlingDate,ProductCode,BottlingLotNumber,tank,Quantity,FactoryID")] Bottling bottling) { if (ModelState.IsValid) { db.Entry(bottling).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(bottling)); }
public ActionResult Create([Bind(Include = "BottlingID,BottlingDate,ProductCode,BottlingLotNumber,tank,Quantity,FactoryID")] Bottling bottling) { if (ModelState.IsValid) { db.Bottlings.Add(bottling); db.SaveChanges(); return(RedirectToAction("Index")); } PopulateFactoriesDropDownList(); return(View(bottling)); }
// GET: Bottlings/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Bottling bottling = db.Bottlings.Find(id); if (bottling == null) { return(HttpNotFound()); } return(View(bottling)); }
// GET: Bottlings/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Bottling bottling = db.Bottlings.Find(id); if (bottling == null) { return(HttpNotFound()); } PopulateFactoriesDropDownList(bottling.FactoryID); return(View(bottling)); }