/// <summary> /// 获取运输方式 /// </summary> /// <param name="dt"></param> /// <returns></returns> public static ShippingMethodList GetShippingMethodList(DateTime dt) { string timestamp = dt.ConvertToUTCString(); var result = new ShippingMethodList(); try { var list = HttpHelper.DoRequest <ShippingMethodList>(_baseLISUrl + "API/LIS/GetShippingMethodList", EnumHttpMethod.GET, EnumContentType.Json, timestamp); result = list.Value; Log.Info(list.RawValue); } catch (Exception ex) { Log.Error("错误地址:" + _baseLISUrl + "API/LIS/GetShippingMethodList"); Log.Exception(ex); } return(result); }
/// <summary> /// Binds the form. /// </summary> /// <param name="reset">if set to <c>true</c> [reset].</param> private void BindForm(bool reset) { ShippingMethodList.DataSource = ShippingManager.GetShippingMethods(null); ShippingMethodList.DataBind(); if (_order != null) { AddressList.DataSource = _order.OrderAddresses; AddressList.DataBind(); if (String.IsNullOrEmpty(SelectedAddressField.Value)) { SelectedAddressField.Value = AddressList.SelectedValue; } if (String.IsNullOrEmpty(SelectedShippingMethodField.Value)) { SelectedShippingMethodField.Value = ShippingMethodList.SelectedValue; } if (SelectedShipment != null) { String formatString = "#0.00"; if (reset) { ManagementHelper.SelectListItem(ShippingMethodList, SelectedShipment.ShippingMethodId); ManagementHelper.SelectListItem(AddressList, SelectedShipment.ShippingAddressId); SelectedAddressField.Value = AddressList.SelectedValue; SelectedShippingMethodField.Value = ShippingMethodList.SelectedValue; MethodName.Text = SelectedShipment.ShippingMethodName; TrackingNumber.Text = SelectedShipment.ShipmentTrackingNumber; ShipmentTotal.Text = SelectedShipment.ShipmentTotal.ToString(formatString); DiscountAmount.Text = SelectedShipment.ShippingDiscountAmount.ToString(formatString); Status.Text = SelectedShipment.Status; //lblItemsToShip.Text = Shipment.GetShipmentLineItemsString(SelectedShipment, 3, "<br />"); LoadShipmentLineItems(); } MetaDataTab.ObjectId = SelectedShipment.ShipmentId; } else if (reset) { MethodName.Text = String.Empty; TrackingNumber.Text = String.Empty; ShipmentTotal.Text = "0"; DiscountAmount.Text = "0"; Status.Text = String.Empty; LoadShipmentLineItems(); } // Bind Meta classes // Bind Meta Form BindMetaForm(); } }