Exemple #1
0
        public IEnumerable <TownCqiStat> 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));
        }
Exemple #2
0
        public CqiRegionDateView QueryLastDateCqi(DateTime initialDate, string city)
        {
            var stats = _cqiRepository.QueryLastDate(initialDate, (repository, beginDate, endDate) =>
            {
                var query =
                    _cqiRepository.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 <TownCqiStat, TownCqiView>(_townRepository);

            return(townViews.QueryRegionDateView <CqiRegionDateView, DistrictCqiView, TownCqiView>(initialDate,
                                                                                                   DistrictCqiView.ConstructView));
        }