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