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