public ActionResult DeleteConfirmed(int id) { PrisonerType prisonertype = db.PrisonerTypes.Find(id); db.PrisonerTypes.Remove(prisonertype); db.SaveChanges(); return(RedirectToAction("Index")); }
// // GET: /PrisonerType/Delete/5 public ActionResult Delete(int id = 0) { PrisonerType prisonertype = db.PrisonerTypes.Find(id); if (prisonertype == null) { return(HttpNotFound()); } return(View(prisonertype)); }
public ActionResult Edit(PrisonerType prisonertype) { if (ModelState.IsValid) { db.Entry(prisonertype).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(prisonertype)); }
public ActionResult Create(PrisonerType prisonertype) { if (ModelState.IsValid) { db.PrisonerTypes.Add(prisonertype); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(prisonertype)); }