public static IEnumerable<IndoorDistribution> QueryCollegeCdmaDistributions( this IInfrastructureRepository repository, IIndoorDistributioinRepository indoorRepository, CollegeInfo info) { IEnumerable<int> ids = repository.InfrastructureInfos.Where(x => x.HotspotName == info.Name && x.InfrastructureType == InfrastructureType.CdmaIndoor ).Select(x => x.InfrastructureId).ToList(); return ids.Select(i => indoorRepository.IndoorDistributions.FirstOrDefault(x => x.Id == i) ).Where(distribution => distribution != null).ToList(); }
public static IEnumerable <IndoorDistribution> QueryCollegeCdmaDistributions( this IInfrastructureRepository repository, IIndoorDistributioinRepository indoorRepository, CollegeInfo info) { IEnumerable <int> ids = repository.InfrastructureInfos.Where(x => x.HotspotName == info.Name && x.InfrastructureType == InfrastructureType.CdmaIndoor ).Select(x => x.InfrastructureId).ToList(); return(ids.Select(i => indoorRepository.IndoorDistributions.FirstOrDefault(x => x.Id == i) ).Where(distribution => distribution != null).ToList()); }
public CollegeController(ICollegeRepository repository, ITownRepository townRepository, IInfrastructureRepository infrastructureRepository, IIndoorDistributioinRepository indoorDistributioinRepository, IENodebRepository eNodebRepository, ICellRepository cellRepository, IBtsRepository btsRepository, ICdmaCellRepository cdmaCellRepository) { _repository = repository; _townRepository = townRepository; _infrastructureRepository = infrastructureRepository; _indoorDistributioinRepository = indoorDistributioinRepository; _eNodebRepository = eNodebRepository; _cellRepository = cellRepository; _btsRepository = btsRepository; _cdmaCellRepository = cdmaCellRepository; }
public CollegeController(ICollegeRepository repository, ITownRepository townRepository, IInfrastructureRepository infrastructureRepository, IIndoorDistributioinRepository indoorDistributioinRepository, IENodebRepository eNodebRepository, ICellRepository cellRepository, IBtsRepository btsRepository, ICdmaCellRepository cdmaCellRepository) { _repository = repository; _townRepository = townRepository; _infrastructureRepository = infrastructureRepository; _indoorDistributioinRepository = indoorDistributioinRepository; _eNodebRepository = eNodebRepository; _cellRepository = cellRepository; _btsRepository = btsRepository; _cdmaCellRepository = cdmaCellRepository; }
public CollegeController( IInfrastructureRepository infrastructureRepository, IIndoorDistributioinRepository indoorDistributioinRepository, IENodebRepository eNodebRepository, ICellRepository cellRepository, IBtsRepository btsRepository, ICdmaCellRepository cdmaCellRepository, IAlarmRepository alarmRepository) { _infrastructureRepository = infrastructureRepository; _indoorDistributioinRepository = indoorDistributioinRepository; _eNodebRepository = eNodebRepository; _cellRepository = cellRepository; _btsRepository = btsRepository; _cdmaCellRepository = cdmaCellRepository; _alarmRepository = alarmRepository; }
private int SaveIndoorDistributions(IEnumerable <CollegeIndoorExcel> indoorExcels, IIndoorDistributioinRepository distributioinRepository, InfrastructureType type) { int count = 0; foreach (CollegeIndoorExcel excel in indoorExcels) { IndoorDistribution distribution = distributioinRepository.IndoorDistributions.FirstOrDefault(x => x.Name == excel.Name && x.Range == excel.Range && x.SourceName == excel.SourceName); if (distribution == null) { distribution = new IndoorDistribution { Name = excel.Name, Range = excel.Range, SourceName = excel.SourceName, SourceType = excel.SourceType, Longtitute = excel.Longtitute, Lattitute = excel.Lattitute }; distribution = distributioinRepository.AddOneDistribution(distribution); distributioinRepository.SaveChanges(); } InfrastructureInfo infrastructure = _repository.InfrastructureInfos.FirstOrDefault(x => x.HotspotName == excel.CollegeName && x.HotspotType == HotspotType.College && x.InfrastructureType == type && x.InfrastructureId == distribution.Id); if (infrastructure == null) { infrastructure = new InfrastructureInfo { HotspotName = excel.CollegeName, HotspotType = HotspotType.College, InfrastructureType = type, InfrastructureId = distribution.Id }; _repository.AddOneInfrastructure(infrastructure); _repository.SaveChanges(); } count++; } return(count); }
public int SaveCdmaIndoorDistributions(IEnumerable<CollegeIndoorExcel> indoorExcels, IIndoorDistributioinRepository distributioinRepository) { return SaveIndoorDistributions(indoorExcels, distributioinRepository, InfrastructureType.CdmaIndoor); }
private int SaveIndoorDistributions(IEnumerable<CollegeIndoorExcel> indoorExcels, IIndoorDistributioinRepository distributioinRepository, InfrastructureType type) { int count = 0; foreach (CollegeIndoorExcel excel in indoorExcels) { IndoorDistribution distribution = distributioinRepository.IndoorDistributions.FirstOrDefault(x => x.Name == excel.Name && x.Range == excel.Range && x.SourceName == excel.SourceName); if (distribution == null) { distribution = new IndoorDistribution { Name = excel.Name, Range = excel.Range, SourceName = excel.SourceName, SourceType = excel.SourceType, Longtitute = excel.Longtitute, Lattitute = excel.Lattitute }; distribution = distributioinRepository.AddOneDistribution(distribution); distributioinRepository.SaveChanges(); } InfrastructureInfo infrastructure = _repository.FirstOrDefault(x => x.HotspotName == excel.CollegeName && x.HotspotType == HotspotType.College && x.InfrastructureType == type && x.InfrastructureId == distribution.Id); if (infrastructure == null) { infrastructure = new InfrastructureInfo { HotspotName = excel.CollegeName, HotspotType = HotspotType.College, InfrastructureType = type, InfrastructureId = distribution.Id }; _repository.Insert(infrastructure); } count++; } return count; }
public CollegeDistributionService(IInfrastructureRepository repository, IIndoorDistributioinRepository indoorRepository) { _repository = repository; _indoorRepository = indoorRepository; }
public int SaveCdmaIndoorDistributions(IEnumerable <CollegeIndoorExcel> indoorExcels, IIndoorDistributioinRepository distributioinRepository) { return(SaveIndoorDistributions(indoorExcels, distributioinRepository, InfrastructureType.CdmaIndoor)); }
public CollegeCdmaDistributionsController(IInfrastructureRepository repository, IIndoorDistributioinRepository indoorRepository) { _repository = repository; _indoorRepository = indoorRepository; }
public CollegeCdmaDistributionsController(IInfrastructureRepository repository, IIndoorDistributioinRepository indoorRepository) { _repository = repository; _indoorRepository = indoorRepository; }