Exemple #1
0
 public CollegeStat(ICollegeRepository repository, CollegeInfo info, CollegeYearInfo yearInfo,
                    IInfrastructureRepository infrastructureRepository, IHotSpotENodebRepository eNodebRepository,
                    IHotSpotCellRepository cellRepository, IHotSpotBtsRepository btsRepository,
                    IHotSpotCdmaCellRepository cdmaCellRepository)
 {
     Name = info.Name;
     ExpectedSubscribers = yearInfo?.ExpectedSubscribers ?? 0;
     Area = repository.GetRegion(info.Id)?.Area ?? 0;
     Id   = info.Id;
     UpdateStats(infrastructureRepository);
     TotalLteENodebs =
         eNodebRepository.Count(
             x =>
             x.HotspotName == Name && x.HotspotType == HotspotType.College &&
             x.InfrastructureType == InfrastructureType.ENodeb);
     TotalLteCells =
         cellRepository.Count(
             x =>
             x.HotspotName == Name && x.HotspotType == HotspotType.College &&
             x.InfrastructureType == InfrastructureType.Cell);
     TotalCdmaBts =
         btsRepository.Count(
             x =>
             x.HotspotName == Name && x.HotspotType == HotspotType.College &&
             x.InfrastructureType == InfrastructureType.CdmaBts);
     TotalCdmaCells =
         cdmaCellRepository.Count(
             x =>
             x.HotspotName == Name && x.HotspotType == HotspotType.College &&
             x.InfrastructureType == InfrastructureType.CdmaCell);
 }
        public async Task <int> SaveYearInfo(CollegeYearInfo info)
        {
            var item = _yearRepository.GetByCollegeAndYear(info.CollegeId, info.Year);

            if (item != null)
            {
                return(0);
            }
            await _yearRepository.InsertAsync(info);

            return(_yearRepository.SaveChanges());
        }
Exemple #3
0
 public async Task <int> Post(CollegeYearInfo info)
 {
     return(await _service.SaveYearInfo(info));
 }