public CollegeRegion Get(int id, double area, string message) { CollegeInfo info = _repository.Get(id); if (info == null) { return(null); } UpdateRegion(id, area, message, info, RegionType.Polygon); _repository.Update(info); return(info.CollegeRegion); }
public CollegeStat QueryStat(int id) { var info = _repository.Get(id); return(info == null ? null : new CollegeStat(_repository, info, _infrastructureRepository)); }
public CollegeStat QueryStat(int id, int year) { var info = _repository.Get(id); return(info == null ? null : new CollegeStat(_repository, info, _yearRepository.GetByCollegeAndYear(id, year), _infrastructureRepository, _eNodebRepository, _cellRepository, _btsRepository, _cdmaCellRepository)); }
public ActionResult CollegeDetails(int id) { CollegeInfo info = _repository.Get(id); IEnumerable <Town> towns = _townRepository.GetAllList(); CollegeDto dto = (info == null) ? new CollegeDto() : new CollegeDto(info, towns); CollegeEditViewModel viewModel = new CollegeEditViewModel { CollegeDto = dto }; viewModel.Initialize(towns, new Town { CityName = dto.CityName, DistrictName = dto.DistrictName, TownName = dto.TownName }); return(View(viewModel)); }
public IEnumerable <College3GTestView> GetViews(DateTime date, int hour) { var statTime = date.AddHours(hour); var results = _repository.GetAll().Where(x => x.TestTime == statTime).ToList(); if (!results.Any()) { return(new List <College3GTestView>()); } return(results.Select(x => { var college = _collegeRepository.Get(x.CollegeId); var view = x.MapTo <College3GTestView>(); view.CollegeName = college?.Name; return view; })); }
public IEnumerable <College4GTestView> GetViews(DateTime begin, DateTime end) { var results = _repository.GetAllList(x => x.TestTime >= begin && x.TestTime < end); if (!results.Any()) { return(new List <College4GTestView>()); } return(results.Select(x => { var college = _collegeRepository.Get(x.CollegeId); var eNodeb = _eNodebRepository.FirstOrDefault(e => e.ENodebId == x.ENodebId); var cell = eNodeb == null ? null : _cellRepository.GetBySectorId(x.ENodebId, x.SectorId); var view = x.MapTo <College4GTestView>(); view.CollegeName = college?.Name; view.CellName = eNodeb?.Name + "-" + x.SectorId; view.Pci = cell?.Pci ?? -1; return view; })); }
public IEnumerable <College4GTestView> GetViews(DateTime date, int hour) { var statTime = date.AddHours(hour); var results = _repository.GetAllList().Where(x => x.TestTime == statTime).ToList(); if (!results.Any()) { return(new List <College4GTestView>()); } return(results.Select(x => { var college = _collegeRepository.Get(x.CollegeId); var eNodeb = _eNodebRepository.GetByENodebId(x.ENodebId); var cell = eNodeb == null ? null : _cellRepository.GetBySectorId(x.ENodebId, x.SectorId); var view = x.MapTo <College4GTestView>(); view.CollegeName = college?.Name; view.CellName = eNodeb?.Name + "-" + x.SectorId; view.Pci = cell?.Pci ?? -1; return view; })); }
public IEnumerable <GetCollegesQuery> Get() { return(_repository.Get()); }
public CollegeInfo Get(int id) { return(_repository.Get(id)); }
public IHttpActionResult Get(int id) { CollegeInfo info = _repository.Get(id); return(info == null ? (IHttpActionResult)BadRequest("College Id Not Found!") : Ok(info)); }
public CollegeStat(ICollegeRepository repository, int id) { CollegeInfo info = repository.Get(id); CollegeRegion region = repository.GetRegion(id); Name = info.Name; ExpectedSubscribers = info.ExpectedSubscribers; Area = region.Area; Id = region.AreaId; }