Beispiel #1
0
        public List <byte> GetSectorIds(string btsName)
        {
            var bts = _btsRepository.GetByName(btsName);

            return(bts == null
                ? null
                : _repository.GetAll().Where(x => x.BtsId == bts.BtsId).Select(x => x.SectorId).Distinct().ToList());
        }
 public int SaveCdmaCells(IEnumerable<CollegeCdmaCellExcel> cellExcels, ICdmaCellRepository cellRepository)
 {
     int count = 0;
     foreach (CollegeCdmaCellExcel excel in cellExcels)
     {
         CdmaCell cell =
             cellRepository.GetAll().FirstOrDefault(
                 x => x.BtsId == excel.BtsId && x.SectorId == excel.SectorId);
         if (cell == null) continue;
         InfrastructureInfo infrastructure = _repository.FirstOrDefault(x =>
             x.HotspotName == excel.CollegeName && x.HotspotType == HotspotType.College
             && x.InfrastructureType == InfrastructureType.CdmaCell && x.InfrastructureId == cell.Id);
         if (infrastructure == null)
         {
             infrastructure = new InfrastructureInfo
             {
                 HotspotName = excel.CollegeName,
                 HotspotType = HotspotType.College,
                 InfrastructureType = InfrastructureType.CdmaCell,
                 InfrastructureId = cell.Id
             };
             _repository.Insert(infrastructure);
         }
         count++;
     }
     return count;
 }
        public int SaveCdmaCells(IEnumerable <CollegeCdmaCellExcel> cellExcels, ICdmaCellRepository cellRepository)
        {
            int count = 0;

            foreach (CollegeCdmaCellExcel excel in cellExcels)
            {
                CdmaCell cell =
                    cellRepository.GetAll().FirstOrDefault(
                        x => x.BtsId == excel.BtsId && x.SectorId == excel.SectorId);
                if (cell == null)
                {
                    continue;
                }
                InfrastructureInfo infrastructure = _repository.InfrastructureInfos.FirstOrDefault(x =>
                                                                                                   x.HotspotName == excel.CollegeName && x.HotspotType == HotspotType.College &&
                                                                                                   x.InfrastructureType == InfrastructureType.CdmaCell && x.InfrastructureId == cell.Id);
                if (infrastructure == null)
                {
                    infrastructure = new InfrastructureInfo
                    {
                        HotspotName        = excel.CollegeName,
                        HotspotType        = HotspotType.College,
                        InfrastructureType = InfrastructureType.CdmaCell,
                        InfrastructureId   = cell.Id
                    };
                    _repository.AddOneInfrastructure(infrastructure);
                    _repository.SaveChanges();
                }
                count++;
            }
            return(count);
        }
Beispiel #4
0
        public void Import(int eNodebId,
                           IENodebRepository eNodebRepository, ICellRepository cellRepository, IBtsRepository btsRepository,
                           ICdmaCellRepository cdmaCellRepository, IENodebPhotoRepository photoRepository)
        {
            ENodeb eNodeb = eNodebRepository.GetAll().FirstOrDefault(x => x.ENodebId == eNodebId);

            if (eNodeb != null)
            {
                ENodeb = eNodeb;
                Cells  = cellRepository.GetAll().Where(x => x.ENodebId == eNodebId).ToList();
            }
            CdmaBts bts = btsRepository.GetAll().FirstOrDefault(x => x.ENodebId == eNodebId);

            if (bts != null)
            {
                int btsId = bts.BtsId;
                Bts       = bts;
                CdmaCells = cdmaCellRepository.GetAll().Where(x => x.BtsId == btsId).ToList();
            }
            Photos = photoRepository.Photos.Where(x => x.ENodebId == eNodebId).ToList();
        }
 public static CdmaCell Query(this ICdmaCellRepository repository,
                              int btsId, byte sectorId, string cellType)
 {
     return(repository.GetAll().FirstOrDefault(
                x => x.BtsId == btsId && x.SectorId == sectorId && x.CellType == cellType));
 }
 public IEnumerable <CdmaCell> GetCells(double west, double east, double south, double north)
 {
     return(_repository.GetAll().Where(x =>
                                       x.Longtitute >= west && x.Longtitute <= east && x.Lattitute >= south && x.Lattitute <= north));
 }