public async Task <ActionResult> DeleteConfirmed(int id) { VictimServicesModel victimServicesModel = await db.VictimServicesModel.FindAsync(id); db.VictimServicesModel.Remove(victimServicesModel); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "VictimServicesID,VictimServices")] VictimServicesModel victimServicesModel) { if (ModelState.IsValid) { db.Entry(victimServicesModel).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(victimServicesModel)); }
public async Task <ActionResult> Create([Bind(Include = "VictimServicesID,VictimServices")] VictimServicesModel victimServicesModel) { if (ModelState.IsValid) { db.VictimServicesModel.Add(victimServicesModel); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(victimServicesModel)); }
// GET: VictimServicesModels/Delete/5 public async Task <ActionResult> Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } VictimServicesModel victimServicesModel = await db.VictimServicesModel.FindAsync(id); if (victimServicesModel == null) { return(HttpNotFound()); } return(View(victimServicesModel)); }