private void GetUIDataFromDB()
 {
     FlightsViewModel.GetAllCities().ForEach(c => CitiesList.Add(c));
     CitiesList.Insert(0, "Not selected");
     SelectedCity = CitiesList[0];
     FlightsViewModel.GetAllCompanies().ForEach(c => CompaniesList.Add(c.name));
     CompaniesList.Insert(0, "Not selected");
     SelectedCompany = CompaniesList[0];
     SelectTrips();
 }
Exemple #2
0
        private void addCitiesToComboBox(int CountryID)
        {
            CitiesList cl = CitiesList.GetCitiesListByCountry(CountryID);
            City       ci = new City();

            ci.CityID   = 0;
            ci.CityName = "Виберіть місто...";
            cl.Insert(0, ci);
            cityComboBox.DataSource = null;
            //cityComboBox.SelectedItem = null;
            //cityComboBox.Items.Clear();
            cityComboBox.DataSource    = cl;
            cityComboBox.DisplayMember = "CityName";
            cityComboBox.ValueMember   = "CityID";
        }