private void IdentifierTextBox_TextChanged(object sender, EventArgs e)
 {
     {
         // Search the tables for fixes and return the coordinates,
         // then place the coordinates into the list box.
         //
         if (IdentifierTextBox.TextLength != 0)
         {
             // First, be sure there is data in the database!
             DataTable dtVOR = Form1.VOR;
             DataTable dtNDB = Form1.NDB;
             DataTable dtFIX = Form1.FIX;
             DataTable dtAPT = Form1.APT;
             if (dtFIX.Rows.Count != 0)
             {
                 // Load the gridview - can be sorted later.  Future: add [Selected]
                 string    filter    = "[FacilityID] LIKE '" + IdentifierTextBox.Text + "*" + "'";
                 DataView  dvVOR     = new DataView(dtVOR, filter, "FacilityID", DataViewRowState.CurrentRows);
                 DataView  dvNDB     = new DataView(dtNDB, filter, "FacilityID", DataViewRowState.CurrentRows);
                 DataView  dvFIX     = new DataView(dtFIX, filter, "FacilityID", DataViewRowState.CurrentRows);
                 DataView  dvAPT     = new DataView(dtAPT, filter, "FacilityID", DataViewRowState.CurrentRows);
                 DataTable dtFixList = dvVOR.ToTable(true, "FacilityID", "Latitude", "Longitude");
                 dtFixList.Merge(dvNDB.ToTable(true, "FacilityID", "Latitude", "Longitude"));
                 dtFixList.Merge(dvFIX.ToTable(true, "FacilityID", "Latitude", "Longitude"));
                 dtFixList.Merge(dvAPT.ToTable(true, "FacilityID", "Latitude", "Longitude"));
                 FixListDataGridView.DataSource            = dtFixList;
                 FixListDataGridView.DefaultCellStyle.Font = new Font("Arial", 9);
                 FixListDataGridView.Columns[0].HeaderText = "ID";
                 if (FixListDataGridView.Rows.Count != 0)
                 {
                     FixListDataGridView.AutoResizeColumn(0, DataGridViewAutoSizeColumnMode.AllCells);
                 }
             }
             else
             {
                 string Msg = "You must select your FAA data folder before you can search for Fixes.";
                 SCTcommon.SendMessage(Msg);
                 IdentifierTextBox.Text = string.Empty;
             }
         }
         else
         {
             FixListDataGridView.DataSource = null;
         }
     }
 }
Beispiel #2
0
 private void IdentifierTextBox_TextChanged(object sender, EventArgs e)
 {
     // Search the tables for fixes and return the coordinates,
     // then place the coordinates into the list box.
     //
     if (IdentifierTextBox.TextLength != 0)
     {
         // First, be sure there is data in the database!
         DataTable dtSSD = Form1.SSD;
         if (dtSSD.Rows.Count != 0)
         {
             // Load the gridview - can be sorted later.  Future: add [Selected]
             string    filter    = "[SSDcode] LIKE '" + IdentifierTextBox.Text + "*" + "'";
             DataView  dvSSD     = new DataView(dtSSD, filter, "SSDcode", DataViewRowState.CurrentRows);
             DataTable dtSSDList = dvSSD.ToTable(true, "SSDcode", "ID");
             FixListDataGridView.DataSource            = dtSSDList;
             FixListDataGridView.DefaultCellStyle.Font = new Font("Arial", 9);
             FixListDataGridView.Columns[0].HeaderText = "Code";
             FixListDataGridView.Columns[1].Visible    = false;
             if (FixListDataGridView.Rows.Count != 0)
             {
                 FixListDataGridView.AutoResizeColumn(0, DataGridViewAutoSizeColumnMode.AllCells);
             }
         }
         else
         {
             string Msg = "You must activate your FAA data before you can search for SIDs & STARs.";
             SCTcommon.SendMessage(Msg);
             IdentifierTextBox.Text = string.Empty;
         }
     }
     else
     {
         FixListDataGridView.DataSource = null;
     }
 }