Пример #1
0
        private void SelBtn_Click(object sender, RoutedEventArgs e)
        {
            selXY        = new SelectData();
            selectedCity = "";
            selectedCity = Convert.ToString(cityList.Items[cityList.SelectedIndex]);
            selXY.SelextX(selectedCity);

            for (int i = 0; i < selXY.selectedCityList.Count; i++)
            {
                if (selXY.selectedCityList[i].number != null)
                {
                    FlightListDG.ItemsSource = selXY.selectedCityList;
                }
            }

            TimeSpan.TryParse(sTime.Text, out timeFlight);
            selXY.SelectXY(timeFlight);

            for (int i = 0; i <= selXY.selectedCityTimeList.Count; i++)
            {
                FlightListDG.ItemsSource = null;
                if (timeFlightLabelY.Visibility == Visibility.Hidden)
                {
                    FlightListDG.ItemsSource = selXY.selectedCityList;
                }
                else
                {
                    FlightListDG.ItemsSource = selXY.selectedCityTimeList;
                }
            }
            if (selXY.selectedCityTimeList.Count == 0 && timeFlightLabelY.Visibility == Visibility.Visible)
            {
                FlightListDG.ItemsSource = null;
            }
        }
Пример #2
0
        private void selBtn_Click(object sender, RoutedEventArgs e)
        {
            selectedCity = (string)cityList.SelectedItem;
            if (selectedCity == null)
            {
                ErrorShow(new Exception(), "Оберіть пункт призначення", MessageBoxButton.OK, MessageBoxImage.Information);
                return;
            }
            string selectedTime = sTime.Text;

            if (selectedTime.Equals(""))
            {
                FlightListDG.ItemsSource = SelectData.SelectX(fList, selectedCity);
            }
            else if (TimeSpan.TryParse(selectedTime, out timeFlight))
            {
                FlightListDG.ItemsSource = SelectData.SelectXY(fList, selectedCity, timeFlight);
            }
        }
Пример #3
0
 private void saveSelBtn_Click(object sender, RoutedEventArgs e)
 {
     if (sTime.IsEnabled)
     {
         new ConvertDataInDoc().ConvertFlightListInDoc(SelectData.SelectX(fList, selectedCity), SelectData.SelectXY(fList, selectedCity, timeFlight));
     }
     else
     {
         new ConvertDataInDoc().ConvertFlightListInDoc(SelectData.SelectX(fList, selectedCity), new List <Flight>());
     }
 }