Exemplo n.º 1
0
 /// <summary>
 /// Copy one web source row to show destination row
 /// </summary>
 /// <param name="source"></param>
 /// <param name="destination"></param>
 /// <returns></returns>
 internal Data_Schema.DepartureShowRow CopyLineDeparture(Data_Schema.DepartureWebRow source, Data_Schema.DepartureShowRow destination)
 {
     destination.FLIGHTID = source.FLIGHTID;
     destination.TIME_LT  = source.TIME_LT;
     destination.ICAO_AIR = source.ICAO_AIR;
     destination.IATAICAO = source.IATAICAO;
     destination.FLGTNUM  = source.FLGTNUM;
     destination.S1       = source.S1;
     destination.S1CIT    = source.S1CIT;
     if (source.IsS2Null())
     {
         destination.S2 = string.Empty;
     }
     else
     {
         destination.S2 = source.S2;
     }
     if (source.IsS2CITNull())
     {
         destination.S2CIT = string.Empty;
     }
     else
     {
         destination.S2CIT = source.S2CIT;
     }
     if (source.IsHALNull())
     {
         destination.HAL = string.Empty;
     }
     else
     {
         destination.HAL = source.HAL;
     }
     if ((!source.IsCHIN_FNull()) && (!source.IsCHIN_LNull()))
     {
         destination.CHIN = string.Format("{0} - {1}", source.CHIN_F, source.CHIN_L);
     }
     else if (!source.IsCHIN_FNull())
     {
         destination.CHIN = source.CHIN_F;
     }
     else
     {
         destination.CHIN = string.Empty;
     }
     if (source.IsREMARKNull())
     {
         destination.REMARK = string.Empty;
     }
     else
     {
         destination.REMARK = source.REMARK;
     }
     if ((!source.IsGATE1Null()) && (!source.IsGATE2Null()))
     {
         destination.GATE = string.Format("{0} - {1}", source.GATE1, source.GATE2);
     }
     else if (!source.IsGATE1Null())
     {
         destination.GATE = source.GATE1;
     }
     else
     {
         destination.GATE = string.Empty;
     }
     if (source.IsHDGNull())
     {
         destination.HDG = string.Empty;
     }
     else
     {
         destination.HDG       = source.HDG;
         destination.HDGDETAIL = HDGDetail(destination.HDG);
     }
     if (!source.IsAIRCRFTNull())
     {
         destination.AIRCRAFT = source.AIRCRFT;
     }
     else
     {
         destination.AIRCRAFT = string.Empty;
     }
     if (source.IsATD_LTNull())
     {
         destination.COLOR = source.TIME_LT >= DateTime.Now ? Color.Black.Name : Color.Red.Name;
     }
     else
     {
         destination.COLOR = Color.Black.Name;
     }
     return(destination);
 }
Exemplo n.º 2
0
 public ShareCodeDeparture(Data_Schema.DepartureShowRow source)
 {
     MASTERROW = source;
 }
    /// <summary>
    /// Manipulate with every row
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.Header)
        {
            RowCount = 2;
            e.Row.Cells[(int)Colums.FLGTNUM].ColumnSpan = 2;
            e.Row.Cells.RemoveAt((int)Colums.FLGSHARE);
        }
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            Data_Schema.DepartureShowRow row = (Data_Schema.DepartureShowRow)((System.Data.DataRowView)e.Row.DataItem).Row;
            if (row.FLIGHTID <= 0)
            {
                if ((GridView1.SortExpression == "") || (GridView1.SortExpression == Colums.TIME_LT.ToString()))
                {
                    while (e.Row.Cells.Count > 1)
                    {
                        e.Row.Cells.RemoveAt(e.Row.Cells.Count - 1);
                    }
                    e.Row.Cells[0].ColumnSpan      = GridView1.Columns.Count - 1;
                    e.Row.Cells[0].Text            = string.Format(Constants.ShowData.SeparatorFormat, row.TIME_LT);
                    e.Row.Cells[0].HorizontalAlign = HorizontalAlign.Center;
                    e.Row.BackColor = Color.Black;
                    e.Row.ForeColor = Color.White;
                    e.Row.Visible   = true;
                }
                else
                {
                    while (e.Row.Cells.Count > 0)
                    {
                        e.Row.Cells.RemoveAt(e.Row.Cells.Count - 1);
                    }
                    e.Row.Visible = false;
                }
                return;
            }

            if ((GridView1.SortExpression == "") && (!SeparateLineIsShow)) // && (GridView1.SortDirection == SortDirection.Ascending))
            {
            }
            RowCount++;
            if (!row.IsFLGTSHARENull())
            {
                e.Row.Cells[(int)Colums.FLGTNUM].ToolTip  = row.FLGTSHARE;
                e.Row.Cells[(int)Colums.FLGSHARE].ToolTip = row.FLGTSHARE;
                e.Row.Cells[(int)Colums.FLGSHARE].Text    = string.Format("&nbsp;{0}&nbsp;", Constants.CommonConst.Block);
            }
            if (!row.IsS2CITNull())
            {
                e.Row.Cells[(int)Colums.S2].ToolTip = row.S2CIT;
            }
            if (!row.IsS1CITNull())
            {
                e.Row.Cells[(int)Colums.S1].ToolTip = row.S1CIT;
            }
            //            if (!row.IsIATAICAONull())
            if (!row.IsICAO_AIRNull())
            {
                e.Row.Cells[(int)Colums.IATAICAO].ToolTip = row.ICAO_AIR;
            }
            if (!row.IsHDGDETAILNull())
            {
                e.Row.Cells[(int)Colums.HDG].ToolTip = row.HDGDETAIL;
            }
            string testedDate = row.TIME_LT.ToString("yyyyMMdd");
            if (string.Compare(testedDate, currentDate) < 0)
            {
                for (int i = 0; i < e.Row.Cells.Count; i++)
                {
                    e.Row.Cells[i].BackColor = Color.LightGray;
                }
            }
            if (!row.IsCOLORNull())
            {
                for (int i = 0; i < e.Row.Cells.Count; i++)
                {
                    e.Row.Cells[i].ForeColor = Color.FromName(row.COLOR);
                }
            }
        }
    }