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

            return
                (_repository.GetAllList(
                     x => x.StatDate >= beginDate && x.StatDate < endDate && x.FrequencyBandType == frequency));
        }
Exemplo n.º 2
0
        public HourCqiRegionDateView QueryLastDateStat(DateTime initialDate, string city)
        {
            var stats = _statRepository.QueryDate(initialDate, (repository, beginDate, endDate) =>
            {
                var query =
                    _statRepository.GetAllList(x =>
                                               x.StatDate >= beginDate & x.StatDate < endDate && x.FrequencyBandType == FrequencyBandType.All);
                return(query.FilterTownList(_townRepository.GetAllList().Where(x => x.CityName == city).ToList()));
            });
            var townViews = stats.ConstructViews <TownHourCqi, TownHourCqiView>(_townRepository);

            return(townViews.QueryRegionDateDateView <HourCqiRegionDateView, DistrictHourCqiView, TownHourCqiView>(initialDate,
                                                                                                                   DistrictHourCqiView.ConstructView));
        }