コード例 #1
0
 public static void DeleteFlight(TripModel flight)
 {
     foreach (var p in flight.PassengersList)
     {
         PassengersViewModel.DeletePassenger(p, flight);
     }
 }
コード例 #2
0
 private void DeletePassenger()
 {
     if (SelectedPassenger != null)
     {
         PassengersViewModel.DeletePassenger(SelectedPassenger, SelectedFlight);
         if (SelectedFlight.DepOrArrFlag.Equals("departure"))
         {
             int n = Departures.IndexOf(SelectedFlight);
             Departures[n].PassengersList.Remove(SelectedPassenger);
             ShowFlightDetails("departure");
         }
         else
         {
             int n = Arrivals.IndexOf(SelectedFlight);
             Arrivals[n].PassengersList.Remove(SelectedPassenger);
             ShowFlightDetails("arrival");
         }
     }
 }