public ActionResult DeleteConfirmed(string id) { expense_type expense_type = db.expense_Types.Find(id); db.expense_Types.Remove(expense_type); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "exps_id,exps_type,exps_code")] expense_type expense_type) { if (ModelState.IsValid) { db.Entry(expense_type).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(expense_type)); }
public ActionResult Create([Bind(Include = "exps_id,exps_type,exps_code")] expense_type expense_type) { if (ModelState.IsValid) { db.expense_Types.Add(expense_type); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(expense_type)); }
// GET: expense_type/Delete/5 public ActionResult Delete(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } expense_type expense_type = db.expense_Types.Find(id); if (expense_type == null) { return(HttpNotFound()); } return(View(expense_type)); }