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