public static void DeleteFlight(TripModel flight) { foreach (var p in flight.PassengersList) { PassengersViewModel.DeletePassenger(p, flight); } }
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"); } } }