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