Beispiel #1
0
        public Data_Schema.ArriveShowDataTable ArriveData60()
        {
            Data_Schema.ArriveShowDataTable arriveTableHours = ArriveData();
            Data_Schema.ArriveShowRow       row;
            DateTime startDateTime = DateTime.Now.AddMinutes(-60);
            DateTime endDateTime   = DateTime.Now.AddMinutes(60);

            for (int i = arriveTableHours.Rows.Count; i > 0; i--)
            {
                row = arriveTableHours.Rows[i - 1] as Data_Schema.ArriveShowRow;
                if ((row.TIME_LT < startDateTime) || (row.TIME_LT > endDateTime))
                {
                    arriveTableHours.Rows.RemoveAt(i - 1);
                }
            }
            return(arriveTableHours);
        }
Beispiel #2
0
        public Data_Schema.ArriveShowDataTable ArriveData()
        {
            Data_Schema.ArriveShowDataTable    tableToShow         = new Data_Schema.ArriveShowDataTable();
            Dictionary <long, ShareCodeArrive> shareCodeDictionary = new Dictionary <long, ShareCodeArrive>();
            Hashtable ht = new Hashtable();

            Data_Schema.ArriveWebDataTable sourceTableFromWebAndCache = GetAllArrival();
            if (sourceTableFromWebAndCache == null)
            {
                logger.Error(Constants.LoggerMessages.ProxyWebSourceError, Constants.CommonConst.TextArrive);
                sourceTableFromWebAndCache = ArriveReadHistoryFromFile(true);
            }
            Data_Schema.ArriveShowRow rowToShow;
            foreach (Data_Schema.ArriveWebRow rowSourceTableFromWebAndCache in sourceTableFromWebAndCache.Rows)
            {
                switch (rowSourceTableFromWebAndCache.ORDER)
                {
                case 1:
                    rowToShow = tableToShow.NewArriveShowRow();
                    if (shareCodeDictionary.ContainsKey(rowSourceTableFromWebAndCache.FLIGHTID))
                    {
                        shareCodeDictionary[rowSourceTableFromWebAndCache.FLIGHTID].MASTERROW = rowToShow;
                    }
                    else
                    {
                        shareCodeDictionary.Add(rowSourceTableFromWebAndCache.FLIGHTID, new ShareCodeArrive(rowToShow));
                    }
                    tableToShow.AddArriveShowRow(CopyLineDeparture(rowSourceTableFromWebAndCache, rowToShow));
                    break;

                case 0:
                    tableToShow.AddArriveShowRow(CopyLineDeparture(rowSourceTableFromWebAndCache, tableToShow.NewArriveShowRow()));
                    break;

                case 2:
                    if (shareCodeDictionary.ContainsKey(rowSourceTableFromWebAndCache.PARID))
                    {
                        shareCodeDictionary[rowSourceTableFromWebAndCache.PARID].IATAICAO.Add(rowSourceTableFromWebAndCache.IATAICAO);
                        shareCodeDictionary[rowSourceTableFromWebAndCache.PARID].ICAO_AIR.Add(rowSourceTableFromWebAndCache.ICAO_AIR);
                        shareCodeDictionary[rowSourceTableFromWebAndCache.PARID].FLGTNUM.Add(rowSourceTableFromWebAndCache.FLGTNUM);
                    }
                    else
                    {
                        shareCodeDictionary.Add(rowSourceTableFromWebAndCache.PARID, new ShareCodeArrive(rowSourceTableFromWebAndCache.IATAICAO, rowSourceTableFromWebAndCache.ICAO_AIR, rowSourceTableFromWebAndCache.FLGTNUM));
                    }

                    break;

                default:
                    logger.Warn(Constants.LoggerMessages.ProxyOrderBadValue, Constants.CommonConst.TextDeparture, rowSourceTableFromWebAndCache.PARID);
                    break;
                }
            }
            foreach (ShareCodeArrive shareCode in shareCodeDictionary.Values)
            {
                if (shareCode.MASTERROW != null)
                {
                    shareCode.MASTERROW.FLGTSHARE = Utils.ConvertListToString(shareCode.FLGTNUM, Constants.CommonConst.SelectorNewLine);
                    shareCode.MASTERROW.ICAO_AIR  = Utils.ConvertListToStringICAO(shareCode.MASTERROW.IATAICAO, shareCode.MASTERROW.ICAO_AIR, shareCode.IATAICAO,
                                                                                  shareCode.ICAO_AIR, Constants.CommonConst.SelectorDash, Constants.CommonConst.SelectorNewLine);
                }
            }
            tableToShow.AddArriveShowRow(-1, "", "", "", DateTime.Now, DateTime.Now, DateTime.Now, "", "", "", "", "", "", "", "", "", "", "", "");
            tableToShow.DefaultView.Sort             = "TIME_LT";
            tableToShow.DefaultView.ApplyDefaultSort = true;
            return(tableToShow);
        }