예제 #1
0
        private void bt_Print_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(cmb_OrdPrinter.Text))
            {
                MessageBox.Show(this, @"请选择打印机!", @"注意", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            if (WMSService.WMSOrderNos != null && WMSService.WMSOrderNos.Values.Count > 0)
            {
                MessageBox.Show(this, @"打印正在进行,请等待打印完成之后再进行此操作!", @"注意", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            var downGoodsBillNo    = string.Empty;
            var downGoodsBillState = string.Empty;

            foreach (var row in dgv_Order.Rows.Cast <DataGridViewRow>().Where(row => null != row.Cells[0].Value && ((bool)row.Cells[0].Value)))
            {
                downGoodsBillNo    = row.Cells[2].Value.ToString();
                downGoodsBillState = row.Cells[5].Value.ToString();
                break;
            }
            if (string.IsNullOrWhiteSpace(downGoodsBillNo))
            {
                MessageBox.Show(this, @"请选择要打印的下货单!", @"注意", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            var result = WMSService.CurrentWMSService.GetPrintOrderBill(new Guid(ConfigManager.ConfigInfo.WarehouseId),
                                                                        new Guid(ConfigManager.ConfigInfo.InvoiceFilialeId), downGoodsBillNo);

            if (result.IsSuccess)
            {
                var printType = downGoodsBillState == "待下货" ? PrintType.Manual : PrintType.Again;
                try
                {
                    PrinterManager.PrintOrder(ConfigManager.ConfigInfo.PrintOrderModel, result.Data,
                                              cmb_OrdPrinter.Text, printType, YesOrNo.No, PrintAbout.Order);
                }
                catch (Exception ex)
                {
                    WMSService.NoPrintedResetReaderId(new List <string> {
                        downGoodsBillNo
                    });
                    MessageBox.Show(ex.Message, @"提示信息", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                MessageBox.Show(this, result.Msg, @"注意", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
예제 #2
0
    public void Finish()
    {
        Storno.isOn = false;

        SpawnOrder(CurrentCustomer);

        if (Printer != null)
        {
            Printer.PrintOrder(CurrentCustomer);
        }

        Clear();
        CreateCustomer();
        Save();
    }
예제 #3
0
        private void bt_PrintExpress_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(cmb_ExpPrinter.Text) || string.IsNullOrEmpty(cmb_TmplLst.Text))
            {
                MessageBox.Show(this, @"打印快递单时请选择<快递打印机>和<快递单模版>!", "注意", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            if (WMSService.WMSOrderNos != null && WMSService.WMSOrderNos.Values.Count > 0)
            {
                MessageBox.Show(this, @"打印正在进行,请等待打印完成之后再进行此操作!", "注意", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            var downGoodsBillNo    = string.Empty;
            var downGoodsBillState = string.Empty;

            foreach (var row in dgv_Order.Rows.Cast <DataGridViewRow>().Where(row => null != row.Cells[0].Value && ((bool)row.Cells[0].Value)))
            {
                downGoodsBillNo    = row.Cells[2].Value.ToString();
                downGoodsBillState = row.Cells[5].Value.ToString();
                break;
            }
            if (string.IsNullOrWhiteSpace(downGoodsBillNo))
            {
                MessageBox.Show(this, @"请选择要打印的订单!", @"注意", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            //取得订单
            var result = WMSService.CurrentWMSService.GetPrintOrderBill(new Guid(ConfigManager.ConfigInfo.WarehouseId),
                                                                        new Guid(ConfigManager.ConfigInfo.InvoiceFilialeId), downGoodsBillNo);

            if (result.IsSuccess)
            {
                var printType = downGoodsBillState == "待下货" ? PrintType.Manual : PrintType.Again;
                try
                {
                    PrinterManager.PrintOrder(new Guid(cmb_TmplLst.SelectedValue.ToString()), result.Data, cmb_ExpPrinter.Text, printType, YesOrNo.No, PrintAbout.Express);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, @"提示信息", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }