Example #1
0
 //Constructors
 public Airport(String Country, String Region, String ICAOcode)
 {
     country = Country;
     region = Region;
     icaocode = ICAOcode;
     countryDataSet = null;
     regionDataSet = null;
     icaocodeDataSet = null;
 }
Example #2
0
        // Name: regionComboBox_SelectedIndexChanged
        //
        // Description:
        //      This event causes the airportComboBox to be populated with
        //      results restricted by region.
        //      Cursor is updated during the loading of data.
        //
        // Inputs:
        //      sender          Form control object
        //      e               Event arguments
        //
        // Outputs:
        //      departAirportComboBox
        //      arriveAirportComboBox
        //      profileAirportComboBox
        //
        // Returns:
        //      None.
        //
        // History:
        //      02-Oct-2006 ([email protected])
        //          Created.
        private void regionComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            ComboBox comboBox = (ComboBox)sender;
            AirportDataSet airportDataSet = new AirportDataSet();

            int direction = DEPART;
            if ((comboBox.SelectedValue != null) && (comboBox.SelectedIndex >= 0))
            {
                if (sender == departRegionComboBox)
                {
                    departing.icaocode = comboBox.SelectedValue.ToString();
                    departIatacodeBindingSource.DataSource = airportDataSet.Tables["airport"];
                    departAirportComboBox.DataSource = departIatacodeBindingSource;
                    iataCodeComboBox = departAirportComboBox;
                }
                if (sender == arriveRegionComboBox)
                {
                    direction = ARRIVE;
                    arriving.icaocode = comboBox.SelectedValue.ToString();
                    arriveIatacodeBindingSource.DataSource = airportDataSet.Tables["airport"];
                    arriveAirportComboBox.DataSource = arriveIatacodeBindingSource;
                    iataCodeComboBox = arriveAirportComboBox;
                }
                if (sender == profileRegionComboBox)
                {
                    profile.icaocode = comboBox.SelectedValue.ToString();
                    profileIatacodeBindingSource.DataSource = airportDataSet.Tables["airport"];
                    profileAirportComboBox.DataSource = profileIatacodeBindingSource;
                    iataCodeComboBox = profileAirportComboBox;
                }
                this.Cursor = Cursors.WaitCursor;
                LoadAirport(direction, comboBox.SelectedValue.ToString(),
                    airportDataSet.Tables["airport"]);
                if (airportDataSet.Tables["airport"].Rows.Count > 0)
                {
                    ShowAirportNames(direction, comboBox.SelectedValue.ToString(),
                        airportDataSet.Tables["airportName"]);
                }
                else
                {
                    DialogResult result = MessageBox.Show(rm.GetString("EmptyAirport"),
                        rm.GetString("EmptyResultsCaption"),
                        MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                iataCodeComboBox.Enabled = true;
                this.Cursor = Cursors.Arrow;
            }
        }
Example #3
0
 public Airport(String Country)
 {
     country = Country;
     region = null;
     icaocode = null;
     countryDataSet = null;
     regionDataSet = null;
     icaocodeDataSet = null;
 }