Esempio n. 1
0
        public static CdmaCompoundCellView ConstructView(this CdmaCell onexCell, CdmaCell evdoCell, IBtsRepository repository)
        {
            CdmaCompoundCellView view = null;

            if (onexCell != null)
            {
                view = Mapper.Map <CdmaCell, CdmaCompoundCellView>(onexCell);
                view.OnexFrequencyList = onexCell.FrequencyList;
                if (evdoCell != null)
                {
                    view.EvdoFrequencyList = evdoCell.FrequencyList;
                }
            }
            else if (evdoCell != null)
            {
                view = Mapper.Map <CdmaCell, CdmaCompoundCellView>(evdoCell);
                view.EvdoFrequencyList = evdoCell.FrequencyList;
            }

            if (view != null)
            {
                var bts = repository.GetByBtsId(view.BtsId);
                view.BtsName = bts?.Name;
            }

            return(view);
        }
Esempio n. 2
0
        public static CdmaCellView ConstructView(this CdmaCell cell, IBtsRepository repository)
        {
            var view = Mapper.Map <CdmaCell, CdmaCellView>(cell);
            var bts  = repository.GetByBtsId(cell.BtsId);

            view.BtsName = bts?.Name;
            return(view);
        }
Esempio n. 3
0
 public void VanishBtss(ENodebIdsContainer container)
 {
     foreach (
         var bts in
         container.ENodebIds.Select(btsId => _btsRepository.GetByBtsId(btsId))
         .Where(bts => bts != null))
     {
         bts.IsInUse = false;
         _btsRepository.Update(bts);
     }
     _btsRepository.SaveChanges();
 }
Esempio n. 4
0
        public void UpdateENodebBtsIds(IEnumerable <CellExcel> infos)
        {
            var idPairs =
                Mapper.Map <IEnumerable <CellExcel>, IEnumerable <ENodebBtsIdPair> >(infos)
                .Where(x => x.BtsId != -1)
                .Distinct()
                .ToList();

            if (!idPairs.Any())
            {
                return;
            }
            idPairs.ForEach(x =>
            {
                var bts = _btsRepository.GetByBtsId(x.BtsId);
                if (bts == null)
                {
                    return;
                }
                bts.ENodebId = x.ENodebId;
                _btsRepository.Update(bts);
            });
        }
Esempio n. 5
0
        public CdmaBtsView GetByBtsId(int btsId)
        {
            var item = _btsRepository.GetByBtsId(btsId);

            if (item == null)
            {
                return(null);
            }
            var view = item.MapTo <CdmaBtsView>();
            var town = _townRepository.Get(item.TownId);

            view.DistrictName = town.DistrictName;
            view.TownName     = town.TownName;
            return(view);
        }
        public IEnumerable <CdmaBtsView> Query(string collegeName)
        {
            var ids =
                _repository.GetAllList(
                    x =>
                    x.HotspotName == collegeName && x.HotspotType == HotspotType.College &&
                    x.InfrastructureType == InfrastructureType.CdmaBts);
            var btss  = ids.Select(x => _btsRepository.GetByBtsId(x.BtsId)).Where(bts => bts != null).ToList();
            var views = Mapper.Map <List <CdmaBts>, List <CdmaBtsView> >(btss);

            views.ForEach(x =>
            {
                var town = _townRepository.Get(x.TownId);
                if (town != null)
                {
                    x.DistrictName = town.DistrictName;
                    x.TownName     = town.TownName;
                }
            });
            return(views);
        }
Esempio n. 7
0
        public void UpdateTown(IENodebRepository eNodebRepository, IBtsRepository btsRepository,
                               ITownRepository townRepository)
        {
            if (ENodebId > 10000)
            {
                UpdateTown(eNodebRepository, townRepository);
            }
            var bts = btsRepository.GetByBtsId(ENodebId);

            if (bts == null)
            {
                return;
            }
            ENodebName = bts.Name;
            var town = bts.TownId == -1 ? null : townRepository.Get(bts.TownId);

            if (town == null)
            {
                return;
            }
            City     = town.CityName;
            District = town.DistrictName;
            Town     = town.TownName;
        }
Esempio n. 8
0
        public static CdmaCompoundCellView ConstructView(CdmaCell onexCell, CdmaCell evdoCell, IBtsRepository repository)
        {
            CdmaCompoundCellView view = null;
            if (onexCell != null)
            {
                view = Mapper.Map<CdmaCell, CdmaCompoundCellView>(onexCell);
                view.OnexFrequencyList = onexCell.FrequencyList;
                if (evdoCell != null) view.EvdoFrequencyList = evdoCell.FrequencyList;
            }
            else if (evdoCell != null)
            {
                view = Mapper.Map<CdmaCell, CdmaCompoundCellView>(evdoCell);
                view.EvdoFrequencyList = evdoCell.FrequencyList;
            }

            if (view != null)
            {
                var bts = repository.GetByBtsId(view.BtsId);
                view.BtsName = bts?.Name;
            }

            return view;
        }
Esempio n. 9
0
 public static CdmaCellView ConstructView(CdmaCell cell, IBtsRepository repository)
 {
     var view = Mapper.Map<CdmaCell, CdmaCellView>(cell);
     var bts = repository.GetByBtsId(cell.BtsId);
     view.BtsName = bts?.Name;
     return view;
 }
Esempio n. 10
0
 public void UpdateTown(IENodebRepository eNodebRepository, IBtsRepository btsRepository,
     ITownRepository townRepository)
 {
     if (ENodebId > 10000)
     {
         UpdateTown(eNodebRepository, townRepository);
     }
     var bts = btsRepository.GetByBtsId(ENodebId);
     if (bts == null) return;
     ENodebName = bts.Name;
     var town = bts.TownId == -1 ? null : townRepository.Get(bts.TownId);
     if (town == null) return;
     City = town.CityName;
     District = town.DistrictName;
     Town = town.TownName;
 }