Esempio n. 1
0
        public IEnumerable <TownDoubleFlow> QueryCurrentDateStats(DateTime currentDate, FrequencyBandType frequency)
        {
            var beginDate = currentDate.Date;
            var endDate   = beginDate.AddDays(1);

            return
                (_repository.GetAllList(
                     x => x.StatTime >= beginDate && x.StatTime < endDate && x.FrequencyBandType == frequency));
        }
Esempio n. 2
0
        public DoubleFlowRegionDateView QueryLastDateStat(DateTime initialDate, string city)
        {
            var stats = _statRepository.QueryLastDate(initialDate, (repository, beginDate, endDate) =>
            {
                var query =
                    _statRepository.GetAllList(x =>
                                               x.StatTime >= beginDate & x.StatTime < endDate && x.FrequencyBandType == FrequencyBandType.All);
                return(query.FilterTownList(_townRepository.GetAllList().Where(x => x.CityName == city).ToList()));
            });
            var townViews = stats.ConstructViews <TownDoubleFlow, TownDoubleFlowView>(_townRepository);

            return(townViews.QueryRegionDateView <DoubleFlowRegionDateView, DistrictDoubleFlowView, TownDoubleFlowView>(
                       initialDate,
                       DistrictDoubleFlowView.ConstructView));
        }