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