Esempio n. 1
0
        public IEnumerable <TownHourCqiView> QueryLastDateView(DateTime initialDate,
                                                               FrequencyBandType frequency = FrequencyBandType.All)
        {
            var stats = _repository.QueryDate(initialDate,
                                              (repository, beginDate, endDate) =>
                                              repository.GetAllList(x => x.StatDate >= beginDate && x.StatDate < endDate &&
                                                                    x.FrequencyBandType == frequency)
                                              .OrderBy(x => x.StatDate)
                                              .ToList());

            return(stats.Select(x => x.ConstructView <TownHourCqi, TownHourCqiView>(_townRepository)));
        }
        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));
        }