private void SearchButton_Click(object sender, RoutedEventArgs e) { avalibleFlights = new List <string>(); string[,] result = new FlightControlPanel().SearchFlights(FlightFromComboBox.SelectedItem.ToString(), FlightToComboBox.SelectedItem.ToString()); this.result = result; try { for (int i = 0; i < result.GetLength(0); i++) { avalibleFlights.Add(String.Format("ID: {0}; AirCraft: {1}; DateTime: {2} ", result[i, 0], result[i, 1], result[i, 2])); } if (avalibleFlights.Count != 0) { AvalibleFlightsComboBox.ItemsSource = avalibleFlights; MessageBox.Show("Найдено рейсов с указаным направление: " + avalibleFlights.Count); } else { MessageBox.Show("Рейсов с указаным маршрутом не найдено "); } } catch (Exception) { MessageBox.Show("Рейсов с указаным маршрутом не найдено "); } }
private void BuyButton_Click(object sender, RoutedEventArgs e) { FlightControlPanel.SaveTicket(flightInfo[0], accountInfo[4], flightInfo[1], flightInfo[2], flightInfo[3]); MessageBox.Show("Спасибо за покупку!"); }