コード例 #1
0
        public List <ENodeb> GetDistrictENodebs(string city, string district)
        {
            var towns   = _townRepository.GetAllList(x => x.CityName == city && x.DistrictName == district);
            var eNodebs = _eNodebRepository.GetAllList();

            return((from t in towns join e in eNodebs on t.Id equals e.TownId select e).ToList());
        }
コード例 #2
0
        public IEnumerable <CdmaBtsView> GetByTownNames(string city, string district, string town)
        {
            var townItem = _townRepository.GetAllList()
                           .FirstOrDefault(x => x.CityName == city && x.DistrictName == district && x.TownName == town);

            return(townItem == null
                ? null
                : _btsRepository.GetAll().Where(x => x.TownId == townItem.Id).ToList().MapTo <IEnumerable <CdmaBtsView> >());
        }
コード例 #3
0
        public ActionResult List()
        {
            IEnumerable <CollegeInfo> infos     = _repository.GetAllList();
            IEnumerable <Town>        towns     = _townRepository.GetAllList();
            CollegeViewModel          viewModel = new CollegeViewModel
            {
                Colleges = infos.Select(x => new CollegeDto(x, towns))
            };

            return(View(viewModel));
        }
コード例 #4
0
        public QciRegionDateView QueryLastDateStat(DateTime initialDate, string city)
        {
            var stats = _statRepository.QueryLastDate(initialDate, (repository, beginDate, endDate) =>
            {
                var query =
                    _statRepository.GetAllList(x => x.StatTime >= beginDate & x.StatTime < endDate);
                return(query.FilterTownList(_townRepository.GetAllList().Where(x => x.CityName == city).ToList()));
            });
            var townViews = stats.ConstructViews <TownQciStat, TownQciView>(_townRepository);

            return(townViews.QueryRegionDateView <QciRegionDateView, DistrictQciView, TownQciView>(initialDate,
                                                                                                   DistrictQciView.ConstructView));
        }
コード例 #5
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));
        }
コード例 #6
0
        public IEnumerable <TownFlowView> QueryLastDateView(DateTime initialDate, string city, string district,
                                                            FrequencyBandType frequency = FrequencyBandType.All)
        {
            var towns = _townRepository.GetAllList(x => x.CityName == city && x.DistrictName == district);
            var stats = _repository.QueryLastDate(initialDate,
                                                  (repository, beginDate, endDate) =>
                                                  repository.GetAllList(x => x.StatTime >= beginDate && x.StatTime < endDate &&
                                                                        x.FrequencyBandType == frequency)
                                                  .OrderBy(x => x.StatTime)
                                                  .ToList());
            var filterStats = from s in stats join t in towns on s.TownId equals t.Id select s;

            return(filterStats.Select(x => x.ConstructView <TownFlowStat, TownFlowView>(_townRepository)));
        }
コード例 #7
0
        public void SaveOneTown()
        {
            Town town = _repository.GetAllList().Query(_city, _district, _town);

            if (town != null)
            {
                return;
            }
            _repository.Insert(new Town
            {
                CityName     = _city.Trim(),
                DistrictName = _district.Trim(),
                TownName     = _town.Trim()
            });
        }
コード例 #8
0
 public KpiImportService(ICdmaRegionStatRepository regionStatRepository,
                         ITopDrop2GCellRepository top2GRepository, ITopConnection3GRepository top3GRepository,
                         ITopConnection2GRepository topConnection2GRepository, IVipDemandRepository vipDemandRepository,
                         IComplainItemRepository complainItemRepository, IBranchDemandRepository branchDemandRepository,
                         IOnlineSustainRepository onlineSustainRepository, IPlanningSiteRepository planningSiteRepository,
                         IComplainProcessRepository processRepository, ITownRepository townRepository,
                         IFileRecordRepository fileRecordRepository, IDtFileInfoRepository dtFileInfoRepository,
                         IRasterTestInfoRepository rasterTestInfoRepository, ILteProblemRepository lteProblemRepository)
 {
     _regionStatRepository      = regionStatRepository;
     _top2GRepository           = top2GRepository;
     _top3GRepository           = top3GRepository;
     _topConnection2GRepository = topConnection2GRepository;
     _vipDemandRepository       = vipDemandRepository;
     _complainItemRepository    = complainItemRepository;
     _branchDemandRepository    = branchDemandRepository;
     _onlineSustainRepository   = onlineSustainRepository;
     _planningSiteRepository    = planningSiteRepository;
     _processRepository         = processRepository;
     _fileRecordRepository      = fileRecordRepository;
     _dtFileInfoRepository      = dtFileInfoRepository;
     _rasterTestInfoRepository  = rasterTestInfoRepository;
     _lteProblemRepository      = lteProblemRepository;
     _towns = townRepository.GetAllList();
 }
コード例 #9
0
ファイル: RasterInfoService.cs プロジェクト: yanzj/BackGround
        public IEnumerable <DistrictFileView> QueryCityTestInfos(DateTime begin, DateTime end, string dataType)
        {
            var allInfos = QueryFileInfos(dataType, begin, end).ToList();
            var towns    = _townRepository.GetAllList(x =>
                                                      x.TownName != "×æÃí" && x.TownName != "ʯÍå" && x.TownName != "ÕÅé¶" && x.TownName != "СÌÁ");
            var views = towns.Select(town => QueryAreaTestFileViewsInTowns(allInfos, town));

            return(views.GroupBy(x => x.District).Select(g => new DistrictFileView
            {
                District = g.Key,
                Distance = g.Sum(x => x.Distance),
                Count = g.Sum(x => x.Count),
                CoverageCount = g.Sum(x => x.CoverageCount),
                TownViews = g
            }));
        }
コード例 #10
0
        public List <VipDemandDto> Query(string phoneNumber)
        {
            var towns = _townRepository.GetAllList();

            return(_repository.Query <IVipDemandRepository, VipDemand, VipDemandDto>(
                       towns, _repository.GetAllList(x => x.PhoneNumber == phoneNumber)));
        }
コード例 #11
0
        public IEnumerable <CdmaBtsView> GetByTownNames(string city, string district, string town)
        {
            var townItem = _townRepository.GetAllList()
                           .FirstOrDefault(x => x.CityName == city && x.DistrictName == district && x.TownName == town);
            var viewList = _btsRepository.GetAllList(x => x.TownId == townItem.Id).MapTo <List <CdmaBtsView> >();

            viewList.ForEach(x =>
            {
                x.CityName     = city;
                x.DistrictName = district;
                x.TownName     = town;
            });
            return(townItem == null
                ? new List <CdmaBtsView>()
                : viewList);
        }
コード例 #12
0
        public int DumpBtsExcels(IEnumerable <BtsExcel> infos)
        {
            var containers = (from info in infos
                              join town in _townRepository.GetAllList()
                              on new { info.DistrictName, info.TownName } equals
                              new { town.DistrictName, town.TownName }
                              select new BtsExcelWithTownIdContainer
            {
                BtsExcel = info,
                TownId = town.Id
            }).ToArray();

            if (!containers.Any())
            {
                return(0);
            }
            var items =
                Mapper.Map <IEnumerable <BtsExcelWithTownIdContainer>, List <BtsWithTownIdContainer> >(containers);

            items.ForEach(x => { x.CdmaBts.TownId = x.TownId; });

            var count = 0;

            foreach (var bts in items.Select(x => x.CdmaBts).ToList())
            {
                if (_btsRepository.Insert(bts) != null)
                {
                    count++;
                }
            }
            _btsRepository.SaveChanges();
            return(count);
        }
コード例 #13
0
ファイル: CustomerQueries.cs プロジェクト: yanzj/BackGround
        public static IEnumerable <TView> QueryItemViews <TItem, TView>(this IEnumerable <TItem> items, string city,
                                                                        string district, ITownRepository repository)
            where TItem : ITownId
            where TView : ICityDistrictTown
        {
            var views = district != "其他"
                ? from item in items
                        join town in repository.GetAllList(x => x.CityName == city && x.DistrictName == district) on
                        item.TownId equals town.Id
                        select new
            {
                Town = town,
                Item = item
            }
                : items.Where(x => x.TownId == 0).Select(item => new
            {
                Town = new Town {
                    TownName = "其他"
                },
                Item = item
            });

            return(views.Select(x =>
            {
                var view = x.Item.MapTo <TView>();
                view.City = city;
                view.District = district;
                view.Town = x.Town.TownName;
                return view;
            }));
        }
コード例 #14
0
        public IEnumerable <AreaTestFileView> QueryDistrictTestInfos(DateTime begin, DateTime end, string city, string district)
        {
            var allInfos =
                _areaTestInfoRepository.GetAllList();
            var towns = _townRepository.GetAllList(x => x.CityName == city && x.DistrictName == district);
            var views = from info in allInfos
                        join file in _fileInfoRepository.GetAllList(x => x.TestDate > begin && x.TestDate < end)
                        on info.FileId equals file.Id
                        join town in towns on info.TownId equals town.Id
                        select new
            {
                Info = info,
                File = file,
                Town = town
            };

            return(views.Select(v =>
            {
                var view = v.Info.MapTo <AreaTestFileView>();
                view.AreaName = v.Town.CityName + v.Town.DistrictName + v.Town.TownName;
                view.CsvFileName = v.File.CsvFileName;
                view.TestDate = v.File.TestDate;
                return view;
            }));
        }
コード例 #15
0
        public void ImportTownENodebStats(ITownRepository townRepository, IENodebRepository eNodebRepository,
                                          IRegionRepository regionRepository)
        {
            IEnumerable <ENodeb> eNodebs = eNodebRepository.GetAllList();

            TownENodebStats = townRepository.GetAllList().Select(
                x => new TownENodebStat(x, eNodebs, regionRepository)).ToList();
        }
コード例 #16
0
 public static List <TTownStat> QueryTownStat <TTownStat>(this IEnumerable <TTownStat> query,
                                                          ITownRepository townRepository, string city)
     where TTownStat : ITownId
 {
     return((from q in query
             join t in townRepository.GetAllList().Where(x => x.CityName == city) on q.TownId equals t.Id
             select q).ToList());
 }
コード例 #17
0
        public IEnumerable <ENodeb> GetENodebsByDistrict(string city, string district)
        {
            var towns = _townRepository.GetAllList(city, district);

            return(from town in towns
                   join eNodeb in _eNodebRepository.GetAllList() on town.Id equals eNodeb.TownId
                   select eNodeb);
        }
コード例 #18
0
        public EmergencyCommunicationDto Query(int id)
        {
            var towns = _townRepository.GetAllList();

            return
                (_repository.Query <IEmergencyCommunicationRepository, EmergencyCommunication, EmergencyCommunicationDto>(
                     towns, id));
        }
コード例 #19
0
 public DingliController(ITownRepository townRepository)
 {
     LogRecordRepository.ThroughputCalculationDelay = 1;
     if (towns == null)
     {
         towns = townRepository.GetAllList();
     }
 }
コード例 #20
0
 public SaveENodebListService(IENodebRepository repository,
                              ParametersDumpInfrastructure infrastructure, ITownRepository townRepository)
 {
     _repository     = repository;
     _baseRepository = new ENodebBaseRepository(repository);
     _townList       = townRepository.GetAllList();
     _infrastructure = infrastructure;
     _infrastructure.ENodebsUpdated = 0;
 }
コード例 #21
0
 public SaveENodebListService(IENodebRepository repository,
     ParametersDumpInfrastructure infrastructure, ITownRepository townRepository)
 {
     _repository = repository;
     _baseRepository = new ENodebBaseRepository(repository);
     _townList = townRepository.GetAllList();
     _infrastructure = infrastructure;
     _infrastructure.ENodebsUpdated = 0;
 }
コード例 #22
0
 public static bool DeleteOneBts(this IBtsRepository repository, ITownRepository townRepository,
     string districtName, string townName, string btsName)
 {
     int townId = townRepository.GetAllList().QueryId(districtName, townName);
     CdmaBts bts = repository.QueryBts(townId, btsName);
     if (bts == null) return false;
     repository.Delete(bts);
     return true;
 }
コード例 #23
0
        public IEnumerable <TownBoundaryView> GetTownBoundaryViews(string city, string district, string town)
        {
            var item =
                _repository.GetAllList()
                .FirstOrDefault(x => x.CityName == city && x.DistrictName == district && x.TownName == town);

            if (item == null)
            {
                return(new List <TownBoundaryView>());
            }
            var coors = _boundaryRepository.GetAllList(x => x.TownId == item.Id);

            return(coors.Select(coor => new TownBoundaryView
            {
                Town = town,
                BoundaryGeoPoints = coor.CoorList()
            }).ToList());
        }
コード例 #24
0
        public static ENodeb ConstructENodeb(this ENodebExcel info, ITownRepository repository)
        {
            var town = repository.GetAllList()
                       .FirstOrDefault(x => x.CityName == info.CityName && x.DistrictName == info.DistrictName && x.TownName == info.TownName);
            var eNodeb = Mapper.Map <ENodebExcel, ENodeb>(info);

            eNodeb.TownId = town?.Id ?? -1;
            return(eNodeb);
        }
コード例 #25
0
        public IEnumerable <ENodebView> GetByTownNames(string city, string district, string town)
        {
            var townItem = _townRepository.GetAllList()
                           .FirstOrDefault(x => x.CityName == city && x.DistrictName == district && x.TownName == town);

            if (townItem == null)
            {
                return(new List <ENodebView>());
            }
            var list = _eNodebRepository.GetAllList(x => x.TownId == townItem.Id).MapTo <List <ENodebView> >();

            list.ForEach(x =>
            {
                x.CityName     = city;
                x.DistrictName = district;
                x.TownName     = town;
            });
            return(list);
        }
コード例 #26
0
        public void UploadMrGrids(StreamReader reader, string fileName)
        {
            var xml = new XmlDocument();

            xml.Load(reader);
            var districts = _townRepository.GetAllList().Select(x => x.DistrictName).Distinct();
            var district  = districts.FirstOrDefault(fileName.Contains);

            UploadMrGrids(xml, district, fileName);
        }
コード例 #27
0
        public static List <TView> QueryTownStat <TTownStat, TView>(this IEnumerable <TTownStat> query,
                                                                    ITownRepository townRepository, string city)
            where TTownStat : ITownId
            where TView : ICityDistrictTown
        {
            var towns = townRepository.GetAllList(x => x.CityName == city);

            return((from q in query
                    join t in towns on q.TownId equals t.Id
                    select q.ConstructView <TTownStat, TView>(t)).ToList());
        }
コード例 #28
0
        public static bool DeleteOneBts(this IBtsRepository repository, ITownRepository townRepository,
                                        string districtName, string townName, string btsName)
        {
            int     townId = townRepository.GetAllList().QueryId(districtName, townName);
            CdmaBts bts    = repository.QueryBts(townId, btsName);

            if (bts == null)
            {
                return(false);
            }
            repository.Delete(bts);
            return(true);
        }
コード例 #29
0
        public IEnumerable <PlanningSiteView> GetAllSites(bool isOpened)
        {
            var towns = _townRepository.GetAllList();
            var views = new List <PlanningSiteView>();

            foreach (
                var stats in
                towns.Select(
                    town =>
                    GetPlanningSites(town, isOpened)
                    .MapTo <List <PlanningSiteView> >()
                    .Select(x =>
            {
                x.District = town.DistrictName;
                x.Town = town.TownName;
                return(x);
            })))
            {
                views.AddRange(stats);
            }
            return(views);
        }
コード例 #30
0
        public static List <ENodeb> QueryENodebs(this ITownRepository townRepository, IENodebRepository eNodebRepository,
                                                 string city, string district)
        {
            var towns = townRepository.GetAllList(x => x.CityName == city && x.DistrictName == district);

            if (!towns.Any())
            {
                return(new List <ENodeb>());
            }
            return((from eNodeb in eNodebRepository.GetAllList()
                    join town in towns on eNodeb.TownId equals town.Id
                    select eNodeb).ToList());
        }
コード例 #31
0
ファイル: CustomerQueries.cs プロジェクト: yanzj/BackGround
        public static List <TDto> Query <TRepository, TEntity, TDto>(this TRepository repository,
                                                                     ITownRepository townRepository, DateTime begin, DateTime end)
            where TRepository : IDateSpanRepository <TEntity>
            where TDto : IDistrictTown, ITownId
        {
            var results = Mapper.Map <List <TEntity>, List <TDto> >(repository.GetAllList(begin, end));
            var towns   = townRepository.GetAllList();

            results.ForEach(x =>
            {
                UpdateTown(towns, x);
            });
            return(results);
        }
コード例 #32
0
        public int DumpNewEnodebExcels(IEnumerable <ENodebExcel> infos)
        {
            var containers = (from info in infos
                              join town in _townRepository.GetAllList()
                              on new { info.CityName, info.DistrictName, info.TownName } equals
                              new { town.CityName, town.DistrictName, town.TownName }
                              select new ENodebExcelWithTownIdContainer
            {
                ENodebExcel = info,
                TownId = town.Id
            }).ToArray();

            if (!containers.Any())
            {
                return(0);
            }
            var items =
                Mapper.Map <IEnumerable <ENodebExcelWithTownIdContainer>, List <ENodebWithTownIdContainer> >(containers);

            items.ForEach(x => { x.ENodeb.TownId = x.TownId; });

            var count = 0;

            foreach (var eNodeb in items.Select(x => x.ENodeb).ToList())
            {
                var item = _eNodebRepository.FirstOrDefault(x => x.ENodebId == eNodeb.ENodebId);
                if (item == null)
                {
                    var result = _eNodebRepository.Insert(eNodeb);
                    if (result != null)
                    {
                        count++;
                    }
                }
                else
                {
                    item.IsInUse = true;
                    item.Name    = eNodeb.Name;
                    item.Address = eNodeb.Address;
                    item.Factory = eNodeb.Factory;
                    _eNodebRepository.SaveChanges();
                }
            }
            _eNodebRepository.SaveChanges();
            return(count);
        }
コード例 #33
0
 public KpiImportService(ICdmaRegionStatRepository regionStatRepository,
     ITopDrop2GCellRepository top2GRepository, ITopConnection3GRepository top3GRepository,
     ITopConnection2GRepository topConnection2GRepository,
     IDownSwitchFlowRepository downSwitchRepository, IVipDemandRepository vipDemandRepository,
     IComplainItemRepository complainItemRepository, IBranchDemandRepository branchDemandRepository,
     IOnlineSustainRepository onlineSustainRepository, IPlanningSiteRepository planningSiteRepository, 
     ITownRepository townRepository)
 {
     _regionStatRepository = regionStatRepository;
     _top2GRepository = top2GRepository;
     _top3GRepository = top3GRepository;
     _topConnection2GRepository = topConnection2GRepository;
     _downSwitchRepository = downSwitchRepository;
     _vipDemandRepository = vipDemandRepository;
     _complainItemRepository = complainItemRepository;
     _branchDemandRepository = branchDemandRepository;
     _onlineSustainRepository = onlineSustainRepository;
     _planningSiteRepository = planningSiteRepository;
     _towns = townRepository.GetAllList();
 }
コード例 #34
0
 public QueryLteStatController(ITopCellRepository<TownPreciseCoverage4GStat> lteStatRepository,
     ITownRepository townRepository)
 {
     this.lteStatRepository = lteStatRepository;
     towns = townRepository.GetAllList();
 }
コード例 #35
0
ファイル: DingliController.cs プロジェクト: ouyh18/LteTools
 public DingliController(ITownRepository townRepository)
 {
     LogRecordRepository.ThroughputCalculationDelay = 1;
     if (towns == null)
         towns = townRepository.GetAllList();
 }
コード例 #36
0
 public void ImportTownENodebStats(ITownRepository townRepository, IENodebRepository eNodebRepository,
     IRegionRepository regionRepository)
 {
     IEnumerable<ENodeb> eNodebs = eNodebRepository.GetAllList();
     TownENodebStats = townRepository.GetAllList().Select(
         x => new TownENodebStat(x, eNodebs, regionRepository)).ToList();
 }
コード例 #37
0
 public QueryTownServiceTestHelper(ITownRepository townRepository)
 {
     towns = townRepository.GetAllList();
 }
コード例 #38
0
 public TownRepositoryQueryTestHelp(ITownRepository townRepository)
 {
     _towns = townRepository.GetAllList();
 }