Пример #1
0
        internal FlightHistoryCore.Model.RouteDestination Convert()
        {
            DbModel.Destination origin      = null;
            DbModel.Destination destination = null;
            DbModel.Estimate    real        = null;

            if (Origin != null)
            {
                origin = Origin.Convert();
            }
            if (Destination != null)
            {
                destination = Destination.Convert();
            }
            if (Real != null && Real is Estimated)
            {
                real = ((Estimated)Real).Convert();
            }

            return(new DbModel.RouteDestination()
            {
                Origin = origin,
                Destination = destination,
                Real = real
            });
        }
Пример #2
0
        internal FlightHistoryCore.Model.FlightStatus Convert()
        {
            DbModel.Estimate estimate = null;

            if (Estimated != null && Estimated is FlightHistoryScraper.Json.Estimated)
            {
                estimate = ((Json.Estimated)Estimated).Convert();
            }

            return(new DbModel.FlightStatus()
            {
                Text = this.Text,
                Live = this.Live,
                Estimate = estimate
            });
        }
Пример #3
0
        internal FlightHistoryCore.Model.FlightTime Convert()
        {
            DbModel.Estimate scheduled = null;
            DbModel.Estimate real      = null;
            DbModel.Estimate estimated = null;
            long?            eta       = 0;
            long?            updated   = 0;


            if (Scheduled != null)
            {
                scheduled = Scheduled.Convert();
            }
            if (Real != null)
            {
                real = Real.Convert();
            }
            if (Estimated != null)
            {
                estimated = Estimated.Convert();
            }
            if (Other != null)
            {
                eta     = Other.Eta;
                updated = Other.Updated;
            }

            return(new DbModel.FlightTime()
            {
                Scheduled = scheduled,
                Real = real,
                Estimated = estimated,
                Eta = eta,
                Updated = updated
            });
        }