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