//Get the data for a particular budget public BudgetReport GetExpenseData(int id) { try { BudgetReport budget = db.BudgetReport.Find(id); return(budget); } catch { throw; } }
//To Add new Expense record public void AddBudget(BudgetReport budget) { try { db.BudgetReport.Add(budget); db.SaveChanges(); } catch { throw; } }
//To Delete the record of a particular budget public void DeleteBudget(int id) { try { BudgetReport emp = db.BudgetReport.Find(id); db.BudgetReport.Remove(emp); db.SaveChanges(); } catch { throw; } }
//To Update the records of a particluar budget public int UpdateBudget(BudgetReport budget) { try { db.Entry(budget).State = EntityState.Modified; db.SaveChanges(); return(1); } catch { throw; } }