public seeFly() { InitializeComponent(); ListFlies = FlyModel.GetFlies(); dataGridFlies.ItemsSource = ListFlies; dataGridFlies.SelectedValuePath = "Id"; }
private void Supprimer_Click(object sender, RoutedEventArgs e) { List <int> journeyId = FlyModel.selectJourneyId(Convert.ToInt32(dataGridFlies.SelectedValue)); foreach (var item in journeyId) { TicketModel.DeleteTicket(item); JourneyModel.DeleteJourney(item); JourneyModel.DeleteJourneyFly(item); } FlyModel.DeleteFly(Convert.ToInt32(dataGridFlies.SelectedValue)); dataGridFlies.ItemsSource = null; dataGridFlies.ItemsSource = FlyModel.GetFlies(); }