//Constructors public Airport(String Country, String Region, String ICAOcode) { country = Country; region = Region; icaocode = ICAOcode; countryDataSet = null; regionDataSet = null; icaocodeDataSet = null; }
// // Event handlers. // // Name: countryComboBox_SelectedIndexChanged // // Description: // This event causes the regionComboBox to be populated with // results restricted by country. // Cursor is updated during the loading of data. // // Inputs: // sender Form control object // e Event arguments // // Outputs: // departRegionComboBox // arriveRegionComboBox // profileRegionComboBox // // Returns: // None. // // History: // 02-Oct-2006 ([email protected]) // Created. private void countryComboBox_SelectedIndexChanged(object sender, EventArgs e) { ComboBox comboBox = (ComboBox)sender; ComboBox regionComboBox = new ComboBox(); ComboBox airportComboBox = new ComboBox(); int direction = DEPART; RegionDataSet regionDataSet = new RegionDataSet(); if (comboBox.SelectedValue != null) { if (sender == departCountryComboBox) { departing.country = comboBox.SelectedValue.ToString(); departing.regionDataSet = regionDataSet; departPlaceBindingSource.DataSource = regionDataSet; departRegionComboBox.DataSource = departPlaceBindingSource; regionComboBox = departRegionComboBox; airportComboBox = departAirportComboBox; } else if (sender == arriveCountryComboBox) { direction = ARRIVE; arriving.country = comboBox.SelectedValue.ToString(); arriving.regionDataSet = regionDataSet; arrivePlaceBindingSource.DataSource = regionDataSet; arriveRegionComboBox.DataSource = arrivePlaceBindingSource; regionComboBox = arriveRegionComboBox; airportComboBox = arriveAirportComboBox; } else if (sender == profileCountryComboBox) { profile.country = comboBox.SelectedValue.ToString(); profile.regionDataSet = regionDataSet; profilePlaceBindingSource.DataSource = regionDataSet; profileRegionComboBox.DataSource = profilePlaceBindingSource; regionComboBox = profileRegionComboBox; airportComboBox = profileAirportComboBox; } if ((comboBox.SelectedValue.ToString().Length > 0) && (comboBox.SelectedIndex > 0)) { this.Cursor = Cursors.WaitCursor; LoadRegion(direction, comboBox.SelectedValue.ToString(), regionDataSet); if (regionDataSet.Tables["airport"].Rows.Count > 0) { regionComboBox.Enabled = true; } else { DialogResult result = MessageBox.Show(rm.GetString("EmptyAirport"), rm.GetString("EmptyResultsCaption"), MessageBoxButtons.OK, MessageBoxIcon.Information); } this.Cursor = Cursors.Arrow; } else { ComboBox[] comboBoxes = new ComboBox[] { regionComboBox, airportComboBox }; ClearComboBoxes(comboBoxes); foreach (ComboBox combo in comboBoxes) { combo.Enabled = false; } } } }
public Airport(String Country) { country = Country; region = null; icaocode = null; countryDataSet = null; regionDataSet = null; icaocodeDataSet = null; }