Esempio n. 1
0
        public bool DumpSingleBtsExcel(BtsExcel info)
        {
            var bts = info.ConstructBts(_townRepository);

            if (bts == null)
            {
                bts = info.ConstructBts(_townRepository);
                var result = _btsRepository.Insert(bts);
                if (result == null)
                {
                    return(false);
                }
                var item = BasicImportService.BtsExcels.FirstOrDefault(x => x.BtsId == info.BtsId);
                if (item != null)
                {
                    BasicImportService.BtsExcels.Remove(item);
                }
                _btsRepository.SaveChanges();
                return(true);
            }
            bts.IsInUse = true;
            _btsRepository.Update(bts);
            _btsRepository.SaveChanges();
            return(true);
        }
Esempio n. 2
0
        public void Post(CdmaBts bts)
        {
            CdmaBts item = _repository.GetAll().FirstOrDefault(x => x.ENodebId == bts.ENodebId);

            if (item != null)
            {
                item.Name    = bts.Name;
                item.Address = bts.Address;
                _repository.Update(item);
            }
        }
Esempio n. 3
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);
            });
        }
 public void Update()
 {
     foreach (BtsENodebIds idDefinition in _eNodebIds)
     {
         var     id  = idDefinition.BtsId;
         CdmaBts bts = _repository.GetAll().FirstOrDefault(x => x.BtsId == id);
         if (bts == null)
         {
             continue;
         }
         bts.ENodebId = idDefinition.ENodebId;
         _repository.Update(bts);
     }
 }
Esempio n. 5
0
        public ActionResult UpdateBtsInfo(CdmaBts item)
        {
            CdmaBts bts = _btsRepository.GetAll().FirstOrDefault(x => x.ENodebId == item.ENodebId);

            if (bts == null)
            {
                return(View("ENodebEdit", new ENodebDetailsViewModel()));
            }
            bts.Address = item.Address;
            bts.Name    = item.Name;
            _btsRepository.Update(bts);
            ENodebDetailsViewModel viewModel = new ENodebDetailsViewModel();

            viewModel.Import(bts.ENodebId, _eNodebRepository, _cellRepository, _btsRepository, _cdmaCellRepository,
                             _photoRepository);
            return(View("ENodebEdit", viewModel));
        }
Esempio n. 6
0
 public void Update(Bts item)
 {
     item.UpdatedDate = DateTime.Now;
     _btsRepository.Update(item);
 }