//Get the data for a particular Spend public SpendReport GetSpendData(int id) { try { SpendReport spend = db.SpendReport.Find(id); return(spend); } catch { throw; } }
//To Add new Spend record public void AddSpend(SpendReport Spend) { try { db.SpendReport.Add(Spend); db.SaveChanges(); } catch { throw; } }
//To Delete the record of a particular Spend public void DeleteSpend(int id) { try { SpendReport emp = db.SpendReport.Find(id); db.SpendReport.Remove(emp); db.SaveChanges(); } catch { throw; } }
//To Update the records of a particluar Spend public int UpdateSpend(SpendReport Spend) { try { db.Entry(Spend).State = EntityState.Modified; db.SaveChanges(); return(1); } catch { throw; } }