public IEnumerable <ENodebView> GetByGeneralName(string name) { var items = _eNodebRepository.GetAllList().Where(x => x.Name.Contains(name.Trim())).ToArray(); if (items.Any()) { return(items.Select(item => ENodebView.ConstructView(item, _townRepository))); } var eNodebId = name.Trim().ConvertToInt(0); if (eNodebId > 0) { items = _eNodebRepository.GetAllList(x => x.ENodebId == eNodebId).ToArray(); if (items.Any()) { return(items.Select(item => ENodebView.ConstructView(item, _townRepository))); } } items = _eNodebRepository.GetAllList() .Where( x => (!string.IsNullOrEmpty(x.Address) && x.Address.Contains(name.Trim())) || (!string.IsNullOrEmpty(x.PlanNum) && x.PlanNum.Contains(name.Trim()))) .ToArray(); return(items.Any() ? items.Select(item => ENodebView.ConstructView(item, _townRepository)) : new List <ENodebView>()); }
public IEnumerable <ENodebView> QueryENodebViews(double west, double east, double south, double north) { var eNodebs = _eNodebRepository.GetAllList(x => x.Longtitute >= west && x.Longtitute <= east && x.Lattitute >= south && x.Lattitute <= north); return(eNodebs.Any() ? eNodebs.Select(e => ENodebView.ConstructView(e, _townRepository)) : new List <ENodebView>()); }
public IEnumerable <ENodebView> QueryCollegeENodebs(string collegeName, DateTime begin, DateTime end) { var ids = _repository.GetENodebIds(collegeName); return((from id in ids select _eNodebRepository.Get(id) into eNodeb where eNodeb != null let stats = _alarmRepository.GetAllList(begin, end, eNodeb.ENodebId) select ENodebView.ConstructView(eNodeb, stats)).ToList()); }
public IEnumerable <ENodebView> QueryENodebViews(ENodebRangeContainer container) { var eNodebs = _eNodebRepository.GetAllList(x => x.Longtitute >= container.West && x.Longtitute <= container.East && x.Lattitute >= container.South && x.Lattitute <= container.North) .Where(x => x.IsInUse) .ToList(); var excludedENodebs = from eNodeb in eNodebs join id in container.ExcludedIds on eNodeb.ENodebId equals id select eNodeb; eNodebs = eNodebs.Except(excludedENodebs).ToList(); return(eNodebs.Any() ? eNodebs.Select(e => ENodebView.ConstructView(e, _townRepository)) : new List <ENodebView>()); }
public ENodebView GetByPlanNum(string planNum) { var item = _eNodebRepository.FirstOrDefault(x => x.PlanNum == planNum); return(ENodebView.ConstructView(item, _townRepository)); }
public ENodebView GetByENodebId(int eNodebId) { var item = _eNodebRepository.FirstOrDefault(x => x.ENodebId == eNodebId); return(ENodebView.ConstructView(item, _townRepository)); }