public ActionResult DeleteConfirmed(int id) { MasterBox masterBox = db.Boxes.Find(id); db.Boxes.Remove(masterBox); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "BoxId,BoxName,Price")] MasterBox masterBox) { if (ModelState.IsValid) { db.Entry(masterBox).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(masterBox)); }
public ActionResult Create([Bind(Include = "BoxId,BoxName,Price")] MasterBox masterBox) { if (ModelState.IsValid) { db.Boxes.Add(masterBox); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(masterBox)); }
// GET: MasterBoxes/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MasterBox masterBox = db.Boxes.Find(id); if (masterBox == null) { return(HttpNotFound()); } return(View(masterBox)); }