public MonthlyIncome Save(MonthlyIncome monthlyIncome) { if (monthlyIncome.IncomeID == 0) { db.MonthlyIncomes.Add(monthlyIncome); } else { db.Entry(monthlyIncome).State = System.Data.Entity.EntityState.Modified; } db.SaveChanges(); return(monthlyIncome); }
public void Delete(MonthlyIncome monthlyIncome) { db.MonthlyIncomes.Remove(monthlyIncome); db.SaveChanges(); }