Exemplo n.º 1
0
        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"));
        }
Exemplo n.º 2
0
 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));
 }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 4
0
        // 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));
        }