示例#1
0
        /// <summary>
        /// 根据UserID取得上次的收货信息
        /// </summary>
        public void BindInfo()
        {
            if (userid != Guid.Empty)
            {
                ProductReceiveAddress address = new LogisticBLL().getProductReceiveAddressByUserId(userid.ToString());
                if (address != null)
                {
                    this.sel_city1.Items.Clear();
                    List <AddressInfo> ProvinceList = GetList("0", 0);
                    this.sel_city1.DataSource     = ProvinceList;
                    this.sel_city1.DataTextField  = "ProName";
                    this.sel_city1.DataValueField = "ProId";
                    this.sel_city1.DataBind();

                    this.sel_city2.Items.Clear();
                    List <AddressInfo> CityList = GetList("1", int.Parse(address.Privince));
                    this.sel_city2.DataSource     = CityList;
                    this.sel_city2.DataTextField  = "ProName";
                    this.sel_city2.DataValueField = "ProId";
                    this.sel_city2.DataBind();

                    this.sel_city3.Items.Clear();
                    List <AddressInfo> DistrictList = GetList("2", int.Parse(address.City));
                    this.sel_city3.DataSource     = DistrictList;
                    this.sel_city3.DataTextField  = "ProName";
                    this.sel_city3.DataValueField = "ProId";
                    this.sel_city3.DataBind();
                    this.sel_city1.Value   = address.Privince;
                    this.sel_city2.Value   = address.City;
                    this.sel_city3.Value   = address.Area;
                    this.txt_address.Value = address.Address;
                    this.txt_name.Value    = address.UserName;
                    this.txt_phone.Value   = address.TelNo;
                }
                else
                {
                    this.sel_city1.Items.Clear();
                    List <AddressInfo> ProvinceList = GetList("0", 0);
                    this.sel_city1.DataSource     = ProvinceList;
                    this.sel_city1.DataTextField  = "ProName";
                    this.sel_city1.DataValueField = "ProId";
                    this.sel_city1.DataBind();

                    this.sel_city2.Items.Clear();
                    List <AddressInfo> CityList = GetList("1", ProvinceList.FirstOrDefault().ProId);
                    this.sel_city2.DataSource     = CityList;
                    this.sel_city2.DataTextField  = "ProName";
                    this.sel_city2.DataValueField = "ProId";
                    this.sel_city2.DataBind();

                    this.sel_city3.Items.Clear();
                    List <AddressInfo> DistrictList = GetList("2", CityList.FirstOrDefault().ProId);
                    this.sel_city3.DataSource     = DistrictList;
                    this.sel_city3.DataTextField  = "ProName";
                    this.sel_city3.DataValueField = "ProId";
                    this.sel_city3.DataBind();
                }
            }
        }
示例#2
0
        public void GetLsDt()
        {
            LogisticBLL           OptLogistic = new LogisticBLL();
            ProductReceiveAddress objPRA      = null;
            string ExpressCode = string.Empty;

            try
            {
                objPRA = OptLogistic.getProductReceiveAddressByOrderId(orderId.ToString());

                listLsDt = OptLogistic.getListLogisticDetailbyOrderId(orderId.ToString());

                ExpressCode = OptLogistic.getExpressCodeByExpress(objPRA.Express);

                if (string.IsNullOrEmpty(objPRA.Express) || string.IsNullOrEmpty(objPRA.ExpressNumber) || string.IsNullOrEmpty(ExpressCode))
                {
                    return;
                }

                List <BusinessDll.Trace> LSTrace = null;
                if (listLsDt != null)
                {
                    foreach (var li in listLsDt)
                    {
                        if (!string.IsNullOrWhiteSpace(li.Express))
                        {
                            Express = li.Express;
                        }
                        if (!string.IsNullOrWhiteSpace(li.ExpressNumber))
                        {
                            ExpressNumber = li.ExpressNumber;
                        }
                    }

                    LSTrace = new KdApiSearch().getOrderTracesByJson(ExpressCode, objPRA.ExpressNumber);
                    if (LSTrace != null && LSTrace.Count > 0)
                    {
                        LogisticDetail objLsDt = null;
                        foreach (Trace item in LSTrace)
                        {
                            objLsDt             = new LogisticDetail();
                            objLsDt.Description = item.AcceptStation;
                            objLsDt.CreateDate  = item.AcceptTime;
                            listLsDt.Insert(0, objLsDt);
                        }
                    }
                    else
                    {
                        LogisticDetail objLsDt = new LogisticDetail();
                        objLsDt.Description = "如有疑问请至物流公司官网查询详情!";
                        objLsDt.CreateDate  = DateTime.Now;
                        listLsDt.Insert(0, objLsDt);
                    }
                }
            }
            catch (Exception ex)
            {
                NetLog.WriteTraceLogHandler("获取物流信息失败_GetLsDt()", ex.Message + "|" + ex.StackTrace);
                LogisticDetail objLsDt = new LogisticDetail();
                objLsDt.Description = "领取成功,获取不到更多的物流信息!";
                objLsDt.CreateDate  = DateTime.Now;
                if (listLsDt == null)
                {
                    listLsDt = new List <LogisticDetail>();
                }
                listLsDt.Insert(0, objLsDt);
            }
        }