/// <summary> /// 得到经销商OKC信息 /// </summary> /// <param name="dto"></param> /// <returns></returns> public static ResultData <List <DistributorOKCProduct> > GetDisOKCList(DistributorPriceAuthoritySearchDTO dto) { ResultData <List <DistributorOKCProduct> > result = null; result = GetAPI <ResultData <List <DistributorOKCProduct> > >(WebConfiger.MasterDataServicesUrl + "DistributorPriceAuthority?DistributorPriceAuthoritySearchDTO=" + TransformHelper.ConvertDTOTOBase64JsonString(dto)); return(result); }
public HttpResponseMessage GetDisOKCList(string DistributorPriceAuthoritySearchDTO) { DistributorPriceAuthoritySearchDTO dto = TransformHelper.ConvertBase64JsonStringToDTO <DistributorPriceAuthoritySearchDTO>(DistributorPriceAuthoritySearchDTO); ResultDTO <List <DistributorOKCProduct> > actionresult = new ResultDTO <List <DistributorOKCProduct> >(); actionresult.Object = _IDistributorServices.GetDisOKCList(dto); actionresult.SubmitResult = true; actionresult.Count = dto.Count; HttpResponseMessage result = new HttpResponseMessage { Content = new StringContent(JsonConvert.SerializeObject(actionresult), System.Text.Encoding.GetEncoding("UTF-8"), "application/json") }; return(result); }
/// <summary> /// 得到经销商OKC信息 /// </summary> /// <param name="dto"></param> /// <returns></returns> public List <DistributorOKCProduct> GetDisOKCList(DistributorPriceAuthoritySearchDTO dto) { List <DistributorOKCProduct> result = null; var tcdmse = SingleQueryObject.GetObj(); var pp = tcdmse.master_DistributorOKCInfo.AsNoTracking().Where(p => p.DistributorOKCID != null); if (dto.DistributorID != null) { pp = pp.Where(p => p.DistributorID == dto.DistributorID); } if (!string.IsNullOrEmpty(dto.SearchText)) { pp = pp.Where(p => p.master_OKCInfo.OKCNO.Contains(dto.SearchText)); } dto.Count = pp.Count(); pp = pp.OrderBy(o => o.OKCID).Skip((dto.page - 1) * dto.rows).Take(dto.rows); result = Mapper.Map <List <master_DistributorOKCInfo>, List <DistributorOKCProduct> >(pp.ToList()); return(result); }