public IEnumerable <CdmaCellView> GetViews(string collegeName) { var ids = _repository.GetAllList( x => x.HotspotType == HotspotType.College && x.InfrastructureType == InfrastructureType.CdmaCell && x.HotspotName == collegeName); var query = ids.Select(x => _cellRepository.GetBySectorId(x.BtsId, x.SectorId)).Where(cell => cell != null).ToList(); return(query.Any() ? query.Select(x => CellQueries.ConstructView(x, _btsRepository)) : null); }
public int DumpNewCellExcels(IEnumerable <CdmaCellExcel> infos) { var cellList = Mapper.Map <IEnumerable <CdmaCellExcel>, List <CdmaCell> >(infos); if (!cellList.Any()) { return(0); } var count = 0; foreach (var cell in cellList) { var item = _cellRepository.GetBySectorId(cell.BtsId, cell.SectorId); if (item == null) { if (_cellRepository.Insert(cell) != null) { count++; } } else { item.Pn = cell.Pn; item.IsInUse = true; _cellRepository.Update(item); count++; } } _cellRepository.SaveChanges(); return(count); }