コード例 #1
0
ファイル: OrderBll.cs プロジェクト: radtek/Shop
 public List <OrderLogisticsModel> GetOrderLogistics(string orderCode)
 {
     try
     {
         var orderExpress = orderDao.GetOrderExpress(orderCode);
         if (orderExpress == null || string.IsNullOrEmpty(orderExpress.ExpressList))
         {
             return(null);
         }
         var client   = new GetSFDataClient();
         var expInfos = client.GetExpressInfo(orderExpress.ExpressList);
         var list     = ConvertExpressInfo(expInfos);
         if (list != null)
         {
             foreach (var item in list)
             {
                 item.ExpressCompany = orderExpress.ExpressCompany;
                 item.ExpressList    = orderExpress.ExpressList;
             }
         }
         return(list);
     }
     catch (Exception e)
     {
         LogHelper.Error(e);
         return(null);
     }
 }
コード例 #2
0
ファイル: MyBll.cs プロジェクト: radtek/Shop
        /// <summary>
        /// 获取物流信息
        /// </summary>
        /// <param name="orderCode"></param>
        /// <returns></returns>
        public List <ExpressInfoEntity> GetOrderLogistics(string orderCode)
        {
            List <ExpressInfoEntity> list = new List <ExpressInfoEntity>();

            try
            {
                using (GetSFDataClient client = new GetSFDataClient())
                {
                    string expressCode = dal.GetExpressCodeByOrderCode(orderCode);
                    if (string.IsNullOrEmpty(expressCode))
                    {
                        return(list);
                    }
                    list = client.GetExpressInfo(expressCode);
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
            }
            return(list);
        }