Пример #1
0
        /**
         * @name    configStatesAndCities
         * @brief   Fill the state combo boxes
         */
        private void configStatesAndCities()
        {
            CitiesBrazil citiesBrazil = new CitiesBrazil();

            String[] states = citiesBrazil.getStates();

            for (int i = 0; i < states.Length; i++)
            {
                stateSrcComboBox.Items.Add(states[i]);
                stateDestComboBox.Items.Add(states[i]);
                stateHotelCombo.Items.Add(states[i]);
                stateSrcPackCombo.Items.Add(states[i]);
                stateDestPackCombo.Items.Add(states[i]);
            }

            return;
        }
Пример #2
0
        /**
         * @name    stateDestPackCombo_SelectedIndexChanged
         * @brief   Fill the city destination package combo box according to the choosen state
         */
        private void stateDestPackCombo_SelectedIndexChanged(object sender, EventArgs e)
        {
            CitiesBrazil citiesBrazil = new CitiesBrazil();
            String       state        = stateDestPackCombo.SelectedItem.ToString();

            String[] cities = citiesBrazil.getCities(state);

            // clear the comboBox
            cityDestPackCombo.Items.Clear();

            for (int i = 0; i < cities.Length; i++)
            {
                cityDestPackCombo.Items.Add(cities[i]);
            }

            return;
        }