Esempio n. 1
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            CK1.CK1SoapClient clint = new CK1.CK1SoapClient();
            UserKeyAndToken   ukt   = new UserKeyAndToken();

            CK1.OutStoreGetPackageRequest request = new CK1.OutStoreGetPackageRequest()
            {
                MessageID = txtMessageID.Text,
                UserKey   = ukt.getUserKey(),
                Token     = ukt.getToken(),
                Custom    = txtCustom.Text,
                Sign      = txtItemSign.Text,
                Version   = txtVersion.Text,
            };

            CK1.OutStoreGetPackageResponse response = clint.OutStoreGetPackage(request);

            lblAck.Text          = response.Ack.ToString();
            lblInvocationID.Text = response.InvocationID;
            lblMessage.Text      = response.Message;

            if (response.PackageDetail != null)
            {
                lblPackageDetail.Text = response.PackageDetail.ToString();
            }


            pnlResponse.Visible = true;
            pnlRequest.Visible  = false;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            var             client = new CK1SoapClient();
            UserKeyAndToken ukt    = new UserKeyAndToken();
            var             req    = new M2CCompleteOrderRequest()
            {
                Token      = ukt.getToken(),
                UserKey    = ukt.getUserKey(),
                ActionType = EnumActionType.Submit,
                OrderSign  = "ETST12060500019",
                MessageID  = DateTime.Now.ToString("yyyyMMddHHmmss") + "M2CCompleteOrder Demo",
                Version    = "V2.1",
            };

            var resp = client.M2CCompleteOrder(req);

            if (resp.Ack == EnumAck.Success)
            {
                Response.Write("提审订单成功" + req.OrderSign);
            }
            else
            {
                Response.Write("提审订单失败" + req.OrderSign + resp.Message);
            }
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            CK1.CK1SoapClient clint = new CK1.CK1SoapClient();
            UserKeyAndToken ukt = new UserKeyAndToken();
            CK1.OutStoreGetPackageRequest request = new CK1.OutStoreGetPackageRequest()
            {
                MessageID = txtMessageID.Text,
                UserKey = ukt.getUserKey(),
                Token = ukt.getToken(),
                Custom = txtCustom.Text,
                Sign = txtItemSign.Text,
                Version = txtVersion.Text,
            };

            CK1.OutStoreGetPackageResponse response = clint.OutStoreGetPackage(request);

            lblAck.Text = response.Ack.ToString();
            lblInvocationID.Text = response.InvocationID;
            lblMessage.Text = response.Message;

            if (response.PackageDetail != null)
            {
                lblPackageDetail.Text = response.PackageDetail.ToString();
            }

            pnlResponse.Visible = true;
            pnlRequest.Visible = false;
        }
Esempio n. 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var             client = new CK1SoapClient();
            UserKeyAndToken ukt    = new UserKeyAndToken();
            var             req    = new M2CAddOrderRequest()
            {
                Token       = ukt.getToken(),
                UserKey     = ukt.getUserKey(),
                MessageID   = DateTime.Now.ToString("yyyyMMddHHmmss") + "M2CAddOrder Demo",
                Version     = "V2.1",
                Submit      = false,
                OrderDetail = new M2COrder()
                {
                    Remark    = DateTime.Now.ToString("yyyyMMddHHmmss"),
                    Warehouse = EnumWarehouse.UK,
                }
            };

            var lstPackage = new List <M2CPackage>();
            var package    = new M2CPackage()
            {
                ShipToAddress = new ShipToAddress()
                {
                    Contact  = "Wills",
                    Street1  = "street1",
                    Street2  = "street2",
                    City     = "city",
                    Province = "province",
                    PostCode = "510026",
                    Country  = "United Kingdom",
                    Phone    = "82312191",
                    Email    = "*****@*****.**"
                },
                Custom       = DateTime.Now.ToString("yyyyMMddHHmmssfff"),
                Shipping     = "None",
                ShippingV2_1 = OutStoreShippingV2_1.UKRRM,
            };
            var lstProduct = new List <OutStoreProduct>();

            lstProduct.Add(new OutStoreProduct()
            {
                StorageNo = "EJLW00000006",
                Quantity  = 1
            });
            package.ProductList = lstProduct.ToArray();
            lstPackage.Add(package);
            req.OrderDetail.PackageList = lstPackage.ToArray();

            var resp = client.M2CAddOrder(req);

            if (resp.Ack == EnumAck.Success)
            {
                Response.Write("添加订单成功" + resp.OrderSign);
            }
            else
            {
                Response.Write("添加订单失败" + resp.Message);
            }
        }
Esempio n. 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var client = new CK1SoapClient();
            UserKeyAndToken ukt = new UserKeyAndToken();
            var req = new M2CAddOrderRequest()
            {
                Token = ukt.getToken(),
                UserKey = ukt.getUserKey(),
                MessageID = DateTime.Now.ToString("yyyyMMddHHmmss") + "M2CAddOrder Demo",
                Version = "V2.1",
                Submit = false,
                OrderDetail = new M2COrder()
                {
                    Remark = DateTime.Now.ToString("yyyyMMddHHmmss"),
                    Warehouse = EnumWarehouse.UK,
                }
            };

            var lstPackage = new List<M2CPackage>();
            var package = new M2CPackage()
            {
                ShipToAddress = new ShipToAddress()
                {
                    Contact = "Wills",
                    Street1 = "street1",
                    Street2 = "street2",
                    City = "city",
                    Province = "province",
                    PostCode = "510026",
                    Country = "United Kingdom",
                    Phone = "82312191",
                    Email = "*****@*****.**"
                },
                Custom = DateTime.Now.ToString("yyyyMMddHHmmssfff"),
                Shipping = "None",
                ShippingV2_1 =  OutStoreShippingV2_1.UKRRM,
            };
            var lstProduct = new List<OutStoreProduct>();
            lstProduct.Add(new OutStoreProduct()
            {
                StorageNo = "EJLW00000006",
                Quantity = 1
            });
            package.ProductList = lstProduct.ToArray();
            lstPackage.Add(package);
            req.OrderDetail.PackageList = lstPackage.ToArray();

            var resp = client.M2CAddOrder(req);
            if (resp.Ack == EnumAck.Success)
            {
                Response.Write("添加订单成功" + resp.OrderSign);
            }
            else
            {
                Response.Write("添加订单失败" + resp.Message);
            }
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            var             clint   = new CK1.CK1SoapClient();
            UserKeyAndToken ukt     = new UserKeyAndToken();
            var             request = new CK1.ProductGetStockRequest()
            {
                MessageID = txtMessageID.Text,
                UserKey   = ukt.getUserKey(),
                Token     = ukt.getToken(),
                SKU       = txtSKU.Text,
                Version   = txtVersion.Text,
            };

            switch (ddlWarehouse.SelectedIndex)
            {
            case 0:
                request.Warehouse = CK1.EnumWarehouse.US;
                break;

            case 1:
                request.Warehouse = CK1.EnumWarehouse.UK;
                break;

            case 2:
                request.Warehouse = CK1.EnumWarehouse.AU;
                break;

            default:
                request.Warehouse = CK1.EnumWarehouse.MA;
                break;
            }

            var response = clint.ProductGetStock(request);

            lblAck.Text          = response.Ack.ToString();
            lblInvocationID.Text = response.InvocationID;
            lblMessage.Text      = response.Message;
            if (response.StockDetail != null)
            {
                lblAmount.Text          = response.StockDetail.Amount.ToString();
                lblAvailableAmount.Text = response.StockDetail.AvailableAmount.ToString();
                lblPacking.Text         = response.StockDetail.Packing.Length.ToString() + "*" + response.StockDetail.Packing.Width.ToString() + "*" + response.StockDetail.Packing.Height.ToString();
                lblStorageNo.Text       = response.StockDetail.StorageNo;
                lblWeight.Text          = response.StockDetail.Weight.ToString();
                lblStorageNo.Text       = response.StockDetail.StorageNo;
                lblSKU.Text             = response.StockDetail.SKU;
            }

            pnlResponse.Visible = true;
            pnlRequest.Visible  = false;
        }
Esempio n. 7
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            var clint = new CK1.CK1SoapClient();
            UserKeyAndToken ukt = new UserKeyAndToken();
            var request = new CK1.ProductGetStockRequest()
            {
                MessageID = txtMessageID.Text,
                UserKey = ukt.getUserKey(),
                Token = ukt.getToken(),
                SKU = txtSKU.Text,
                Version = txtVersion.Text,
            };

            switch (ddlWarehouse.SelectedIndex)
            {
                case 0:
                    request.Warehouse = CK1.EnumWarehouse.US;
                    break;
                case 1:
                    request.Warehouse = CK1.EnumWarehouse.UK;
                    break;
                case 2:
                    request.Warehouse = CK1.EnumWarehouse.AU;
                    break;
                default:
                    request.Warehouse = CK1.EnumWarehouse.MA;
                    break;

            }

            var response = clint.ProductGetStock(request);

            lblAck.Text = response.Ack.ToString();
            lblInvocationID.Text = response.InvocationID;
            lblMessage.Text = response.Message;
            if (response.StockDetail != null)
            {
                lblAmount.Text = response.StockDetail.Amount.ToString();
                lblAvailableAmount.Text = response.StockDetail.AvailableAmount.ToString();
                lblPacking.Text = response.StockDetail.Packing.Length.ToString() + "*" + response.StockDetail.Packing.Width.ToString() + "*" + response.StockDetail.Packing.Height.ToString();
                lblStorageNo.Text = response.StockDetail.StorageNo;
                lblWeight.Text = response.StockDetail.Weight.ToString();
                lblStorageNo.Text = response.StockDetail.StorageNo;
                lblSKU.Text = response.StockDetail.SKU;
            }

            pnlResponse.Visible = true;
            pnlRequest.Visible = false;
        }
Esempio n. 8
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            var             clint   = new CK1.CK1SoapClient();
            UserKeyAndToken ukt     = new UserKeyAndToken();
            var             request = new CK1.GetTrackingRequest()
            {
                MessageID = txtMessageID.Text,
                UserKey   = ukt.getUserKey(),
                Token     = ukt.getToken(),
                ItemSign  = txtItemSign.Text,
                ClientNo  = txtClintNo.Text,
                Custom    = txtCustom.Text,
                Version   = txtVersion.Text,
            };

            switch (ddlOrderType.SelectedIndex)
            {
            case 0:
                request.OrderType = CK1.OrderType.Express;
                break;

            default:
                request.OrderType = CK1.OrderType.OutStore;
                break;
            }

            CK1.GetTrackingResponse response = clint.GetTracking(request);

            lblAck.Text          = response.Ack.ToString();
            lblInvocationID.Text = response.InvocationID;
            lblMessage.Text      = response.Message;
            if (response.TrackingDetail != null)
            {
                lblDate.Text         = response.TrackingDetail.TrackDetails[0].Date.ToString();
                lblDesc.Text         = response.TrackingDetail.TrackDetails[0].Desc;
                lblLocation.Text     = response.TrackingDetail.TrackDetails[0].Location;
                lblAddress.Text      = response.TrackingDetail.TrackSummmary.Address.ToString();
                lblCarrier.Text      = response.TrackingDetail.TrackSummmary.Carrier;
                lblDeliveryTime.Text = response.TrackingDetail.TrackSummmary.DeliveryTime.ToString();
                lblLocation1.Text    = response.TrackingDetail.TrackSummmary.Location;
                lblShipTime.Text     = response.TrackingDetail.TrackSummmary.ShipTime.ToString();
                lblStatus.Text       = response.TrackingDetail.TrackSummmary.Status;
                lblTrackNumber.Text  = response.TrackingDetail.TrackSummmary.TrackNumber;
            }


            pnlResponse.Visible = true;
            pnlRequest.Visible  = false;
        }
        protected void btnOK_Click(object sender, EventArgs e)
        {
            CK1.CK1SoapClient clint = new CK1.CK1SoapClient();
            UserKeyAndToken   ukt   = new UserKeyAndToken();
            var request             = new CK1.ProductGetStorageNoRequest()
            {
                UserKey   = ukt.getUserKey(),
                Token     = ukt.getToken(),
                MessageID = txtMessageID.Text,
                SKU       = tbTitle.Text,
                Version   = txtVersion.Text
            };

            if (ddlStorage.SelectedIndex != 0)
            {
                switch (ddlStorage.SelectedIndex)
                {
                case 1:
                    request.Warehouse = CK1.EnumWarehouse.US;
                    break;

                case 2:
                    request.Warehouse = CK1.EnumWarehouse.AU;
                    break;

                default:
                    request.Warehouse = CK1.EnumWarehouse.UK;
                    break;
                }
            }
            try
            {
                var response = clint.ProductGetStorageNo(request);
                lblAck.Text          = response.Ack.ToString();
                lblInvocationID.Text = response.InvocationID;
                lblMessage.Text      = response.Message;
                lblStorageNo.Text    = response.StorageNo;
            }
            catch (Exception)
            {
                lblAck.Text = "Failure";
            }


            pnlResponse.Visible = true;
            pnlRequest.Visible  = false;
        }
Esempio n. 10
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            var clint = new CK1.CK1SoapClient();
            UserKeyAndToken ukt = new UserKeyAndToken();
            var request = new CK1.GetTrackingRequest()
            {
                MessageID = txtMessageID.Text,
                UserKey = ukt.getUserKey(),
                Token = ukt.getToken(),
                ItemSign = txtItemSign.Text,
                ClientNo = txtClintNo.Text,
                Custom = txtCustom.Text,
                Version = txtVersion.Text,
            };

            switch (ddlOrderType.SelectedIndex)
            {
                case 0:
                    request.OrderType = CK1.OrderType.Express;
                    break;
                default:
                    request.OrderType = CK1.OrderType.OutStore;
                    break;
            }

            CK1.GetTrackingResponse response = clint.GetTracking(request);

            lblAck.Text = response.Ack.ToString();
            lblInvocationID.Text = response.InvocationID;
            lblMessage.Text = response.Message;
            if (response.TrackingDetail != null)
            {
                lblDate.Text = response.TrackingDetail.TrackDetails[0].Date.ToString();
                lblDesc.Text = response.TrackingDetail.TrackDetails[0].Desc;
                lblLocation.Text = response.TrackingDetail.TrackDetails[0].Location;
                lblAddress.Text = response.TrackingDetail.TrackSummmary.Address.ToString();
                lblCarrier.Text = response.TrackingDetail.TrackSummmary.Carrier;
                lblDeliveryTime.Text = response.TrackingDetail.TrackSummmary.DeliveryTime.ToString();
                lblLocation1.Text = response.TrackingDetail.TrackSummmary.Location;
                lblShipTime.Text = response.TrackingDetail.TrackSummmary.ShipTime.ToString();
                lblStatus.Text = response.TrackingDetail.TrackSummmary.Status;
                lblTrackNumber.Text = response.TrackingDetail.TrackSummmary.TrackNumber;
            }

            pnlResponse.Visible = true;
            pnlRequest.Visible = false;
        }
        protected void btnOK_Click(object sender, EventArgs e)
        {
            CK1.CK1SoapClient clint = new CK1.CK1SoapClient();
            UserKeyAndToken ukt = new UserKeyAndToken();
            var request = new CK1.ProductGetStorageNoRequest()
            {
                UserKey = ukt.getUserKey(),
                Token = ukt.getToken(),
                MessageID = txtMessageID.Text,
                SKU = tbTitle.Text,
                Version = txtVersion.Text

            };
            if(ddlStorage.SelectedIndex != 0)
            {
                switch (ddlStorage.SelectedIndex)
                {
                    case 1:
                        request.Warehouse = CK1.EnumWarehouse.US;
                        break;
                    case 2:
                        request.Warehouse = CK1.EnumWarehouse.AU;
                        break;
                    default:
                        request.Warehouse = CK1.EnumWarehouse.UK;
                        break;
                }
            }
            try
            {
                var response = clint.ProductGetStorageNo(request);
                lblAck.Text = response.Ack.ToString();
                lblInvocationID.Text = response.InvocationID;
                lblMessage.Text = response.Message;
                lblStorageNo.Text = response.StorageNo;
            }
            catch (Exception)
            {
                lblAck.Text = "Failure";
            }

            pnlResponse.Visible = true;
            pnlRequest.Visible = false;
        }
Esempio n. 12
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            CK1.CK1SoapClient clint = new CK1.CK1SoapClient();
            UserKeyAndToken ukt = new UserKeyAndToken();
            var request = new CK1.ProductAddModelRequest()
            {
                MessageID = txtMessageID.Text,
                UserKey = ukt.getUserKey(),
                Token = ukt.getToken(),
                ModelDetail = new CK1.ProductModel()
                {

                    Category = txtCatetory.Text,
                    Custom = txtCustom.Text,
                    DeclareName = txtDeclareName.Text,
                    DeclareValue = 10,
                    Description = txtDescription.Text,
                    Packing = new CK1.Packing()
                    {
                        Height = 10,
                        Length = 10,
                        Width = 10,
                    },
                    ProductFlag = ddlProductFlag.SelectedIndex == 1 ? CK1.ProductFlag.Normal : CK1.ProductFlag.Special,
                    SKU = txtSKU.Text,
                    Warning = 10,
                    Weight = 10,
                },
                Version = txtVersion.Text,
            };

            var response = clint.ProductAddModel(request);

            lblAck.Text = response.Ack.ToString();
            lblInvocationID.Text = response.InvocationID;
            lblMessage.Text = response.Message;

            pnlResponse.Visible = true;
            pnlRequest.Visible = false;
        }
Esempio n. 13
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            var clint = new CK1.CK1SoapClient();
            UserKeyAndToken ukt = new UserKeyAndToken();
            var request = new CK1.VerifyUserRequest()
            {
                MessageID = txtMessageID.Text,
                UserKey = ukt.getUserKey(),
                Token = ukt.getToken(),
                UserID = txtUserId.Text,
                Version = txtVersion.Text,
            };

            var response = clint.VerifyUser(request);

            lblAck.Text = response.Ack.ToString();
            lblInvocationID.Text = response.InvocationID;
            lblMessage.Text = response.Message;

            pnlResponse.Visible = true;
            pnlRequest.Visible = false;
        }
Esempio n. 14
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            CK1.CK1SoapClient clint = new CK1.CK1SoapClient();
            UserKeyAndToken   ukt   = new UserKeyAndToken();
            var request             = new CK1.ProductAddModelRequest()
            {
                MessageID   = txtMessageID.Text,
                UserKey     = ukt.getUserKey(),
                Token       = ukt.getToken(),
                ModelDetail = new CK1.ProductModel()
                {
                    Category     = txtCatetory.Text,
                    Custom       = txtCustom.Text,
                    DeclareName  = txtDeclareName.Text,
                    DeclareValue = 10,
                    Description  = txtDescription.Text,
                    Packing      = new CK1.Packing()
                    {
                        Height = 10,
                        Length = 10,
                        Width  = 10,
                    },
                    ProductFlag = ddlProductFlag.SelectedIndex == 1 ? CK1.ProductFlag.Normal : CK1.ProductFlag.Special,
                    SKU         = txtSKU.Text,
                    Warning     = 10,
                    Weight      = 10,
                },
                Version = txtVersion.Text,
            };

            var response = clint.ProductAddModel(request);

            lblAck.Text          = response.Ack.ToString();
            lblInvocationID.Text = response.InvocationID;
            lblMessage.Text      = response.Message;

            pnlResponse.Visible = true;
            pnlRequest.Visible  = false;
        }
Esempio n. 15
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            var             clint   = new CK1.CK1SoapClient();
            UserKeyAndToken ukt     = new UserKeyAndToken();
            var             request = new CK1.VerifyUserRequest()
            {
                MessageID = txtMessageID.Text,
                UserKey   = ukt.getUserKey(),
                Token     = ukt.getToken(),
                UserID    = txtUserId.Text,
                Version   = txtVersion.Text,
            };

            var response = clint.VerifyUser(request);

            lblAck.Text          = response.Ack.ToString();
            lblInvocationID.Text = response.InvocationID;
            lblMessage.Text      = response.Message;

            pnlResponse.Visible = true;
            pnlRequest.Visible  = false;
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            var clint = new CK1SoapClient();
            UserKeyAndToken ukt = new UserKeyAndToken();
            var request = new OutStoreCompleteOrderRequest()
            {
                MessageID = txtMessageID.Text,
                UserKey = ukt.getUserKey(),
                Token = ukt.getToken(),
                OrderSign = txtOrderSign.Text,
                ActionType = ddlAction.Text == "Submit" ? EnumActionType.Submit : EnumActionType.Cancel,
                Version = txtVersion.Text,
            };

            OutStoreCompleteOrderResponse response = clint.OutStoreCompleteOrder(request);
            lblAck.Text = response.Ack.ToString();
            lblInvocationID.Text = response.InvocationID;
            lblMessage.Text = response.Message;

            pnlResponse.Visible = true;
            pnlRequest.Visible = false;
        }
Esempio n. 17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var client = new CK1SoapClient();
            UserKeyAndToken ukt = new UserKeyAndToken();
            var req = new M2CGetShareStockRequest()
            {
                Token = ukt.getToken(),
                UserKey = ukt.getUserKey(),
                StorageNo = "EJLW00000006",
                MessageID = DateTime.Now.ToString("yyyyMMddHHmmss") + "M2CGetShareStock Demo",
                Version = "V2.1",
            };

            var resp = client.M2CGetShareStock(req);
            if (resp.Ack == EnumAck.Success)
            {
                Response.Write("查询共享库存成功" + req.StorageNo + "可用库存" + resp.StockDetail.AvailableAmount);
            }
            else
            {
                Response.Write("查询共享库存失败" + req.StorageNo + resp.Message);
            }
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            var             clint   = new CK1SoapClient();
            UserKeyAndToken ukt     = new UserKeyAndToken();
            var             request = new OutStoreCompleteOrderRequest()
            {
                MessageID  = txtMessageID.Text,
                UserKey    = ukt.getUserKey(),
                Token      = ukt.getToken(),
                OrderSign  = txtOrderSign.Text,
                ActionType = ddlAction.Text == "Submit" ? EnumActionType.Submit : EnumActionType.Cancel,
                Version    = txtVersion.Text,
            };

            OutStoreCompleteOrderResponse response = clint.OutStoreCompleteOrder(request);

            lblAck.Text          = response.Ack.ToString();
            lblInvocationID.Text = response.InvocationID;
            lblMessage.Text      = response.Message;

            pnlResponse.Visible = true;
            pnlRequest.Visible  = false;
        }
Esempio n. 19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var client = new CK1SoapClient();
            UserKeyAndToken ukt = new UserKeyAndToken();
            var req = new M2CGetOrderRequest()
            {
                Token = ukt.getToken(),
                UserKey = ukt.getUserKey(),
                OrderSign = "ETST12060500019",
                MessageID = DateTime.Now.ToString("yyyyMMddHHmmss") + "M2CGetOrder Demo",
                Version = "V2.1",
            };

            var resp = client.M2CGetOrder(req);
            if (resp.Ack == EnumAck.Success)
            {
                Response.Write("查询订单成功" + req.OrderSign);
            }
            else
            {
                Response.Write("查询订单失败" + req.OrderSign + resp.Message);
            }
        }
Esempio n. 20
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            var clint = new CK1.CK1SoapClient();
            UserKeyAndToken ukt = new UserKeyAndToken();
            var request = new CK1.InStoreGetOrderRequest()
            {
                MessageID = txtMessageID.Text,
                UserKey = ukt.getUserKey(),
                Token = ukt.getToken(),
                OrderSign = txtOrderSign.Text,
                Version = txtVersion.Text,
            };

            CK1.InStoreGetOrderResponse response = clint.InStoreGetOrder(request);

            lblAck.Text = response.Ack.ToString();
            lblInvocationID.Text = response.InvocationID;
            lblMessage.Text = response.Message;
            if (response.OrderDetail != null)
            {
                lblArriveTime.Text = response.OrderDetail.ArriveTime.ToString();
                lblCaseList.Text = response.OrderDetail.CaseList.ToString();
                lblOrderSign.Text = response.OrderDetail.OrderSign;
                if (response.OrderDetail.PickUpAddress != null)
                {
                    lblPickUpAddress.Text = response.OrderDetail.PickUpAddress.ToString();
                }
                lblPickupType.Text = response.OrderDetail.PickupType.ToString();
                lblRemark.Text = response.OrderDetail.Remark;
                lblShippingMethod.Text = response.OrderDetail.ShippingMethod.ToString();
                lblState.Text = response.OrderDetail.State.ToString();
                lblWarehouse.Text = response.OrderDetail.Warehouse.ToString();
            }

            pnlResponse.Visible = true;
            pnlRequest.Visible = false;
        }
Esempio n. 21
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            var clint = new CK1.CK1SoapClient();
            UserKeyAndToken ukt = new UserKeyAndToken();
            var request = new CK1.ProductGetModelRequest()
            {
                MessageID = txtMessageID.Text,
                UserKey = ukt.getUserKey(),
                Token = ukt.getToken(),
                SKU = txtSKU.Text,
                Custom = txtCustom.Text,
                Version = txtVersion.Text,
            };

            var response = clint.ProductGetModel(request);

            lblAck.Text = response.Ack.ToString();
            lblInvocationID.Text = response.InvocationID;
            lblMessage.Text = response.Message;
            if (response.ModelDetail != null)
            {
                lblCatetory.Text = response.ModelDetail.Category;
                lblCustom.Text = response.ModelDetail.Custom;
                lblDeclareName.Text = response.ModelDetail.DeclareName;
                lblDeclareValue.Text = response.ModelDetail.DeclareValue.ToString();
                lblDescroption.Text = response.ModelDetail.Description;
                lblPacking.Text = response.ModelDetail.Packing.Length.ToString()
                    + "*" +response.ModelDetail.Packing.Width.ToString()
                    + "*" +response.ModelDetail.Packing.Height.ToString();
                lblProductFlag.Text = response.ModelDetail.ProductFlag.ToString();
                lblWarning.Text = response.ModelDetail.Warning.ToString();
                lblWeight.Text = response.ModelDetail.Weight.ToString();
            }

            pnlResponse.Visible = true;
            pnlRequest.Visible = false;
        }
Esempio n. 22
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            var             clint   = new CK1.CK1SoapClient();
            UserKeyAndToken ukt     = new UserKeyAndToken();
            var             request = new CK1.ProductGetModelRequest()
            {
                MessageID = txtMessageID.Text,
                UserKey   = ukt.getUserKey(),
                Token     = ukt.getToken(),
                SKU       = txtSKU.Text,
                Custom    = txtCustom.Text,
                Version   = txtVersion.Text,
            };

            var response = clint.ProductGetModel(request);

            lblAck.Text          = response.Ack.ToString();
            lblInvocationID.Text = response.InvocationID;
            lblMessage.Text      = response.Message;
            if (response.ModelDetail != null)
            {
                lblCatetory.Text     = response.ModelDetail.Category;
                lblCustom.Text       = response.ModelDetail.Custom;
                lblDeclareName.Text  = response.ModelDetail.DeclareName;
                lblDeclareValue.Text = response.ModelDetail.DeclareValue.ToString();
                lblDescroption.Text  = response.ModelDetail.Description;
                lblPacking.Text      = response.ModelDetail.Packing.Length.ToString()
                                       + "*" + response.ModelDetail.Packing.Width.ToString()
                                       + "*" + response.ModelDetail.Packing.Height.ToString();
                lblProductFlag.Text = response.ModelDetail.ProductFlag.ToString();
                lblWarning.Text     = response.ModelDetail.Warning.ToString();
                lblWeight.Text      = response.ModelDetail.Weight.ToString();
            }

            pnlResponse.Visible = true;
            pnlRequest.Visible  = false;
        }
Esempio n. 23
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            var             clint   = new CK1.CK1SoapClient();
            UserKeyAndToken ukt     = new UserKeyAndToken();
            var             request = new CK1.InStoreGetOrderRequest()
            {
                MessageID = txtMessageID.Text,
                UserKey   = ukt.getUserKey(),
                Token     = ukt.getToken(),
                OrderSign = txtOrderSign.Text,
                Version   = txtVersion.Text,
            };

            CK1.InStoreGetOrderResponse response = clint.InStoreGetOrder(request);

            lblAck.Text          = response.Ack.ToString();
            lblInvocationID.Text = response.InvocationID;
            lblMessage.Text      = response.Message;
            if (response.OrderDetail != null)
            {
                lblArriveTime.Text = response.OrderDetail.ArriveTime.ToString();
                lblCaseList.Text   = response.OrderDetail.CaseList.ToString();
                lblOrderSign.Text  = response.OrderDetail.OrderSign;
                if (response.OrderDetail.PickUpAddress != null)
                {
                    lblPickUpAddress.Text = response.OrderDetail.PickUpAddress.ToString();
                }
                lblPickupType.Text     = response.OrderDetail.PickupType.ToString();
                lblRemark.Text         = response.OrderDetail.Remark;
                lblShippingMethod.Text = response.OrderDetail.ShippingMethod.ToString();
                lblState.Text          = response.OrderDetail.State.ToString();
                lblWarehouse.Text      = response.OrderDetail.Warehouse.ToString();
            }

            pnlResponse.Visible = true;
            pnlRequest.Visible  = false;
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            var clint = new CK1.CK1SoapClient();
            UserKeyAndToken ukt = new UserKeyAndToken();
            var request = new CK1.OutStoreGetPackageRequest()
            {
                MessageID = txtMessageID.Text,
                UserKey = ukt.getUserKey(),
                Token = ukt.getToken(),
                Custom = txtCustom.Text,
                Sign = txtSign.Text,
                Version = txtVersion.Text,
            };

            var response = clint.OutStoreGetPackage(request);

            lblAck.Text = response.Ack.ToString();
            lblInvocationID.Text = response.InvocationID;
            lblMessage.Text = response.Message;

            if (response.PackageDetail != null)
            {
                lblCustom.Text = response.PackageDetail.Custom;
                lblPackageList.Text = response.PackageDetail.ProductList.ToString();
                lblRemark.Text = response.PackageDetail.Remark;
                lblServices.Text = response.PackageDetail.Services;
                lblShipping.Text = response.PackageDetail.Shipping.ToString();
                lblShipToAddress.Text = response.PackageDetail.ShipToAddress.ToString();
                lblSign.Text = response.PackageDetail.Sign;
                lblState.Text = response.PackageDetail.State.ToString();
                lblTrackingNumber.Text = response.PackageDetail.TrackingNumber;
            }

            pnlResponse.Visible = true;
            pnlRequest.Visible = false;
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            var             clint   = new CK1.CK1SoapClient();
            UserKeyAndToken ukt     = new UserKeyAndToken();
            var             request = new CK1.OutStoreGetPackageRequest()
            {
                MessageID = txtMessageID.Text,
                UserKey   = ukt.getUserKey(),
                Token     = ukt.getToken(),
                Custom    = txtCustom.Text,
                Sign      = txtSign.Text,
                Version   = txtVersion.Text,
            };

            var response = clint.OutStoreGetPackage(request);

            lblAck.Text          = response.Ack.ToString();
            lblInvocationID.Text = response.InvocationID;
            lblMessage.Text      = response.Message;

            if (response.PackageDetail != null)
            {
                lblCustom.Text         = response.PackageDetail.Custom;
                lblPackageList.Text    = response.PackageDetail.ProductList.ToString();
                lblRemark.Text         = response.PackageDetail.Remark;
                lblServices.Text       = response.PackageDetail.Services;
                lblShipping.Text       = response.PackageDetail.Shipping.ToString();
                lblShipToAddress.Text  = response.PackageDetail.ShipToAddress.ToString();
                lblSign.Text           = response.PackageDetail.Sign;
                lblState.Text          = response.PackageDetail.State.ToString();
                lblTrackingNumber.Text = response.PackageDetail.TrackingNumber;
            }

            pnlResponse.Visible = true;
            pnlRequest.Visible  = false;
        }
Esempio n. 26
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var             client = new CK1SoapClient();
            UserKeyAndToken ukt    = new UserKeyAndToken();
            var             req    = new M2CGetShareStockRequest()
            {
                Token     = ukt.getToken(),
                UserKey   = ukt.getUserKey(),
                StorageNo = "EJLW00000006",
                MessageID = DateTime.Now.ToString("yyyyMMddHHmmss") + "M2CGetShareStock Demo",
                Version   = "V2.1",
            };

            var resp = client.M2CGetShareStock(req);

            if (resp.Ack == EnumAck.Success)
            {
                Response.Write("查询共享库存成功" + req.StorageNo + "可用库存" + resp.StockDetail.AvailableAmount);
            }
            else
            {
                Response.Write("查询共享库存失败" + req.StorageNo + resp.Message);
            }
        }
Esempio n. 27
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var             client = new CK1SoapClient();
            UserKeyAndToken ukt    = new UserKeyAndToken();
            var             req    = new M2CGetPackageRequest()
            {
                Token     = ukt.getToken(),
                UserKey   = ukt.getUserKey(),
                Sign      = "ETX120605TST000015",
                MessageID = DateTime.Now.ToString("yyyyMMddHHmmss") + "M2CGetPackage Demo",
                Version   = "V2.1",
            };

            var resp = client.M2CGetPackage(req);

            if (resp.Ack == EnumAck.Success)
            {
                Response.Write("查询包裹成功" + req.Sign);
            }
            else
            {
                Response.Write("查询包裹失败" + req.Sign + resp.Message);
            }
        }
        protected void Button3_Click(object sender, EventArgs e)
        {
            var clint = new CK1SoapClient();
            var EWH   = EnumWarehouse.US;

            #region
            switch (ddlWarehouse.SelectedIndex + 1)
            {
            case 1:
                EWH = EnumWarehouse.US;
                break;

            case 2:
                EWH = EnumWarehouse.AU;
                break;

            case 3:
                EWH = EnumWarehouse.UK;
                break;

            default:
                EWH = EnumWarehouse.MA;
                break;
            }
            UserKeyAndToken ukt = new UserKeyAndToken();

            #endregion

            var request = new OutStoreAddOrderRequest()
            {
                MessageID   = txtMessageID.Text,
                UserKey     = ukt.getUserKey(),
                Token       = ukt.getToken(),
                Submit      = ccbSubmit.Checked,
                Version     = txtVersion.Text,
                OrderDetail = new OutStoreOrder()
                {
                    OrderSign   = txtOrderSign.Text,
                    Remark      = txtRemark.Text,
                    State       = OrderOutState.Initial,
                    PackageList = new List <OutStorePackage>()
                    {
                        new OutStorePackage()
                        {
                            Custom         = txtCustom.Text,
                            Remark         = txtRemark1.Text,
                            Services       = txtServices.Text,
                            Sign           = txtSign.Text,
                            TrackingNumber = txtTrackingNumer.Text,
                            State          = OrderOutState.Initial,
                            ProductList    = new List <OutStoreProduct>()
                            {
                                new OutStoreProduct()
                                {
                                    SKU          = txtSKU.Text,
                                    Quantity     = Convert.ToInt32(txtQuantity.Text),
                                    StorageNo    = txtStorageNo.Text,
                                    DeclareName  = txtDeclareName.Text,
                                    DeclareValue = txtDeclareValue.Text
                                },
                            }
                            .ToArray(),
                            ShipToAddress = new ShipToAddress()
                            {
                                Company  = txtCompany.Text,
                                Contact  = txtContact.Text,
                                Country  = txtCountry.Text,
                                Email    = txtEmail.Text,
                                Phone    = txtPhone.Text,
                                PostCode = txtpostCode.Text,
                                Province = txtProvince.Text,
                                Street1  = txtStreet1.Text,
                                Street2  = txtStreet2.Text,
                                City     = txtCity.Text,
                            },
                            Shipping     = OutStoreShipping.None,
                            ShippingV2_1 = ConvertOutStoreShippingV2_1(ddlShipping.SelectedValue)
                        },
                        new OutStorePackage()
                        {
                            Custom         = txtCustom.Text,
                            Remark         = txtRemark1.Text,
                            Services       = txtServices.Text,
                            Sign           = txtSign.Text,
                            TrackingNumber = txtTrackingNumer.Text,
                            State          = OrderOutState.Initial,
                            ProductList    = new List <OutStoreProduct>()
                            {
                                new OutStoreProduct()
                                {
                                    Quantity     = Convert.ToInt32(txtQuantity.Text),
                                    StorageNo    = StorageNoAdd1.Text,
                                    DeclareName  = txtDeclareName.Text,
                                    DeclareValue = txtDeclareValue.Text
                                },
                            }
                            .ToArray(),
                            ShipToAddress = new ShipToAddress()
                            {
                                Company  = txtCompany.Text,
                                Contact  = txtContact.Text,
                                Country  = txtCountry.Text,
                                Email    = txtEmail.Text,
                                Phone    = txtPhone.Text,
                                PostCode = txtpostCode.Text,
                                Province = txtProvince.Text,
                                Street1  = txtStreet1.Text,
                                Street2  = txtStreet2.Text,
                                City     = txtCity.Text,
                            },
                            Shipping     = OutStoreShipping.None,
                            ShippingV2_1 = ConvertOutStoreShippingV2_1(ddlShipping.SelectedValue)
                        },
                        new OutStorePackage()
                        {
                            Custom         = txtCustom.Text,
                            Remark         = txtRemark1.Text,
                            Services       = txtServices.Text,
                            Sign           = txtSign.Text,
                            TrackingNumber = txtTrackingNumer.Text,
                            State          = OrderOutState.Initial,
                            ProductList    = new List <OutStoreProduct>()
                            {
                                new OutStoreProduct()
                                {
                                    SKU          = txtSKU.Text,
                                    Quantity     = Convert.ToInt32(txtQuantity.Text),
                                    StorageNo    = StorageNoAdd2.Text,
                                    DeclareName  = txtDeclareName.Text,
                                    DeclareValue = txtDeclareValue.Text
                                }
                            }
                            .ToArray(),
                            ShipToAddress = new ShipToAddress()
                            {
                                Company  = txtCompany.Text,
                                Contact  = txtContact.Text,
                                Country  = txtCountry.Text,
                                Email    = txtEmail.Text,
                                Phone    = txtPhone.Text,
                                PostCode = txtpostCode.Text,
                                Province = txtProvince.Text,
                                Street1  = txtStreet1.Text,
                                Street2  = txtStreet2.Text,
                                City     = txtCity.Text,
                            },
                            Shipping     = OutStoreShipping.None,
                            ShippingV2_1 = ConvertOutStoreShippingV2_1(ddlShipping.SelectedValue)
                        }
                    }
                    .ToArray(),
                    Warehouse = EWH, // EnumWarehouse.US,
                },
            };

            OutStoreAddOrderResponse response = clint.OutStoreAddOrder(request);

            lblAck.Text          = response.Ack.ToString();
            lblInvocationID.Text = response.InvocationID;
            lblMessage.Text      = response.Message;
            lblOrderSign.Text    = response.OrderSign;

            pnlResponse.Visible = true;
            pnlRequest.Visible  = false;
        }
Esempio n. 29
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            var clint = new CK1.CK1SoapClient();

            #region 生成包裹

            var productList = new List <CK1.InStoreProduct>();
            productList.Add(new CK1.InStoreProduct()
            {
                DeclaredName  = "Phone",
                DeclaredValue = 100,
                Quantity      = 100,
                SKU           = "iphone 4S",
            });


            var caseList = new List <CK1.InStoreCase>();
            caseList.Add(new CK1.InStoreCase()
            {
                CaseNo = 1,
                //CaseSign = "NetTest123",
                Packing = new CK1.Packing()
                {
                    Height = 10,
                    Length = 10,
                    Width  = 10,
                },
                State       = CK1.OrderInState.Initial,
                Weight      = 200,
                ProductList = productList.ToArray(),
            });

            var orderDetail = new CK1.InStoreOrder()
            {
                ArriveTime = DateTime.Today,
                PickupType = 1,
                //OrderSign = txtOrderSign.Text,
                Remark        = "NetTest123",
                CaseList      = caseList.ToArray(),
                PickUpAddress = new CK1.PickUpAddress()
                {
                    Country  = "United States",
                    Street1  = "1712 Jones Street",
                    Contact  = "Curtis Wilson",
                    Province = "United States",
                    District = "United States",
                    PostCode = "77511",
                    City     = "Alvin",
                },
                State = CK1.OrderInState.Initial,
            };

            switch (0)
            {
            case 0:
                orderDetail.Location = CK1.EnumLocation.GZ;
                break;

            case 1:
                orderDetail.Location = CK1.EnumLocation.SZ;
                break;

            default:
                orderDetail.Location = CK1.EnumLocation.SH;
                break;
            }
            switch (0)
            {
            case 0:
                orderDetail.ShippingMethod = CK1.ShippingType.AIR;
                break;

            case 1:
                orderDetail.ShippingMethod = CK1.ShippingType.SEA;
                break;

            case 2:
                orderDetail.ShippingMethod = CK1.ShippingType.EMS;
                break;

            case 3:
                orderDetail.ShippingMethod = CK1.ShippingType.DHL;
                break;

            default:
                orderDetail.ShippingMethod = CK1.ShippingType.UPS;
                break;
            }
            switch (2)
            {
            case 0:
                orderDetail.Warehouse = CK1.EnumWarehouse.US;
                break;

            case 1:
                orderDetail.Warehouse = CK1.EnumWarehouse.AU;
                break;

            case 2:
                orderDetail.Warehouse = CK1.EnumWarehouse.UK;
                break;

            default:
                orderDetail.Warehouse = CK1.EnumWarehouse.MA;
                break;
            }
            #endregion
            UserKeyAndToken ukt = new UserKeyAndToken();

            var request = new CK1.InStoreAddOrderRequest()
            {
                MessageID   = "Test Add Instore order by .Net",
                UserKey     = ukt.getUserKey(),
                Token       = ukt.getToken(),
                Submit      = false,
                Version     = txtVersion.Text,
                OrderDetail = orderDetail,
            };

            CK1.InStoreAddOrderResponse response = clint.InStoreAddOrder(request);

            lblAck.Text          = response.Ack.ToString();
            lblInvocationID.Text = response.InvocationID;
            lblMessage.Text      = response.Message;
            lblOrderSign.Text    = response.OrderSign;

            pnlResponse.Visible = true;
            pnlRequest.Visible  = false;
        }
Esempio n. 30
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            var clint   = new CK1SoapClient();
            var ukt     = new UserKeyAndToken();
            var request = new OutStoreGetOrderRequest()
            {
                MessageID = txtMessageID.Text,
                UserKey   = ukt.getUserKey(),
                Token     = ukt.getToken(),
                OrderSign = txtOrderSign.Text,
                Version   = txtVersion.Text,
            };

            var response = clint.OutStoreGetOrder(request);

            lblAck.Text          = response.Ack.ToString();
            lblInvocationID.Text = response.InvocationID;
            lblMessage.Text      = response.Message;

            pnlResponse.Visible = true;
            pnlRequest.Visible  = false;

            if (response.Ack != EnumAck.Success)
            {
                Response.End();
            }

            if (response.OrderDetail != null)
            {
                lblOrderSign.Text   = response.OrderDetail.OrderSign;
                lblPackageList.Text = response.OrderDetail.PackageList.ToString();;
                lblRemark.Text      = response.OrderDetail.Remark;
                lblState.Text       = response.OrderDetail.State.ToString();
                lblWarehouse.Text   = response.OrderDetail.Warehouse.ToString();
                if (response.OrderDetail.PackageList != null)
                {
                    int i = 0;
                    foreach (var package in response.OrderDetail.PackageList)
                    {
                        i++;
                        Response.Write(String.Format("包裹{0}信息: <br>", i));
                        Response.Write(String.Format("处理号: {0}<br>", package.Sign));
                        Response.Write(String.Format("State: {0}<br>", package.State.ToString()));
                        Response.Write(String.Format("Custom: {0}<br>", package.Custom));
                        Response.Write(String.Format("TrackingNumber: {0}<br>", package.TrackingNumber));
                        Response.Write(String.Format("Shipping: {0}<br>", package.Shipping.ToString()));
                        Response.Write(String.Format("ShippingV2_1: {0}<br>", package.ShippingV2_1.ToString()));
                        Response.Write(String.Format("Services: {0}<br>", package.Services));
                        Response.Write(String.Format("ShipToAddress: {0}<br>", package.ShipToAddress.ToString()));
                        Response.Write(String.Format("ProductList: {0}<br>", package.ProductList.ToString()));
                        Response.Write(String.Format("Remark: {0}<br>", package.Remark));
                        Response.Write(String.Format("BuyerID: {0}<br>", package.BuyerID));
                        Response.Write(String.Format("ItemID: {0}<br>", package.ItemID));
                        Response.Write(String.Format("BuyerEmail: {0}<br>", package.BuyerEmail));
                    }
                }
            }
            else
            {
                string nullOrderDetail = "No Order Detail Returned!";
                lblOrderSign.Text   = nullOrderDetail;
                lblPackageList.Text = nullOrderDetail;;
                lblRemark.Text      = nullOrderDetail;
                lblState.Text       = nullOrderDetail;
                lblWarehouse.Text   = nullOrderDetail;
            }
        }
Esempio n. 31
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            var clint = new CK1.CK1SoapClient();

            #region 生成包裹

            var productList = new List <CK1.OutStoreProduct>();
            productList.Add(new CK1.OutStoreProduct()
            {
                SKU       = txtSKU.Text,
                Quantity  = Convert.ToInt32(txtQuantity.Text),
                StorageNo = txtStorageNo.Text
            });


            var packageList = new List <CK1.OutStorePackage>();
            packageList.Add(new CK1.OutStorePackage()
            {
                Custom         = txtCustom.Text,
                Remark         = txtRemark1.Text,
                Services       = txtServices.Text,
                Sign           = txtSign.Text,
                TrackingNumber = txtTrackingNumer.Text,
                State          = CK1.OrderOutState.Initial,
                ProductList    = productList.ToArray(),
                ShipToAddress  = new CK1.ShipToAddress()
                {
                    Company  = txtCompany.Text,
                    Contact  = txtContact.Text,
                    Country  = txtCountry.Text,
                    Email    = txtEmail.Text,
                    Phone    = txtPhone.Text,
                    PostCode = txtpostCode.Text,
                    Province = txtProvince.Text,
                    Street1  = txtStreet1.Text,
                    Street2  = txtStreet2.Text,
                    City     = txtCity.Text,
                },
                //Shipping = CK1.OutStoreShipping.DHL,
            });
            switch (ddlShipping.SelectedIndex)
            {
            case 1:
                packageList[0].Shipping = CK1.OutStoreShipping.Royalmail;
                break;

            case 2:
                packageList[0].Shipping = CK1.OutStoreShipping.DHL;
                break;

            case 3:
                packageList[0].Shipping = CK1.OutStoreShipping.UPS;
                break;

            case 4:
                packageList[0].Shipping = CK1.OutStoreShipping.USPS;
                break;

            case 5:
                packageList[0].Shipping = CK1.OutStoreShipping.AuPost;
                break;

            case 6:
                packageList[0].Shipping = CK1.OutStoreShipping.Parcelforce;
                break;

            case 7:
                packageList[0].Shipping = CK1.OutStoreShipping.Fedex;
                break;

            default:
                packageList[0].Shipping = CK1.OutStoreShipping.DPD;
                break;
            }
            #endregion

            UserKeyAndToken ukt     = new UserKeyAndToken();
            var             request = new CK1.OutStoreAddOrderRequest()
            {
                MessageID   = txtMessageID.Text,
                UserKey     = ukt.getUserKey(),
                Token       = ukt.getToken(),
                Submit      = ccbSubmit.Checked,
                Version     = txtVersion.Text,
                OrderDetail = new CK1.OutStoreOrder()
                {
                    OrderSign   = txtOrderSign.Text,
                    Remark      = txtRemark.Text,
                    State       = CK1.OrderOutState.Initial,
                    PackageList = packageList.ToArray(),
                },
            };

            switch (ddlWarehouse.SelectedIndex + 1)
            {
            case 1:
                request.OrderDetail.Warehouse = CK1.EnumWarehouse.US;
                break;

            case 2:
                request.OrderDetail.Warehouse = CK1.EnumWarehouse.AU;
                break;

            case 3:
                request.OrderDetail.Warehouse = CK1.EnumWarehouse.UK;
                break;

            default:
                request.OrderDetail.Warehouse = CK1.EnumWarehouse.MA;
                break;
            }

            CK1.OutStoreAddOrderResponse response = clint.OutStoreAddOrder(request);

            lblAck.Text          = response.Ack.ToString();
            lblInvocationID.Text = response.InvocationID;
            lblMessage.Text      = response.Message;
            lblOrderSign.Text    = response.OrderSign;

            pnlResponse.Visible = true;
            pnlRequest.Visible  = false;
        }
Esempio n. 32
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            CK1.CK1SoapClient clint = new CK1.CK1SoapClient();

            #region 生成专线包裹

            var productList = new List<CK1.ExpressProduct>();
            productList.Add(new CK1.ExpressProduct()
            {
                CustomsTitleCN = "威廉",
                CustomsTitleEN = "Curtis Wilson",
                DeclareValue = 100,
                Quantity = 100,
                SKU = "水龙头",
                StorageNo = "STN110617TST000003",
                Weight = 10,
            });

            var packingList = new CK1.ExpressPackage()
            {
                Custom = "4CJ60689SW925",
                ItemSign = "Test123",
                Packing = new CK1.Packing()
                {
                    Height = 10,
                    Length = 10,
                    Width = 10,
                },
                ProductList = productList.ToArray(),
                Remark = "备注",
                ShipToAddress = new CK1.ShipToAddress()
                {
                    Country = "United States",
                    Street1 = "1712 Jones Street",
                    Contact = "Curtis Wilson",
                    PostCode = "77511",
                    City = "Alvin",
                    Province = "United States",
                    Phone = "adfasdk"
                },
                Status = CK1.OrderExpressState.Initial,
                TrackCode = txtTrackCode.Text,
                Weight = 10,
            };
            #endregion
            UserKeyAndToken ukt = new UserKeyAndToken();
            var request = new CK1.ExpressAddPackageRequest()
            {
                MessageID = txtMessageID.Text,
                UserKey = ukt.getUserKey(),
                Token = ukt.getToken(),
                PackageDetail = packingList,
                PickUpAddress = new CK1.PickUpAddress()
                {
                    Country = "United States",
                    Street1 = "1712 Jones Street",
                    Contact = "Curtis Wilson",
                    Province = "United States",
                    District = "United States",
                    PostCode = "77511",
                    City = "Alvin",
                    Company = "ABC",
                },
                PickupType = ddlPickupType.SelectedIndex,
                Version = txtVersion.Text,
            };

            switch (ddlExpressType.SelectedIndex)
            {
                case 0:
                    request.ExpressType = CK1.ExpressType.HKP;
                    break;
                case 1:
                    request.ExpressType = CK1.ExpressType.CEE;
                    break;
                case 2:
                    request.ExpressType = CK1.ExpressType.CES;
                    break;
                case 3:
                    request.ExpressType = CK1.ExpressType.CNP;
                    break;
                case 4:
                    request.ExpressType = CK1.ExpressType.CTU;
                    break;
                case 5:
                    request.ExpressType = CK1.ExpressType.CUE;
                    break;
                case 6:
                    request.ExpressType = CK1.ExpressType.EMD;
                    break;
                case 7:
                    request.ExpressType = CK1.ExpressType.EMS;
                    break;
                case 8:
                    request.ExpressType = CK1.ExpressType.EUB;
                    break;
                case 9:
                    request.ExpressType = CK1.ExpressType.HKD;
                    break;
                case 10:
                    request.ExpressType = CK1.ExpressType.HKP;
                    break;
                case 11:
                    request.ExpressType = CK1.ExpressType.SGP;
                    break;
                case 12:
                    request.ExpressType = CK1.ExpressType.SHD;
                    break;
                default:
                    request.ExpressType = CK1.ExpressType.UPS;
                    break;
            }

            request.IsTracking = true;
            request.ExpressType = CK1.ExpressType.HKP;
            var response = clint.ExpressAddPackage(request);

            lblAck.Text = response.Ack.ToString();
            lblInvocationID.Text = response.InvocationID;
            lblMessage.Text = response.Message;
            lblCustom.Text = response.Custom;
            lblItemSign.Text = response.ItemSign;
            lblTrackCode.Text = response.TrackCode;
            pnlResponse.Visible = true;
            pnlRequest.Visible = false;
        }
Esempio n. 33
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            #region 生成包裹

            var product = new List <ExpressProduct>();
            product.Add(new ExpressProduct
            {
                CustomsTitleCN = "怀表",
                CustomsTitleEN = "POCKET WATCH",
                Quantity       = 1,
                SKU            = "WP083",
                StorageNo      = "test",
                Weight         = 100,
                DeclareValue   = Convert.ToDecimal(5.67),
            });

            var packageList = new List <ExpressPackage>();
            packageList.Add(new ExpressPackage
            {
                Custom        = "OR201112230076",
                ShipToAddress = new ShipToAddress
                {
                    Contact  = "nicolas courtais",
                    Street1  = "37 rue general ferrié",
                    City     = "grenoble",
                    Province = "Rhône-Alpes",
                    Country  = "France",
                    PostCode = "38100",
                },
                Packing = new Packing
                {
                    Height = 1,
                    Length = 1,
                    Width  = 1,
                },
                Remark      = "备注信息",
                Status      = OrderExpressState.Initial,
                TrackCode   = "",
                Weight      = 500,
                ProductList = product.ToArray(),
            });

            var orderDetail = new ExpressOrder
            {
                IsTracking    = false,
                Location      = "GZ",
                Remark        = "测试订单",
                PackageList   = packageList.ToArray(),
                PickUpAddress = new PickUpAddress
                {
                    Country  = "United States",
                    Street1  = "1712 Jones Street",
                    Contact  = "Curtis Wilson",
                    Province = "United States",
                    District = "United States",
                    PostCode = "77511",
                    City     = "Alvin",
                    Company  = "ABC",
                },
            };

            #endregion

            var             clint   = new CK1SoapClient();
            UserKeyAndToken ukt     = new UserKeyAndToken();
            var             request = new ExpressAddOrderNewRequest
            {
                UserKey        = ukt.getUserKey(),
                Token          = ukt.getToken(),
                Submit         = false,
                OrderDetail    = orderDetail,
                ExpressTypeNew = "HTM",
                MessageID      = "SampleCallId"
            };

            ExpressAddOrderResponse response = clint.ExpressAddOrderNew(request);

            lblAck.Text          = response.Ack.ToString();
            lblInvocationID.Text = response.InvocationID;
            lblMessage.Text      = response.Message;
            lblOrderSign.Text    = response.OrderSign;

            pnlResponse.Visible = true;
            pnlRequest.Visible  = false;
        }
Esempio n. 34
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            CK1.CK1SoapClient clint = new CK1.CK1SoapClient();

            #region 生成专线包裹

            var productList = new List <CK1.ExpressProduct>();
            productList.Add(new CK1.ExpressProduct()
            {
                CustomsTitleCN = "威廉",
                CustomsTitleEN = "Curtis Wilson",
                DeclareValue   = 100,
                Quantity       = 100,
                SKU            = "水龙头",
                StorageNo      = "STN110617TST000003",
                Weight         = 10,
            });

            var packingList = new CK1.ExpressPackage()
            {
                Custom   = "4CJ60689SW925",
                ItemSign = "Test123",
                Packing  = new CK1.Packing()
                {
                    Height = 10,
                    Length = 10,
                    Width  = 10,
                },
                ProductList   = productList.ToArray(),
                Remark        = "备注",
                ShipToAddress = new CK1.ShipToAddress()
                {
                    Country  = "United States",
                    Street1  = "1712 Jones Street",
                    Contact  = "Curtis Wilson",
                    PostCode = "77511",
                    City     = "Alvin",
                    Province = "United States",
                    Phone    = "adfasdk"
                },
                Status    = CK1.OrderExpressState.Initial,
                TrackCode = txtTrackCode.Text,
                Weight    = 10,
            };
            #endregion
            UserKeyAndToken ukt     = new UserKeyAndToken();
            var             request = new CK1.ExpressAddPackageRequest()
            {
                MessageID     = txtMessageID.Text,
                UserKey       = ukt.getUserKey(),
                Token         = ukt.getToken(),
                PackageDetail = packingList,
                PickUpAddress = new CK1.PickUpAddress()
                {
                    Country  = "United States",
                    Street1  = "1712 Jones Street",
                    Contact  = "Curtis Wilson",
                    Province = "United States",
                    District = "United States",
                    PostCode = "77511",
                    City     = "Alvin",
                    Company  = "ABC",
                },
                PickupType = ddlPickupType.SelectedIndex,
                Version    = txtVersion.Text,
            };

            switch (ddlExpressType.SelectedIndex)
            {
            case 0:
                request.ExpressType = CK1.ExpressType.HKP;
                break;

            case 1:
                request.ExpressType = CK1.ExpressType.CEE;
                break;

            case 2:
                request.ExpressType = CK1.ExpressType.CES;
                break;

            case 3:
                request.ExpressType = CK1.ExpressType.CNP;
                break;

            case 4:
                request.ExpressType = CK1.ExpressType.CTU;
                break;

            case 5:
                request.ExpressType = CK1.ExpressType.CUE;
                break;

            case 6:
                request.ExpressType = CK1.ExpressType.EMD;
                break;

            case 7:
                request.ExpressType = CK1.ExpressType.EMS;
                break;

            case 8:
                request.ExpressType = CK1.ExpressType.EUB;
                break;

            case 9:
                request.ExpressType = CK1.ExpressType.HKD;
                break;

            case 10:
                request.ExpressType = CK1.ExpressType.HKP;
                break;

            case 11:
                request.ExpressType = CK1.ExpressType.SGP;
                break;

            case 12:
                request.ExpressType = CK1.ExpressType.SHD;
                break;

            default:
                request.ExpressType = CK1.ExpressType.UPS;
                break;
            }

            request.IsTracking  = true;
            request.ExpressType = CK1.ExpressType.HKP;
            var response = clint.ExpressAddPackage(request);

            lblAck.Text          = response.Ack.ToString();
            lblInvocationID.Text = response.InvocationID;
            lblMessage.Text      = response.Message;
            lblCustom.Text       = response.Custom;
            lblItemSign.Text     = response.ItemSign;
            lblTrackCode.Text    = response.TrackCode;
            pnlResponse.Visible  = true;
            pnlRequest.Visible   = false;
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            var clint = new CK1SoapClient();

            #region 生成包裹

            var productList = new List<OutStoreProduct>();
            productList.Add(new OutStoreProduct()
            {
                SKU = txtSKU.Text,
                Quantity = Convert.ToInt32(txtQuantity.Text),
                StorageNo = txtStorageNo.Text,
                DeclareName = txtDeclareName.Text,
                DeclareValue = txtDeclareValue.Text
            });

            var packageList = new List<OutStorePackage>();
            packageList.Add(new OutStorePackage()
            {
                Custom = txtCustom.Text,
                Remark = txtRemark1.Text,
                Services = txtServices.Text,
                Sign = txtSign.Text,
                TrackingNumber = txtTrackingNumer.Text,
                State = OrderOutState.Initial,
                ProductList = productList.ToArray(),
                ShipToAddress = new ShipToAddress()
                {
                    Company = txtCompany.Text,
                    Contact = txtContact.Text,
                    Country = txtCountry.Text,
                    Email = txtEmail.Text,
                    Phone = txtPhone.Text,
                    PostCode = txtpostCode.Text,
                    Province = txtProvince.Text,
                    Street1 = txtStreet1.Text,
                    Street2 = txtStreet2.Text,
                    City = txtCity.Text,
                },
                Shipping = OutStoreShipping.None,
                ShippingV2_1 = ConvertOutStoreShippingV2_1(ddlShipping.SelectedValue)
            });
            /*
            switch (ddlShipping.SelectedIndex)
            {
                case 1:
                    packageList[0].Shipping = OutStoreShipping.Royalmail;
                    break;
                case 2:
                    packageList[0].Shipping = OutStoreShipping.DHL;
                    break;
                case 3:
                    packageList[0].Shipping = OutStoreShipping.UPS;
                    break;
                case 4:
                    packageList[0].Shipping = OutStoreShipping.USPS;
                    break;
                case 5:
                    packageList[0].Shipping = OutStoreShipping.AuPost;
                    break;
                case 6:
                    packageList[0].Shipping = OutStoreShipping.Parcelforce;
                    break;
                case 7:
                    packageList[0].Shipping = OutStoreShipping.Fedex;
                    break;
                default:
                    packageList[0].Shipping = OutStoreShipping.DPD;
                    break;
            }*/

            #endregion 生成包裹

            UserKeyAndToken ukt = new UserKeyAndToken();
            var request = new OutStoreAddOrderRequest()
            {
                MessageID = txtMessageID.Text,
                UserKey = ukt.getUserKey(),
                Token = ukt.getToken(),
                Submit = ccbSubmit.Checked,
                Version = txtVersion.Text,
                OrderDetail = new OutStoreOrder()
                {
                    OrderSign = txtOrderSign.Text,
                    Remark = txtRemark.Text,
                    State = OrderOutState.Initial,
                    PackageList = packageList.ToArray(),
                    Warehouse = EnumWarehouse.US,
                },
            };

            //request.OrderDetail.Warehouse = EnumWarehouse.US;
            /*
            switch (ddlWarehouse.SelectedIndex)
            {
                case 1:
                    request.OrderDetail.Warehouse = EnumWarehouse.US;
                    break;
                case 2:
                    request.OrderDetail.Warehouse = EnumWarehouse.AU;
                    break;
                case 3:
                    request.OrderDetail.Warehouse = EnumWarehouse.UK;
                    break;
                default:
                    request.OrderDetail.Warehouse = EnumWarehouse.MA;
                    break;
            }*/

            OutStoreAddOrderResponse response = clint.OutStoreAddOrder(request);

            lblAck.Text = response.Ack.ToString();
            lblInvocationID.Text = response.InvocationID;
            lblMessage.Text = response.Message;
            lblOrderSign.Text = response.OrderSign;

            pnlResponse.Visible = true;
            pnlRequest.Visible = false;
        }
        protected void Button3_Click(object sender, EventArgs e)
        {
            var clint = new CK1SoapClient();
            var EWH = EnumWarehouse.US;
            #region
            switch (ddlWarehouse.SelectedIndex + 1)
            {
                case 1:
                    EWH = EnumWarehouse.US;
                    break;
                case 2:
                    EWH = EnumWarehouse.AU;
                    break;
                case 3:
                    EWH = EnumWarehouse.UK;
                    break;
                default:
                    EWH = EnumWarehouse.MA;
                    break;
            }
            UserKeyAndToken ukt = new UserKeyAndToken();

            #endregion

            var request = new OutStoreAddOrderRequest()
            {
                MessageID = txtMessageID.Text,
                UserKey = ukt.getUserKey(),
                Token = ukt.getToken(),
                Submit = ccbSubmit.Checked,
                Version = txtVersion.Text,
                OrderDetail = new OutStoreOrder()
                {
                    OrderSign = txtOrderSign.Text,
                    Remark = txtRemark.Text,
                    State = OrderOutState.Initial,
                    PackageList = new List<OutStorePackage>() {
                        new OutStorePackage()
                        {
                            Custom = txtCustom.Text,
                            Remark = txtRemark1.Text,
                            Services = txtServices.Text,
                            Sign = txtSign.Text,
                            TrackingNumber = txtTrackingNumer.Text,
                            State = OrderOutState.Initial,
                            ProductList = new List<OutStoreProduct>(){
                                new OutStoreProduct()
                                {
                                    SKU = txtSKU.Text,
                                    Quantity = Convert.ToInt32(txtQuantity.Text),
                                    StorageNo = txtStorageNo.Text,
                                    DeclareName = txtDeclareName.Text,
                                    DeclareValue = txtDeclareValue.Text
                                },

                            }
                            .ToArray(),
                            ShipToAddress = new ShipToAddress()
                            {
                                Company = txtCompany.Text,
                                Contact = txtContact.Text,
                                Country = txtCountry.Text,
                                Email = txtEmail.Text,
                                Phone = txtPhone.Text,
                                PostCode = txtpostCode.Text,
                                Province = txtProvince.Text,
                                Street1 = txtStreet1.Text,
                                Street2 = txtStreet2.Text,
                                City = txtCity.Text,
                            },
                            Shipping = OutStoreShipping.None,
                            ShippingV2_1 = ConvertOutStoreShippingV2_1(ddlShipping.SelectedValue)
                        },
                        new OutStorePackage()
                        {
                            Custom = txtCustom.Text,
                            Remark = txtRemark1.Text,
                            Services = txtServices.Text,
                            Sign = txtSign.Text,
                            TrackingNumber = txtTrackingNumer.Text,
                            State = OrderOutState.Initial,
                            ProductList = new List<OutStoreProduct>(){
                                new OutStoreProduct()
                                {
                                    Quantity = Convert.ToInt32(txtQuantity.Text),
                                    StorageNo = StorageNoAdd1.Text,
                                    DeclareName = txtDeclareName.Text,
                                    DeclareValue = txtDeclareValue.Text
                                },
                            }
                            .ToArray(),
                            ShipToAddress = new ShipToAddress()
                            {
                                Company = txtCompany.Text,
                                Contact = txtContact.Text,
                                Country = txtCountry.Text,
                                Email = txtEmail.Text,
                                Phone = txtPhone.Text,
                                PostCode = txtpostCode.Text,
                                Province = txtProvince.Text,
                                Street1 = txtStreet1.Text,
                                Street2 = txtStreet2.Text,
                                City = txtCity.Text,
                            },
                            Shipping = OutStoreShipping.None,
                            ShippingV2_1 = ConvertOutStoreShippingV2_1(ddlShipping.SelectedValue)
                        },
                        new OutStorePackage()
                        {
                            Custom = txtCustom.Text,
                            Remark = txtRemark1.Text,
                            Services = txtServices.Text,
                            Sign = txtSign.Text,
                            TrackingNumber = txtTrackingNumer.Text,
                            State = OrderOutState.Initial,
                            ProductList = new List<OutStoreProduct>(){
                                new OutStoreProduct()
                                {
                                    SKU = txtSKU.Text,
                                    Quantity = Convert.ToInt32(txtQuantity.Text),
                                    StorageNo = StorageNoAdd2.Text,
                                    DeclareName = txtDeclareName.Text,
                                    DeclareValue = txtDeclareValue.Text
                                }

                            }
                            .ToArray(),
                            ShipToAddress = new ShipToAddress()
                            {
                                Company = txtCompany.Text,
                                Contact = txtContact.Text,
                                Country = txtCountry.Text,
                                Email = txtEmail.Text,
                                Phone = txtPhone.Text,
                                PostCode = txtpostCode.Text,
                                Province = txtProvince.Text,
                                Street1 = txtStreet1.Text,
                                Street2 = txtStreet2.Text,
                                City = txtCity.Text,
                            },
                            Shipping = OutStoreShipping.None,
                            ShippingV2_1 = ConvertOutStoreShippingV2_1(ddlShipping.SelectedValue)
                        }
                    }
                    .ToArray(),
                    Warehouse = EWH, // EnumWarehouse.US,
                },
            };

            OutStoreAddOrderResponse response = clint.OutStoreAddOrder(request);

            lblAck.Text = response.Ack.ToString();
            lblInvocationID.Text = response.InvocationID;
            lblMessage.Text = response.Message;
            lblOrderSign.Text = response.OrderSign;

            pnlResponse.Visible = true;
            pnlRequest.Visible = false;
        }
Esempio n. 37
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            var clint = new CK1SoapClient();
            var ukt = new UserKeyAndToken();
            var request = new OutStoreGetOrderRequest()
            {
                MessageID = txtMessageID.Text,
                UserKey = ukt.getUserKey(),
                Token = ukt.getToken(),
                OrderSign = txtOrderSign.Text,
                Version = txtVersion.Text,
            };

            var response = clint.OutStoreGetOrder(request);

            lblAck.Text = response.Ack.ToString();
            lblInvocationID.Text = response.InvocationID;
            lblMessage.Text = response.Message;

            pnlResponse.Visible = true;
            pnlRequest.Visible = false;

            if (response.Ack != EnumAck.Success)
            {
                Response.End();
            }

            if (response.OrderDetail != null)
            {
                lblOrderSign.Text = response.OrderDetail.OrderSign;
                lblPackageList.Text = response.OrderDetail.PackageList.ToString(); ;
                lblRemark.Text = response.OrderDetail.Remark;
                lblState.Text = response.OrderDetail.State.ToString();
                lblWarehouse.Text = response.OrderDetail.Warehouse.ToString();
                if (response.OrderDetail.PackageList != null)
                {
                    int i = 0;
                    foreach (var package in response.OrderDetail.PackageList)
                    {
                        i++;
                        Response.Write(String.Format("包裹{0}信息: <br>", i));
                        Response.Write(String.Format("处理号: {0}<br>", package.Sign));
                        Response.Write(String.Format("State: {0}<br>", package.State.ToString()));
                        Response.Write(String.Format("Custom: {0}<br>", package.Custom));
                        Response.Write(String.Format("TrackingNumber: {0}<br>", package.TrackingNumber));
                        Response.Write(String.Format("Shipping: {0}<br>", package.Shipping.ToString()));
                        Response.Write(String.Format("ShippingV2_1: {0}<br>", package.ShippingV2_1.ToString()));
                        Response.Write(String.Format("Services: {0}<br>", package.Services));
                        Response.Write(String.Format("ShipToAddress: {0}<br>", package.ShipToAddress.ToString()));
                        Response.Write(String.Format("ProductList: {0}<br>", package.ProductList.ToString()));
                        Response.Write(String.Format("Remark: {0}<br>", package.Remark));
                        Response.Write(String.Format("BuyerID: {0}<br>", package.BuyerID));
                        Response.Write(String.Format("ItemID: {0}<br>", package.ItemID));
                        Response.Write(String.Format("BuyerEmail: {0}<br>", package.BuyerEmail));
                    }
                }
            }
            else
            {
                string nullOrderDetail = "No Order Detail Returned!";
                lblOrderSign.Text = nullOrderDetail;
                lblPackageList.Text = nullOrderDetail; ;
                lblRemark.Text = nullOrderDetail;
                lblState.Text = nullOrderDetail;
                lblWarehouse.Text = nullOrderDetail;
            }
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            var client = new CK1.CK1SoapClient();

            #region 生成包裹

            var productList = new List<CK1.OutStoreProduct>();
            productList.Add(new CK1.OutStoreProduct()
            {
                SKU = txtSKU.Text,
                Quantity = Convert.ToInt32(txtQuantity.Text),
                StorageNo = txtStorageNo.Text
            });

            var packageList = new List<CK1.OutStorePackageNew>();
            packageList.Add(new CK1.OutStorePackageNew()
            {
                Custom = txtCustom.Text,
                Remark = txtRemark1.Text,
                Services = string.Empty,
                Sign = txtSign.Text,
                TrackingNumber = txtTrackingNumer.Text,
                State = CK1.OrderOutState.Initial,
                ProductList = productList.ToArray(),
                ShipToAddress = new CK1.ShipToAddress()
                {
                    Company = txtCompany.Text,
                    Contact = txtContact.Text,
                    Country = txtCountry.Text,
                    Email = txtEmail.Text,
                    Phone = txtPhone.Text,
                    PostCode = txtpostCode.Text,
                    Province = txtProvince.Text,
                    Street1 = txtStreet1.Text,
                    Street2 = txtStreet2.Text,
                    City = txtCity.Text,
                },
                Shipping = OutStoreShipping.None, //这个参数使用默认值
                ShippingV2_1 = OutStoreShippingV2_1.None, //这个参数使用默认值
                ShippingNew = Request["ServiceCode"] //字符类型的服务代码
            });
            #endregion

            UserKeyAndToken ukt = new UserKeyAndToken();
            var request = new CK1.OutStoreAddOrderNewRequest()
            {
                MessageID = txtMessageID.Text,
                UserKey = ukt.getUserKey(),
                Token = ukt.getToken(),
                Submit = ccbSubmit.Checked,
                Version = txtVersion.Text,
                OrderDetailNew = new CK1.OutStoreOrderNew()
                {
                    OrderSign = txtOrderSign.Text,
                    Remark = txtRemark.Text,
                    State = CK1.OrderOutState.Initial,
                    PackageListNew = packageList.ToArray(),
                },
            };

            request.OrderDetailNew.Warehouse = EnumWarehouse.None; //这个参数使用默认值

            request.OrderDetailNew.WarehouseNew = ddlWarehouse.SelectedValue;   //字符类型的仓库代码

            CK1.OutStoreAddOrderResponse response = client.OutStoreAddOrderNew(request);

            lblAck.Text = response.Ack.ToString();
            lblInvocationID.Text = response.InvocationID;
            lblMessage.Text = response.Message;
            lblOrderSign.Text = response.OrderSign;

            pnlResponse.Visible = true;
            pnlRequest.Visible = false;
        }
Esempio n. 39
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            var clint = new CK1.CK1SoapClient();

            #region 生成包裹

            var productList = new List<CK1.InStoreProduct>();
            productList.Add(new CK1.InStoreProduct()
            {
                DeclaredName = "Phone",
                DeclaredValue = 100,
                Quantity = 100,
                SKU = "iphone 4S",
            });

            var caseList = new List<CK1.InStoreCase>();
            caseList.Add(new CK1.InStoreCase()
            {
                CaseNo = 1,
                //CaseSign = "NetTest123",
                Packing = new CK1.Packing()
                {
                    Height = 10,
                    Length = 10,
                    Width = 10,
                },
                State = CK1.OrderInState.Initial,
                Weight = 200,
                ProductList = productList.ToArray(),
            });

            var orderDetail = new CK1.InStoreOrder()
            {
                ArriveTime = DateTime.Today,
                PickupType = 1,
                //OrderSign = txtOrderSign.Text,
                Remark = "NetTest123",
                CaseList = caseList.ToArray(),
                PickUpAddress = new CK1.PickUpAddress()
                {
                    Country = "United States",
                    Street1 = "1712 Jones Street",
                    Contact = "Curtis Wilson",
                    Province= "United States",
                    District = "United States",
                    PostCode = "77511",
                    City = "Alvin",
                },
                State=CK1.OrderInState.Initial,
            };

            switch (0)
            {
                case 0:
                    orderDetail.Location = CK1.EnumLocation.GZ;
                    break;
                case 1:
                    orderDetail.Location = CK1.EnumLocation.SZ;
                    break;
                default:
                    orderDetail.Location = CK1.EnumLocation.SH;
                    break;
            }
            switch (0)
            {
                case 0:
                    orderDetail.ShippingMethod = CK1.ShippingType.AIR;
                    break;
                case 1:
                    orderDetail.ShippingMethod = CK1.ShippingType.SEA;
                    break;
                case 2:
                    orderDetail.ShippingMethod = CK1.ShippingType.EMS;
                    break;
                case 3:
                    orderDetail.ShippingMethod = CK1.ShippingType.DHL;
                    break;
                default:
                    orderDetail.ShippingMethod = CK1.ShippingType.UPS;
                    break;
            }
            switch (2)
            {
                case 0:
                    orderDetail.Warehouse = CK1.EnumWarehouse.US;
                    break;
                case 1:
                    orderDetail.Warehouse = CK1.EnumWarehouse.AU;
                    break;
                case 2:
                    orderDetail.Warehouse = CK1.EnumWarehouse.UK;
                    break;
                default:
                    orderDetail.Warehouse = CK1.EnumWarehouse.MA;
                    break;
            }
            #endregion
            UserKeyAndToken ukt = new UserKeyAndToken();

            var request = new CK1.InStoreAddOrderRequest()
            {
                MessageID = "Test Add Instore order by .Net",
                UserKey = ukt.getUserKey(),
                Token = ukt.getToken(),
                Submit = false,
                Version = txtVersion.Text,
                OrderDetail = orderDetail,
            };

            CK1.InStoreAddOrderResponse response = clint.InStoreAddOrder(request);

            lblAck.Text = response.Ack.ToString();
            lblInvocationID.Text = response.InvocationID;
            lblMessage.Text = response.Message;
            lblOrderSign.Text = response.OrderSign;

            pnlResponse.Visible = true;
            pnlRequest.Visible = false;
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            var client = new CK1.CK1SoapClient();

            #region 生成包裹

            var productList = new List <CK1.OutStoreProduct>();
            productList.Add(new CK1.OutStoreProduct()
            {
                SKU       = txtSKU.Text,
                Quantity  = Convert.ToInt32(txtQuantity.Text),
                StorageNo = txtStorageNo.Text
            });


            var packageList = new List <CK1.OutStorePackageNew>();
            packageList.Add(new CK1.OutStorePackageNew()
            {
                Custom         = txtCustom.Text,
                Remark         = txtRemark1.Text,
                Services       = string.Empty,
                Sign           = txtSign.Text,
                TrackingNumber = txtTrackingNumer.Text,
                State          = CK1.OrderOutState.Initial,
                ProductList    = productList.ToArray(),
                ShipToAddress  = new CK1.ShipToAddress()
                {
                    Company  = txtCompany.Text,
                    Contact  = txtContact.Text,
                    Country  = txtCountry.Text,
                    Email    = txtEmail.Text,
                    Phone    = txtPhone.Text,
                    PostCode = txtpostCode.Text,
                    Province = txtProvince.Text,
                    Street1  = txtStreet1.Text,
                    Street2  = txtStreet2.Text,
                    City     = txtCity.Text,
                },
                Shipping     = OutStoreShipping.None,     //这个参数使用默认值
                ShippingV2_1 = OutStoreShippingV2_1.None, //这个参数使用默认值
                ShippingNew  = Request["ServiceCode"]     //字符类型的服务代码
            });
            #endregion

            UserKeyAndToken ukt     = new UserKeyAndToken();
            var             request = new CK1.OutStoreAddOrderNewRequest()
            {
                MessageID      = txtMessageID.Text,
                UserKey        = ukt.getUserKey(),
                Token          = ukt.getToken(),
                Submit         = ccbSubmit.Checked,
                Version        = txtVersion.Text,
                OrderDetailNew = new CK1.OutStoreOrderNew()
                {
                    OrderSign      = txtOrderSign.Text,
                    Remark         = txtRemark.Text,
                    State          = CK1.OrderOutState.Initial,
                    PackageListNew = packageList.ToArray(),
                },
            };

            request.OrderDetailNew.Warehouse = EnumWarehouse.None;            //这个参数使用默认值

            request.OrderDetailNew.WarehouseNew = ddlWarehouse.SelectedValue; //字符类型的仓库代码

            CK1.OutStoreAddOrderResponse response = client.OutStoreAddOrderNew(request);

            lblAck.Text          = response.Ack.ToString();
            lblInvocationID.Text = response.InvocationID;
            lblMessage.Text      = response.Message;
            lblOrderSign.Text    = response.OrderSign;

            pnlResponse.Visible = true;
            pnlRequest.Visible  = false;
        }
Esempio n. 41
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            #region 生成包裹

            var product = new List<ExpressProduct>();
            product.Add(new ExpressProduct
            {
                CustomsTitleCN = "怀表",
                CustomsTitleEN = "POCKET WATCH",
                Quantity = 1,
                SKU = "WP083",
                StorageNo = "test",
                Weight = 100,
                DeclareValue = Convert.ToDecimal(5.67),
            });

            var packageList = new List<ExpressPackage>();
            packageList.Add(new ExpressPackage
            {
                Custom = "OR201112230076",
                ShipToAddress = new ShipToAddress
                {
                    Contact= "nicolas courtais",
                    Street1= "37 rue general ferrié",
                    City= "grenoble",
                    Province= "Rhône-Alpes",
                    Country = "France",
                    PostCode = "38100",
                },
                Packing = new Packing
                {
                    Height = 1,
                    Length = 1,
                    Width = 1,
                },
                Remark = "备注信息",
                Status = OrderExpressState.Initial,
                TrackCode = "",
                Weight = 500,
                ProductList = product.ToArray(),
            });

            var orderDetail = new ExpressOrder
            {
                IsTracking = false,
                Location = "GZ",
                Remark = "测试订单",
                PackageList = packageList.ToArray(),
                PickUpAddress = new PickUpAddress
                {
                    Country = "United States",
                    Street1 = "1712 Jones Street",
                    Contact = "Curtis Wilson",
                    Province = "United States",
                    District = "United States",
                    PostCode = "77511",
                    City = "Alvin",
                    Company = "ABC",
                },

            };

            #endregion

            var clint = new CK1SoapClient();
            UserKeyAndToken ukt = new UserKeyAndToken();
            var request = new ExpressAddOrderNewRequest
            {
                UserKey = ukt.getUserKey(),
                Token = ukt.getToken(),
                Submit = false,
                OrderDetail = orderDetail,
                ExpressTypeNew = "HTM",
                MessageID = "SampleCallId"
            };

            ExpressAddOrderResponse response = clint.ExpressAddOrderNew(request);

            lblAck.Text = response.Ack.ToString();
            lblInvocationID.Text = response.InvocationID;
            lblMessage.Text = response.Message;
            lblOrderSign.Text = response.OrderSign;

            pnlResponse.Visible = true;
            pnlRequest.Visible = false;
        }