public ActionResult CauseGroupDeleteConfirmed(int id) { CauseGroup group = db.CauseGroups.Single(p => p.CauseGroupId == id); db.CauseGroups.Remove(group); db.SaveChanges(); return(RedirectToAction("CauseGroupList")); }
public ActionResult CauseGroupNew(CauseGroup group) { if (ModelState.IsValid) { db.CauseGroups.Add(group); db.SaveChanges(); return(RedirectToAction("CauseGroupList")); } return(View(group)); }
public ActionResult CauseGroupEdit(CauseGroup group) { if (ModelState.IsValid) { db.CauseGroups.Attach(group); db.Entry(group).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return(RedirectToAction("CauseGroupList")); } return(View(group)); }
public ActionResult CauseGroupDelete(int id) { CauseGroup group = db.CauseGroups.Single(p => p.CauseGroupId == id); return(View(group)); }