Exemplo n.º 1
0
        public FilteredPriceMap GetPricesByUnitFilteredByStatus(
            string SenStayID,
            SenStayPropertyIndex Units,
            StreamlineSeasonGroup Seasons,
            UnitPriceStatus Status)
        {
            if (!Data.ContainsKey(SenStayID))
            {
                return(null);
            }
            var prices = Data[SenStayID];

            var NewsetTimestamp = Status.LastSyncTimeStamp;
            var list            = new FilteredPriceMap();

            foreach (var p in prices)
            {
                if (p.Tiemstamp <= Status.LastSyncTimeStamp)
                {
                    continue;
                }
                var key = p.GetKey();

                if (p.Tiemstamp > NewsetTimestamp)
                {
                    NewsetTimestamp = p.Tiemstamp;
                }

                var item = PriceProcesser.Convert(p, Units, Seasons);
                if (item == null)
                {
                    continue;
                }

                if (list.ContainsKey(key))
                {
                    if (list[key].TimeStamp < p.Tiemstamp)
                    {
                        list[key] = PriceProcesser.Convert(p, Units, Seasons);
                    }
                }
                else
                {
                    list.Add(key, PriceProcesser.Convert(p, Units, Seasons));
                }
            }
            Status.LastSyncTimeStamp = NewsetTimestamp;
            return(list);
        }
Exemplo n.º 2
0
        public List <AdoptedDailyPrice> GetPricesByUnit(string SenStayID, SenStayPropertyIndex Units,
                                                        StreamlineSeasonGroup Seasons)
        {
            if (!Data.ContainsKey(SenStayID))
            {
                return(null);
            }
            var prices = Data[SenStayID];

            var list = new List <AdoptedDailyPrice>();

            foreach (var p in prices)
            {
                var item = PriceProcesser.Convert(p, Units, Seasons);
                if (item != null)
                {
                    list.Add(item);
                }
            }
            return(list);
        }