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