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()); }
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> >()); }
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)); }
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)); }
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)); }
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))); }
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() }); }
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(); }
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 })); }
public List <VipDemandDto> Query(string phoneNumber) { var towns = _townRepository.GetAllList(); return(_repository.Query <IVipDemandRepository, VipDemand, VipDemandDto>( towns, _repository.GetAllList(x => x.PhoneNumber == phoneNumber))); }
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); }
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); }
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; })); }
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; })); }
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(); }
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()); }
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); }
public EmergencyCommunicationDto Query(int id) { var towns = _townRepository.GetAllList(); return (_repository.Query <IEmergencyCommunicationRepository, EmergencyCommunication, EmergencyCommunicationDto>( towns, id)); }
public DingliController(ITownRepository townRepository) { LogRecordRepository.ThroughputCalculationDelay = 1; if (towns == null) { towns = townRepository.GetAllList(); } }
public SaveENodebListService(IENodebRepository repository, ParametersDumpInfrastructure infrastructure, ITownRepository townRepository) { _repository = repository; _baseRepository = new ENodebBaseRepository(repository); _townList = townRepository.GetAllList(); _infrastructure = infrastructure; _infrastructure.ENodebsUpdated = 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; }
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()); }
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); }
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); }
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); }
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()); }
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); }
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); }
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()); }
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); }
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); }
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(); }
public QueryLteStatController(ITopCellRepository<TownPreciseCoverage4GStat> lteStatRepository, ITownRepository townRepository) { this.lteStatRepository = lteStatRepository; towns = townRepository.GetAllList(); }
public DingliController(ITownRepository townRepository) { LogRecordRepository.ThroughputCalculationDelay = 1; if (towns == null) towns = townRepository.GetAllList(); }
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(); }
public QueryTownServiceTestHelper(ITownRepository townRepository) { towns = townRepository.GetAllList(); }
public TownRepositoryQueryTestHelp(ITownRepository townRepository) { _towns = townRepository.GetAllList(); }