Ejemplo n.º 1
0
        //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();
            }
        }
Ejemplo n.º 2
0
        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();
            }
        }
Ejemplo n.º 3
0
        //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();
            }
        }