Example #1
0
        void odc_OnAddPacket(object sender, PacketInfo p)
        {
            try
            {
                string orderDetailsHtml = GetOrderDetailsHtml(p.OrderId);
                if (orderDetailsHtml.ToLower().Contains("退款信息"))
                {
                    MessageBox.Show(this, "此订单已申请退款. 终止发货!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }

                if (!orderDetailsHtml.Contains("买家已付款,等待卖家发货"))
                {
                    DialogResult dr = MessageBox.Show(this, "此订单不是<买家已付款, 等待卖家发货>状态, 是否继续发货操作?", this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation);
                    if (DialogResult.No == dr)
                    {
                        return;
                    }
                }

                string       warning;
                List <Order> buyerOrders;
                if (IsMultipleOrders(Order.GetOrderByOrderId(p.OrderId, _orders).BuyerAccount, _orders, out buyerOrders, out warning))
                {
                    OrdersForm of = new OrdersForm(buyerOrders);
                    of.Prompt = string.Format("注意! 此账号有多个订单. {0}. 是否继续出单?", warning);
                    DialogResult dr = of.ShowDialog(this);
                    if (DialogResult.Cancel == dr)
                    {
                        return;
                    }
                }

                //if (IsMultipleOrders(Order.GetOrderByOrderId(p.OrderId, _orders).BuyerAccount, _orders, out warning))
                //{
                //    DialogResult dr = MessageBox.Show(
                //        this,
                //        string.Format("注意!!! 此账号有多个订单:\n{0}\n\n是否继续出单?", warning), this.Text,
                //        MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation);
                //    if (DialogResult.No == dr)
                //        return;
                //}

                if (null == _packets)
                {
                    _packets = new List <PacketInfo>();
                }

                _packets.Add(p);
                tsbtnGeneratePackets.Enabled = (_packets.Count > 0);
                tsslblInfo.Text = string.Format("{0} packets added.", _packets.Count);
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.ToString(), this.Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Example #2
0
        void odc_OnConsignSh(object sender, EventArgs e)
        {
            OrderDetailsControl odc = sender as OrderDetailsControl;

            string orderDetailsHtml = GetOrderDetailsHtml(odc.Order.OrderId);

            if (orderDetailsHtml.ToLower().Contains("退款信息"))
            {
                MessageBox.Show(this, "此订单已申请退款. 终止发货!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            if (!orderDetailsHtml.Contains("买家已付款,等待卖家发货"))
            {
                DialogResult dr = MessageBox.Show(this, "此订单不是<买家已付款, 等待卖家发货>状态, 是否继续发货操作?", this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation);
                if (DialogResult.No == dr)
                {
                    return;
                }
            }

            string       warning;
            List <Order> buyerOrders;

            if (IsMultipleOrders(odc.Order.BuyerAccount, _orders, out buyerOrders, out warning))
            {
                OrdersForm of = new OrdersForm(buyerOrders);
                of.Prompt = string.Format("注意! 此账号有多个订单. {0}. 是否继续发货", warning);
                DialogResult dr = of.ShowDialog(this);
                if (DialogResult.Cancel == dr)
                {
                    return;
                }
            }

            // Have not get full edited address yet
            if (!string.IsNullOrEmpty(odc.Order.EditedRecipientAddress.Trim()))
            {
                MessageBox.Show(
                    this.FindForm(),
                    "收货地址发生修改.\n导出数据无法获得完整修改后的地址, 需要访问订单详情页面获得完整地址.",
                    this.Text,
                    MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                odc.RefreshFullEditedAddress();
            }

            ConsignShForm csf = new ConsignShForm(odc.Order);

            csf.ShowDialog(this);
        }