//在线打印
        private Boolean OnlineLogic()
        {
            var    product_order_no = numTextBox.Text.Trim();
            string jpExpSecId       = null;
            string expressCompany   = null;
            string store            = null;
            //获取订单详情
            var orderInfo = WhApi.PostOrderInfos(product_order_no);
            var pacIndex  = 0;

            //不能打印出库状态的订单
            if (orderInfo.delivery_state.Equals("24"))
            {
                MessageBox.Show("打印出库失败。(订单状态错误)");
                InitControl();
                return(false);
            }
            if (orderInfo.IsNull())
            {
                InitControl();
            }
            else if (orderInfo.products.IsNull() || orderInfo.products.Count == 0)
            {
                MessageBox.Show("没查询到订单的商品信息。");
            }
            else
            {
                //判断是否有日本号,如果有直接打印,如果没有先分配日本号再打印
                if (orderInfo.jp_express_no.IsNullOrEmpty())
                {
                    //判断是否有默认快递公司
                    if (orderInfo.jp_express_section_id.IsNullOrEmpty() || orderInfo.products.Count > 1)
                    {
                        if (jpExpSecId.IsNullOrEmpty() && expressDataGrid.SelectedRows.Count == 0)
                        {
                            MessageBox.Show("请选择快递公司再进行操作。");
                            return(false);
                        }
                        else
                        {
                            if (expressDataGrid.SelectedRows.Count != 0)
                            {
                                jpExpSecId     = expressDataGrid.SelectedRows[0].Cells[0].Value.ToString();
                                store          = expressDataGrid.SelectedRows[0].Cells[3].Value.ToString();
                                expressCompany = expressDataGrid.SelectedRows[0].Cells[1].Value.ToString();
                            }
                            if (WhApi.DistributionJpNo(product_order_no, jpExpSecId))
                            {
                                orderInfo = WhApi.PostOrderInfos(product_order_no);
                            }
                        }
                    }
                    else
                    {
                        if (WhApi.DistributionJpNo(product_order_no, orderInfo.jp_express_section_id))
                        {
                            orderInfo      = WhApi.PostOrderInfos(product_order_no);
                            expressCompany = orderInfo.jp_express_company;
                            store          = orderInfo.city_code;
                        }
                    }
                }
                else
                {
                    store          = orderInfo.city_code;
                    expressCompany = orderInfo.jp_express_company;
                }
                for (int c = 0; c < orderInfo.products.Count; c++)
                {
                    if (orderInfo.products[c].check_flag.Equals("N"))
                    {
                        MessageBox.Show("商品[" + orderInfo.products[c].product_code + "],未审查派送公司。操作失败!");
                        return(false);
                    }
                }
                //添加额外信息
                AddExtraInfo(orderInfo, store);
                switch (expressCompany)
                {
                case "SAGAWA":
                    PrintLabel.OWHSagawaLablePrint(orderInfo, pacIndex);
                    break;

                case "JP_EMS":
                    PrintLabel.JapanEmsPrint(orderInfo, pacIndex);
                    break;

                case "JP_EMS_SMALL":
                    PrintLabel.JapanEmsSmallPrint(orderInfo, pacIndex);
                    break;

                case "SAGAWA_HIKIYAKU":
                    PrintLabel.SagawaHikiyakuPrint(orderInfo, pacIndex);
                    break;

                case "YAMATO":
                    PrintLabel.YamatoLablePrint(orderInfo, pacIndex);
                    break;
                }
            }
            return(true);
        }