public ActionResult ExpenseDetails(int id) { DBContext DB = new DBContext(); ExpenseTB client = (from u in DB.ExpenseTBs where u.Id == id select u).FirstOrDefault(); return(View(client)); }
public JsonResult ExpenseCreate(ExpenseTB expense) { ViewData["AccountHeadList"] = LoadAccount(); DBContext db = new DBContext(); db.ExpenseTBs.Add(expense); db.SaveChanges(); return(Json("true", JsonRequestBehavior.AllowGet)); }
public ActionResult ExpenseEdit(int id) { ViewData["AccountHeadList"] = LoadAccount(); DBContext db = new DBContext(); ExpenseTB account = (from ac in db.ExpenseTBs where ac.Id == id select ac).FirstOrDefault(); return(View(account)); }
public JsonResult ExpenseEdit(ExpenseTB expense) { ViewData["AccountHeadList"] = LoadAccount(); DBContext db = new DBContext(); ExpenseTB account = (from ac in db.ExpenseTBs where ac.Id == expense.Id select ac).FirstOrDefault(); account.AccountHead_Id = expense.AccountHead_Id; account.Amount = expense.Amount; account.Amount_Details = expense.Amount_Details; db.SaveChanges(); return(Json("true", JsonRequestBehavior.AllowGet)); }