Exemplo n.º 1
0
 private void FrmMaterialPrint_Load(object sender, EventArgs e)
 {
     InitForm();
     if (!Print_Func.CheckPrinter())
     {
         return;
     }
 }
Exemplo n.º 2
0
 private void FrmMaterialLabelAlter_Load(object sender, EventArgs e)
 {
     SetSearchBtn();
     InitForm();
     if (!Print_Func.CheckPrinter())
     {
         return;
     }
 }
Exemplo n.º 3
0
 private void FrmOutBarcodeRePrint_Load(object sender, EventArgs e)
 {
     SetSearchBtn();
     InitForm();
     BindList();
     if (!Print_Func.CheckPrinter())
     {
         return;
     }
 }
Exemplo n.º 4
0
        private void AlterPrint()
        {
            if (!Print_Func.CheckPrinter(false))
            {
                return;
            }

            if (AlterOutBarcode())
            {
                PrintLabel();
            }
        }
Exemplo n.º 5
0
        private void PrintLabel()
        {
            if (!Print_Func.CheckPrinter(false))
            {
                return;
            }

            if (CreateBarcode())
            {
                PrintBarcode();

                ClearForm();
            }
        }
Exemplo n.º 6
0
        private void PrintLabel()
        {
            if (lstMain == null || lstMain.Count <= 0)
            {
                return;
            }

            if (!Print_Func.CheckPrinter(false))
            {
                return;
            }

            if (CreateBarcode())
            {
                PrintBarcode();
            }
        }
Exemplo n.º 7
0
        private void PrintLabel()
        {
            if (lstMain == null || lstMain.Count <= 0)
            {
                return;
            }

            btnSearch.Focus();

            if (!Print_Func.CheckPrinter(false))
            {
                return;
            }

            bool isPrinted = false;

            string strPrintCode = string.Empty;
            int    iPrintQty    = 0;
            int    iPrintCount  = 0;

            foreach (Barcode_Model barcode in lstBarcode)
            {
                iPrintQty = barcode.PRINTQTY.ToInt32();
                if (iPrintQty <= 0)
                {
                    Common.Common_Func.ErrorMessage("外箱标签 " + barcode.SERIALNO + " 打印份数输入错误", "打印失败");
                    continue;
                }

                isPrinted = true;

                if (iPrintCount / Print_Var.OutboxPrintNum >= 1 || iPrintCount % Print_Var.OutboxPrintNum == 0)
                {
                    iPrintCount = 0;
                    if (!string.IsNullOrEmpty(strPrintCode))
                    {
                        Print_Func.SendStringToPrinter(strPrintCode);
                    }

                    strPrintCode = string.Empty;
                }

                if (!PrintRow(barcode, iPrintQty, ref strPrintCode))
                {
                    continue;
                }

                iPrintCount += iPrintQty;
            }

            if (!isPrinted)
            {
                Common.Common_Func.ErrorMessage("请先选中需要打印的货位", "打印失败");
                return;
            }
            else
            {
                if (iPrintCount >= 1 && !string.IsNullOrEmpty(strPrintCode))
                {
                    Print_Func.SendStringToPrinter(strPrintCode);
                }

                //GetListQueryData();
            }
        }
Exemplo n.º 8
0
        private void PrintLabel()
        {
            if (lstMain == null || lstMain.Count <= 0)
            {
                return;
            }

            btnSearch.Focus();

            if (!Print_Func.CheckPrinter(false))
            {
                return;
            }

            bool isPrinted = false;

            string strPrintCode = string.Empty;
            int    iPrintQty    = 0;
            int    iPrintCount  = 0;
            string strLogo      = Print_Func.GetBoxLogoStr(_type);
            string strContent   = string.Empty;
            string strClear     = Print_Func.GetBoxClearStr(_type);

            foreach (DataGridViewRow dgvr in dgvList.Rows)
            {
                if (dgvr.Cells["colSelect"].Value.ToBoolean())
                {
                    if (dgvr.Cells["colPrintQty"].Value == null)
                    {
                        iPrintQty = colPrintQty.DefaultCellStyle.NullValue.ToInt32();
                    }
                    else
                    {
                        try { iPrintQty = Convert.ToInt32(dgvr.Cells["colPrintQty"].Value); }
                        catch { iPrintQty = 0; }
                    }
                    if (iPrintQty <= 0)
                    {
                        Common.Common_Func.ErrorMessage("第" + dgvr.Index + 1 + "行数量输入错误", "打印失败");
                        continue;
                    }

                    isPrinted = true;

                    if (iPrintCount / Print_Var.OutboxPrintNum >= 1 || iPrintCount % Print_Var.OutboxPrintNum == 0)
                    {
                        iPrintCount = 0;
                        if (!string.IsNullOrEmpty(strContent))
                        {
                            strPrintCode += strLogo;
                            strPrintCode += strContent;
                            strPrintCode += strClear;
                            Print_Func.SendStringToPrinter(strPrintCode);
                        }

                        strPrintCode = string.Empty;
                        strContent   = string.Empty;
                    }

                    if (!PrintRow(lstMain[dgvr.Index], iPrintQty, ref strContent))
                    {
                        continue;
                    }

                    iPrintCount += iPrintQty;
                }
            }

            if (!isPrinted)
            {
                Common.Common_Func.ErrorMessage("请先选中需要打印的货位", "打印失败");
                return;
            }
            else
            {
                if (iPrintCount >= 1 && !string.IsNullOrEmpty(strContent))
                {
                    strPrintCode += strLogo;
                    strPrintCode += strContent;
                    strPrintCode += strClear;
                    Print_Func.SendStringToPrinter(strPrintCode);
                }

                if (cbxSelectAll.Checked)
                {
                    cbxSelectAll.Checked = false;
                }
                else
                {
                    SelectAll();
                }

                //GetListQueryData();
            }
        }