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