public System.Collections.Generic.List <Jinher.AMP.BTP.Deploy.CustomDTO.CommodityListCDTO> GetCommodityList(Jinher.AMP.BTP.Deploy.CustomDTO.QryCommodityDTO qryCommodityDTO) { base.Do(); return(this.Command.GetCommodityList(qryCommodityDTO)); }
/// <summary> /// 获取商品列表 /// </summary> /// <param name="qryCommodityDTO"></param> /// <returns></returns> public System.Collections.Generic.List <Jinher.AMP.BTP.Deploy.CustomDTO.CommodityListCDTO> GetCommodityListExt(Jinher.AMP.BTP.Deploy.CustomDTO.QryCommodityDTO qryCommodityDTO) { if (qryCommodityDTO == null) { return(new List <CommodityListCDTO>()); } List <Jinher.AMP.BTP.Deploy.CustomDTO.CommodityListCDTO> result; Jinher.AMP.ZPH.Deploy.CustomDTO.QryCommodityDTO query = new ZPH.Deploy.CustomDTO.QryCommodityDTO() { SetCategoryId = qryCommodityDTO.SetCategoryId, PageIndex = qryCommodityDTO.PageIndex, PageSize = qryCommodityDTO.PageSize, FieldSort = qryCommodityDTO.FieldSort, Order = qryCommodityDTO.Order, IsHasStock = qryCommodityDTO.IsHasStock, MinPrice = qryCommodityDTO.MinPrice, MaxPrice = qryCommodityDTO.MaxPrice, ChannelId = qryCommodityDTO.ChannelId, AppId = qryCommodityDTO.AppId }; try { result = new List <Jinher.AMP.BTP.Deploy.CustomDTO.CommodityListCDTO>(); List <Jinher.AMP.ZPH.Deploy.CustomDTO.CommodityListCDTO> comListReuslt = Jinher.AMP.BTP.TPS.ZPHSV.Instance.GetCommodityList(query); //类转换一下 foreach (Jinher.AMP.ZPH.Deploy.CustomDTO.CommodityListCDTO comTmp in comListReuslt) { Jinher.AMP.BTP.Deploy.CustomDTO.CommodityListCDTO comTmpBTP = new CommodityListCDTO(); comTmpBTP.Name = comTmp.Name; comTmpBTP.Price = comTmp.Price; comTmpBTP.Id = comTmp.Id; comTmpBTP.Pic = comTmp.Pic; comTmpBTP.Intensity = comTmp.Intensity; comTmpBTP.State = comTmp.State; comTmpBTP.Stock = comTmp.Stock; comTmpBTP.DiscountPrice = comTmp.DiscountPrice; comTmpBTP.LimitBuyEach = comTmp.LimitBuyEach; comTmpBTP.LimitBuyTotal = comTmp.LimitBuyTotal; comTmpBTP.SurplusLimitBuyTotal = comTmp.SurplusLimitBuyTotal; comTmpBTP.AppId = comTmp.AppId; comTmpBTP.IsActiveCrowdfunding = comTmp.IsActiveCrowdfunding; comTmpBTP.AppName = comTmp.AppName; comTmpBTP.MarketPrice = comTmp.MarketPrice; comTmpBTP.IsEnableSelfTake = comTmp.IsEnableSelfTake; result.Add(comTmpBTP); } return(result); } catch (Exception ex) { LogHelper.Error(string.Format("获取商品列表接口异常。qryCommodityDTO:{0}", JsonHelper.JsonSerializer(qryCommodityDTO)), ex); return(new List <Jinher.AMP.BTP.Deploy.CustomDTO.CommodityListCDTO>()); } }
public System.Collections.Generic.List <Jinher.AMP.BTP.Deploy.CustomDTO.CommodityListCDTO> GetCommodityList(Jinher.AMP.BTP.Deploy.CustomDTO.QryCommodityDTO qryCommodityDTO) { //定义返回值 System.Collections.Generic.List <Jinher.AMP.BTP.Deploy.CustomDTO.CommodityListCDTO> result; int tmp = 0; try { //调用代理方法 result = base.Channel.GetCommodityList(qryCommodityDTO); } catch { //抛异常 throw; } finally { //关链接 ChannelClose(); } //返回结果 return(result); }