Exemplo n.º 1
0
 public void deleteTrip(TravelAdvisorEntities1 db)
 {
     foreach (var bud in Budgets.ToList())
     {
         bud.deleteBudget(db, true);
     }
     foreach (var da in Days.ToList())
     {
         da.deleteDay(db, false);
     }
     Customers.Clear();
     db.Trips.Remove(this);
 }
Exemplo n.º 2
0
 public void deleteBudget(TravelAdvisorEntities1 db, bool deleteExpense)
 {
     if (deleteExpense)
     {
         foreach (var acc in Accommodations.ToList())
         {
             db.Accommodations.Remove(acc);
         }
         foreach (var food in FoodOrders.ToList())
         {
             db.FoodOrders.Remove(food);
         }
         foreach (var tra in Transportations.ToList())
         {
             db.Transportations.Remove(tra);
         }
         foreach (var othr in Other.ToList())
         {
             db.Other.Remove(othr);
         }
     }
     db.Budgets.Remove(this);
 }