Exemplo n.º 1
0
        private void populateUpcomingFlightsGrid(DataGridView gridview)
        {
            //upcomingFlights_datagridview

            Console.WriteLine("-------------currsys time->" + currSysTime_DTP.Value.ToString());
            DataTable upcoming = FormDatabaseHelper.generateUpcomingFlightsDataTable(USER.id, currSysTime_DTP.Value);

            gridview.DefaultCellStyle.Format = "g";
            gridview.DataSource                  = upcoming;
            gridview.AutoGenerateColumns         = false;
            gridview.Columns[0].Name             = "OriginAbv";          // name
            gridview.Columns[0].HeaderText       = "Origin ";            // header text
            gridview.Columns[0].DataPropertyName = "OriginAbv";          // field name

            gridview.Columns[1].Name             = "connectionAbv";      // name
            gridview.Columns[1].HeaderText       = "Connection ";        // header text
            gridview.Columns[1].DataPropertyName = "connectionAbv";      // field name

            gridview.Columns[2].Name             = "finaldestAbv";       // name
            gridview.Columns[2].HeaderText       = "Destination";        // header text
            gridview.Columns[2].DataPropertyName = "finaldestAbv";       // field name

            gridview.Columns[3].Name             = "DepartureDate";      // name
            gridview.Columns[3].HeaderText       = "Departure Origin";   // header text
            gridview.Columns[3].DataPropertyName = "DepartureDate";      // field name

            gridview.Columns[4].Name             = "ArrivalDate";        // name
            gridview.Columns[4].HeaderText       = "Arrival final Dest"; // header text
            gridview.Columns[4].DataPropertyName = "ArrivalDate";        // field name

            gridview.Columns[5].Name             = "PaymentType";        // name
            gridview.Columns[5].HeaderText       = "1- Card 2-Rewards";  // header text
            gridview.Columns[5].DataPropertyName = "PaymentType";        // field name

            gridview.Columns[6].Name             = "PaymentAmount";      // name
            gridview.Columns[6].HeaderText       = "Cost";               // header text
            gridview.Columns[6].DataPropertyName = "PaymentAmount";      // field name

            gridview.Columns[7].Name             = "UserHistId";         // name
            gridview.Columns[7].HeaderText       = "UserHist ID";        // header text
            gridview.Columns[7].DataPropertyName = "UserHistId";         // field name


            gridview.Columns[8].Visible = false;

            gridview.Columns[9].Visible = false;

            gridview.Columns[10].Visible = false;

            gridview.Columns[11].Visible = false;

            gridview.Columns[12].Visible = false;

            gridview.Columns[13].Visible = false;

            gridview.Columns[14].Visible = false;
        }