public ActionResult DeleteConfirmed(int id) { PrepEvent prepevent = db.PrepEvents.Single(p => p.EventID == id); db.PrepEvents.DeleteObject(prepevent); db.SaveChanges(); return(RedirectToAction("Index")); }
// // GET: /PrepEvent/Delete/5 public ActionResult Delete(int id = 0) { PrepEvent prepevent = db.PrepEvents.Single(p => p.EventID == id); if (prepevent == null) { return(HttpNotFound()); } return(View(prepevent)); }
public ActionResult Edit(PrepEvent prepevent) { if (ModelState.IsValid) { db.PrepEvents.Attach(prepevent); db.ObjectStateManager.ChangeObjectState(prepevent, EntityState.Modified); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(prepevent)); }
public ActionResult Create(PrepEvent prepevent) { if (ModelState.IsValid) { db.PrepEvents.AddObject(prepevent); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(prepevent)); }