public static CdmaBts ConstructBts(this BtsExcel info, ITownRepository repository) { var town = repository.QueryTown(info.DistrictName, info.TownName); var bts = Mapper.Map <BtsExcel, CdmaBts>(info); bts.TownId = town?.Id ?? -1; return(bts); }
public static ENodeb ConstructENodeb(ENodebExcel info, ITownRepository repository) { var town = repository.QueryTown(info.CityName, info.DistrictName, info.TownName); var eNodeb = Mapper.Map <ENodebExcel, ENodeb>(info); eNodeb.TownId = town?.Id ?? -1; return(eNodeb); }
public IEnumerable <ENodebView> GetByTownNames(string city, string district, string town) { var townItem = _townRepository.QueryTown(city, district, town); return(townItem == null ? null : _eNodebRepository.GetAll().Where(x => x.TownId == townItem.Id).ToList().MapTo <IEnumerable <ENodebView> >()); }
public List <List <GeoPoint> > QueryTownBoundaries(string district, string town) { var townItem = _townRepository.QueryTown(district, town); if (townItem == null) { return(null); } return(_boundaryRepository.GetAllList(x => x.TownId == townItem.Id).Select(x => x.CoorList()).ToList()); }
public static int DumpItem <TRepository, TEntity, TItem>(this TRepository repository, TItem dto, ITownRepository townRepository) where TRepository : IRepository <TEntity>, IMatchRepository <TEntity, TItem>, ISaveChanges where TEntity : Entity where TItem : IDistrictTown, ITownId { dto.TownId = townRepository.QueryTown(dto.District, dto.Town)?.Id ?? 1; return (repository .ImportOne <TRepository, TEntity, TItem>(dto)); }
public static List <TDto> Query <TRepository, TEntity, TDto>(this TRepository repository, ITownRepository townRepository, string district, string town, DateTime begin, DateTime end) where TRepository : IDateSpanRepository <TEntity> where TDto : IDistrictTown { var townId = townRepository.QueryTown(district, town)?.Id ?? 1; var results = Mapper.Map <List <TEntity>, List <TDto> >(repository.GetAllList(townId, begin, end)); results.ForEach(x => { x.District = district; x.Town = town; }); return(results); }
public async Task <int> UpdateAsync(VipDemandDto dto) { dto.TownId = _townRepository.QueryTown(dto.District, dto.Town)?.Id ?? 1; return(await _repository.UpdateOne <IVipDemandRepository, VipDemand, VipDemandDto>(dto)); }