//to Delete Wrong Expenditure public void Delete_Expenditure(int id) { using (var db = new InvestmentdbContext()) { var queryIncome = db.Expenditures.OrderBy(i => i.ExpenditureId); foreach (var Eid in queryIncome) { if (Eid.ExpenditureId == id) { db.Remove(Eid); } } db.SaveChanges(); } }
public void Delete_People(int id) { using (var db = new InvestmentdbContext()) { var peopleId = db.Peoples.OrderBy(i => i.PeopleId); foreach (var Pid in peopleId) { if (Pid.PeopleId == id) { db.Remove(Pid); } } db.SaveChanges(); } }
//to Delete Wrong Income public void Delete_Income(int id) { using (var db = new InvestmentdbContext()) { var queryIncome = db.Incomes.OrderBy(i => i.IncomeId); // var fid = (float)id; foreach (var Iid in queryIncome) { if (Iid.IncomeId == id) { db.Remove(Iid); } } db.SaveChanges(); } }