示例#1
0
        private bool CreateBarcode()
        {
            bsCreate.EndEdit();

            bool   bResult  = false;
            string strError = string.Empty;

            GetCreatePara();

            if (!CheckCreate())
            {
                return(false);
            }

            List <Barcode_Model> lst = new List <Barcode_Model>();

            bResult = Print_Func.CreateBarcodeInfo(parameter, ref lst, ref strError);


            if (!bResult || !string.IsNullOrEmpty(strError))
            {
                return(Common.Common_Func.ErrorMessage(strError, "生成失败"));
            }
            if (lst == null || lst.Count <= 0)
            {
                return(Common.Common_Func.ErrorMessage("未获取到任何数据", "生成失败"));
            }

            lstBarcode = lst;
            return(true);
        }
示例#2
0
        private bool PrintRow(Barcode_Model barcode, int iPrintQty, ref string sPrintCode)
        {
            VoucherType type     = (VoucherType)barcode.VOUCHERTYPE.ToInt32();
            string      strLogo  = Print_Func.GetBoxLogoStr(type);
            string      strClear = Print_Func.GetBoxClearStr(type);
            string      strOnce  = Print_Func.GetBoxContentStr(type, barcode);

            if (string.IsNullOrEmpty(strOnce))
            {
                return(Common.Common_Func.ErrorMessage("外箱标签 " + barcode.SERIALNO + " 打印失败", "打印失败"));
            }


            string strContent = string.Empty;

            for (int i = 1; i <= iPrintQty; i++)
            {
                strContent += strOnce;
            }

            sPrintCode += strLogo;
            sPrintCode += strContent;
            sPrintCode += strClear;
            return(true);
        }
示例#3
0
        private bool PrintRow(Barcode_Model barcode, int iPrintQty, ref string sPrintCode)
        {
            string strError = string.Empty;

            barcode.PRINTQTY = iPrintQty;
            if (!Print_Func.PrintBarcode(barcode, ref strError))
            {
                //return false;
            }

            string strOnce = Print_Func.GetBoxContentStr(_type, barcode);

            if (string.IsNullOrEmpty(strOnce))
            {
                return(Common.Common_Func.ErrorMessage("外箱标签 " + barcode.SERIALNO + " 打印失败", "打印失败"));
            }


            string strContent = string.Empty;

            for (int i = 1; i <= iPrintQty; i++)
            {
                strContent += strOnce;
            }

            sPrintCode += strContent;
            return(true);
        }
示例#4
0
        private bool AlterOutBarcode()
        {
            bsCreate.EndEdit();

            bool   bResult  = false;
            string strError = string.Empty;

            if (!CheckCreate())
            {
                return(false);
            }

            bResult             = Print_Func.SaveOutBarcode(ref parameter, ref strError);
            bsCreate.DataSource = parameter;

            if (!bResult || !string.IsNullOrEmpty(strError))
            {
                return(Common.Common_Func.ErrorMessage(strError, "替换失败"));
            }
            if (parameter == null || parameter.ID <= 0)
            {
                return(Common.Common_Func.ErrorMessage("未获取到任何数据", "替换失败"));
            }

            lstBarcode = new List <Barcode_Model>();
            lstBarcode.Add(parameter);
            return(true);
        }
示例#5
0
        private void GetListQueryData()
        {
            bsMain.EndEdit();

            bool   bResult  = false;
            string strError = string.Empty;

            GetQueryMain();

            bResult = Print_Func.GetPrintInfo(_type, queryMain, ref lstMain, ref strError);
            //ChensControl.DividPage clientPage = pageList.dDividPage;
            //Common.Common_Func.GetServerPageFromClientPage(ref _serverMainPage, clientPage);
            //bResult = Print_Func.GetPrintInfo(ref lstMain, queryMain, ref _serverMainPage, ref strError);
            //Common.Common_Func.GetClientPageFromServerPage(_serverMainPage, ref clientPage);
            //pageList.ShowPage();
            dgvList.DataSource = lstMain;

            if (!bResult || !string.IsNullOrEmpty(strError))
            {
                Common.Common_Func.ErrorMessage(strError, "查询失败");
            }

            if (bResult)
            {
                SetBarcodeParameter(0);
            }
            else
            {
                txtVoucherNo.Focus();
                txtVoucherNo.SelectAll();
            }
        }
示例#6
0
        private bool PrintRow(AreaInfo area, int iPrintQty, ref string sPrintCode)
        {
            string strOnce = "";

            if (area.AreaType == 2)
            {
                strOnce = Print_Func.GetTempAreaPrintStr(area.AreaNo);
            }
            else
            {
                strOnce = Print_Func.GetAreaPrintStr(area.AreaNo);
            }
            if (string.IsNullOrEmpty(strOnce))
            {
                return(Common.Common_Func.ErrorMessage("货位标签 " + area.AreaName + " 打印失败", "打印失败"));
            }


            string strContent = string.Empty;

            for (int i = 1; i <= iPrintQty; i++)
            {
                strContent += strOnce;
            }

            sPrintCode += strContent;
            return(true);
        }
示例#7
0
 private void FrmMaterialPrint_Load(object sender, EventArgs e)
 {
     InitForm();
     if (!Print_Func.CheckPrinter())
     {
         return;
     }
 }
示例#8
0
 private void FrmMaterialLabelAlter_Load(object sender, EventArgs e)
 {
     SetSearchBtn();
     InitForm();
     if (!Print_Func.CheckPrinter())
     {
         return;
     }
 }
示例#9
0
 private void FrmOutBarcodeRePrint_Load(object sender, EventArgs e)
 {
     SetSearchBtn();
     InitForm();
     BindList();
     if (!Print_Func.CheckPrinter())
     {
         return;
     }
 }
示例#10
0
        private void GetListQueryData()
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;

                bsMain.EndEdit();

                bool   bResult = false;
                string strErr  = string.Empty;
                GetQueryMain();

                if (queryMain.StartTime != null && queryMain.EndTime != null)
                {
                    if (queryMain.StartTime.ToDateTime().Date > queryMain.EndTime.ToDateTime().Date)
                    {
                        Common.Common_Func.ErrorMessage("开始日期不能大于结束日期", "查询失败");
                        return;
                    }
                }

                ChensControl.DividPage clientPage = pageList.dDividPage;
                Common.Common_Func.GetServerPageFromClientPage(ref _serverMainPage, clientPage);
                bResult = Print_Func.GetCensorshipListByPage(ref lstMain, queryMain, ref _serverMainPage, ref strErr);
                Common.Common_Func.GetClientPageFromServerPage(_serverMainPage, ref clientPage);
                pageList.ShowPage();
                dgvList.DataSource = lstMain;

                if (!bResult || !string.IsNullOrEmpty(strErr))
                {
                    Common.Common_Func.ErrorMessage(strErr, "查询失败");
                }

                if (dgvList.DataSource == null || dgvList.Rows.Count <= 0)
                {
                    lstDetails           = new List <DeliveryReceiveDetail_Model>();
                    dgvDetail.DataSource = lstMain;
                    return;
                }
                else
                {
                    pageDetail.dDividPage.CurrentPageNumber = 1;
                    GetDetailsQueryData();
                }
            }
            catch (Exception ex)
            {
                Common.Common_Func.ErrorMessage(ex.Message, "查询失败");
            }
            finally
            {
                this.Cursor = Cursors.Default;
                txtMaterialDoc.Focus();
            }
        }
示例#11
0
        private void AlterPrint()
        {
            if (!Print_Func.CheckPrinter(false))
            {
                return;
            }

            if (AlterOutBarcode())
            {
                PrintLabel();
            }
        }
示例#12
0
        private void GetListQueryData()
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;

                bsMain.EndEdit();

                bool   bResult = false;
                string strErr  = string.Empty;
                GetQueryMain();

                if (queryMain.StartTime != null && queryMain.EndTime != null)
                {
                    if (queryMain.StartTime.ToDateTime().Date > queryMain.EndTime.ToDateTime().Date)
                    {
                        Common.Common_Func.ErrorMessage("开始日期不能大于结束日期", "查询失败");
                        return;
                    }
                }

                ChensControl.DividPage clientPage = pageList.dDividPage;
                Common.Common_Func.GetServerPageFromClientPage(ref _serverMainPage, clientPage);
                bResult = Print_Func.GetStockBarcodeListByPage(ref lstMain, queryMain, ref _serverMainPage, ref strErr);
                Common.Common_Func.GetClientPageFromServerPage(_serverMainPage, ref clientPage);
                pageList.ShowPage();
                dgvList.DataSource = lstMain;

                if (!bResult || !string.IsNullOrEmpty(strErr))
                {
                    Common.Common_Func.ErrorMessage(strErr, "查询失败");
                }

                if (dgvList.DataSource == null || dgvList.Rows.Count <= 0)
                {
                }
                else
                {
                    dgvList.EditMode = DataGridViewEditMode.EditOnKeystrokeOrF2;
                }
            }
            catch (Exception ex)
            {
                Common.Common_Func.ErrorMessage(ex.Message, "查询失败");
            }
            finally
            {
                this.Cursor          = Cursors.Default;
                cbxSelectAll.Checked = false;
                txtAreaNo.Focus();
            }
        }
示例#13
0
        private void PrintLabel()
        {
            if (!Print_Func.CheckPrinter(false))
            {
                return;
            }

            if (CreateBarcode())
            {
                PrintBarcode();

                ClearForm();
            }
        }
示例#14
0
        private void BindPrinter()
        {
            txtInnerPrinter.Text = Print_Var.InnerPrinter;
            txtOutPrinter.Text   = Print_Var.OutboxPrinter;

            nudInnerPrinter.Value = Print_Var.InnerPrintNum;
            nudOutPrinter.Value   = Print_Var.OutboxPrintNum;

            Common.Common_Func.BindComboBox(Print_Func.GetPrinterDPI(), cbbInnerDPI);
            cbbInnerDPI.SelectedValue = Print_Var.InnerDPI;

            Common.Common_Func.BindComboBox(Print_Func.GetPrinterDPI(), cbbOutDPI);
            cbbOutDPI.SelectedValue = Print_Var.OutboxDPI;
        }
示例#15
0
        private void PrintLabel()
        {
            if (lstMain == null || lstMain.Count <= 0)
            {
                return;
            }

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

            if (CreateBarcode())
            {
                PrintBarcode();
            }
        }
示例#16
0
        private void tsmiChangePrinter_Click(object sender, EventArgs e)
        {
            try
            {
                //this.Cursor = Cursors.WaitCursor;

                Print_Func.ChangePrinter();
            }
            catch (Exception ex)
            {
                Common.Common_Func.ErrorMessage(ex.Message, "程序异常");
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
示例#17
0
        private void PrintLabel()
        {
            int StartX = nbStartX.Value.ToInt32();
            int StartY = nbStartY.Value.ToInt32();
            int Width  = nbWidth.Value.ToInt32();
            int Heigh  = nbHeigh.Value.ToInt32();

            string BasicFontName = txtBasicFontName.Text;
            int    BasicFontSize = nbBasicFontSize.Value.ToInt32();;

            int BaiscColMargin = nbBaiscColMargin.Value.ToInt32();
            int BasicRowHeigh  = nbBasicRowHeigh.Value.ToInt32();
            int MinRowMargin   = nbMinRowMargin.Value.ToInt32();

            int PictrueTopPad   = nbPictrueTopPad.Value.ToInt32();
            int PictrueRightPad = nbPictrueRightPad.Value.ToInt32();

            int CheckedMargin = nbCheckedMargin.Value.ToInt32();
            int CheckedOffset = nbCheckedOffset.Value.ToInt32();


            Barcode_Model barcode = new Barcode_Model();

            barcode.CUSNAME       = "京信通信";
            barcode.SUPCODE       = "600212";
            barcode.SUPNAME       = "深圳市威凌科技有限公司";
            barcode.MATERIALNO    = "102001-000055-00";
            barcode.MATERIALDESC  = "DB15,直针焊板带螺母(三排) DB15,直针焊板带螺母(三排)";
            barcode.VOUCHERNO     = "4700286343";
            barcode.ROWNO         = "00010";
            barcode.QTY           = 500;
            barcode.PRDVERSION    = "TEST VER.";
            barcode.BATCHNO       = "20140714";
            barcode.INNERCOUNT    = 5;
            barcode.INNERPACKQTY  = 100;
            barcode.MANTISSAQTY   = 0;
            barcode.OUTCOUNT      = 10;
            barcode.BATCHQTY      = 5000;
            barcode.BARCODENO     = 1;
            barcode.SERIALNO      = "201507140044";
            barcode.BARCODE       = "10@102001-000055-00@201507140044";
            barcode.BPlatedSilver = true;

            PrintLibrary.PrintLibrary_Func.PrintTest(Print_Func.GetPrintBarcodeByServiceBarcode(barcode), Print_Var.OutboxPrinter, 200, StartX, StartY, Width, Heigh, BasicFontName, BasicFontSize, BaiscColMargin, BasicRowHeigh, MinRowMargin, PictrueTopPad, PictrueRightPad, CheckedMargin, CheckedOffset);
        }
示例#18
0
        private void GetDetailsQueryData()
        {
            bool   bResult = false;
            string strErr  = string.Empty;

            GetQueryDetails();

            ChensControl.DividPage clientPage = pageDetail.dDividPage;
            Common.Common_Func.GetServerPageFromClientPage(ref _serverDetailsPage, clientPage);
            bResult = Print_Func.GetCensorshipDetailByPage(ref lstDetails, queryDetails, ref _serverDetailsPage, ref strErr);
            Common.Common_Func.GetClientPageFromServerPage(_serverDetailsPage, ref clientPage);
            pageDetail.ShowPage();
            dgvDetail.DataSource = lstDetails;

            if (!bResult || !string.IsNullOrEmpty(strErr))
            {
                Common.Common_Func.ErrorMessage(strErr, "查询失败");
            }
        }
示例#19
0
        private bool PrintRow(Barcode_Model barcode, int iPrintQty, ref string sPrintCode)
        {
            string strOnce = Print_Func.GetBoxContentStr(VoucherType.任意单据, barcode);

            if (string.IsNullOrEmpty(strOnce))
            {
                return(Common.Common_Func.ErrorMessage("外箱标签 " + barcode.SERIALNO + " 打印失败", "打印失败"));
            }


            string strContent = string.Empty;

            for (int i = 1; i <= iPrintQty; i++)
            {
                strContent += strOnce;
            }

            sPrintCode += strContent;
            return(true);
        }
示例#20
0
        private bool GetMaterialInfo()
        {
            TempMaterialInfo material = new TempMaterialInfo();

            material.MaterialNo = txtMaterialNo.Text.Trim();
            string strError = string.Empty;

            if (Print_Func.GetMaterialInfo(ref material, 3, ref strError))
            {
                parameter.MATERIALNO   = material.MaterialNo;
                parameter.MATERIALDESC = material.MaterialDesc;
                parameter.Unit         = material.Unit;
                parameter.ISROHS       = material.IsRohs;

                txtMaterialNo.Enabled   = false;
                btnGetMaterial.Enabled  = false;
                txtBatchNo.Enabled      = true;
                txtSupCode.Enabled      = true;
                txtSupName.Enabled      = true;
                txtOutPackQty.Enabled   = true;
                cbxPlatedSilver.Enabled = true;
                cbxPlatedTin.Enabled    = true;
                cbxOther.Enabled        = true;
                txtPrintQty.Enabled     = true;
                tsmiPrint.Enabled       = true;

                txtBatchNo.Focus();
                txtBatchNo.SelectAll();
                return(true);
            }
            else
            {
                txtMaterialNo.Focus();
                txtMaterialNo.SelectAll();

                return(false);
            }
        }
示例#21
0
        private void GetListQueryData()
        {
            bsMain.EndEdit();

            bool   bResult  = false;
            string strError = string.Empty;

            GetQueryMain();

            ChensControl.DividPage clientPage = pageList.dDividPage;
            Common.Common_Func.GetServerPageFromClientPage(ref _serverMainPage, clientPage);
            bResult = Print_Func.GetOutBarcodeListByPage(ref lstMain, queryMain, ref _serverMainPage, ref strError);
            Common.Common_Func.GetClientPageFromServerPage(_serverMainPage, ref clientPage);
            pageList.ShowPage();
            dgvList.DataSource = lstMain;

            if (!bResult || !string.IsNullOrEmpty(strError))
            {
                Common.Common_Func.ErrorMessage(strError, "查询失败");
            }

            txtVoucherNo.Focus();
        }
示例#22
0
 void PrintStock(int model)
 {
     if (currentDetail != null)
     {
         try
         {
             if (model == 0)
             {
                 //验证
                 if (new System.Text.RegularExpressions.Regex(@"[\u4e00-\u9fa5]").IsMatch(txtcinvstd.Text))
                 {
                     MessageBox.Show("规格型号中包含有中文");
                     txtcinvstd.SelectAll();
                     txtcinvstd.Focus();
                     return;
                 }
             }
             if (!new System.Text.RegularExpressions.Regex(@"^[0-9]\d*$").IsMatch(txtOutPackQty.Text))
             {
                 MessageBox.Show("外箱包装量必须是正整数");
                 return;
             }
             if (!new System.Text.RegularExpressions.Regex(@"^[0-9]\d*$").IsMatch(txtPrintQty.Text))
             {
                 MessageBox.Show("打印份数必须是正整数");
                 return;
             }
             if (!new System.Text.RegularExpressions.Regex(@"^[0-9]\d*$").IsMatch(txtBatchQty.Text))
             {
                 MessageBox.Show("打印数量必须是正整数");
                 return;
             }
             //生成条码
             string strErrMsg = "";
             List <WebService.ProductLabel_Model> label_lst = null;
             WebService.ProductLabel_Model        label     = new WebService.ProductLabel_Model();
             label.invstd       = txtcinvstd.Text;
             label.Remark       = "内部使用";
             label.labeltype    = "15";//国内的成品外箱
             label.outpackqty   = txtOutPackQty.Text;
             label.materialno   = txtMaterialNo.Text;
             label.materialdesc = txtMaterialDesc.Text;
             Stock_Model stockmodel = new Stock_Model();
             stockmodel.AreaNo       = currentDetail.AreaNo;
             stockmodel.MaterialNo   = currentDetail.MaterialNo;
             stockmodel.MaterialDesc = currentDetail.MaterialDesc;
             stockmodel.MaterialStd  = currentDetail.MaterialStd;
             stockmodel.WarehouseNo  = currentDetail.WarehouseNo;
             stockmodel.HouseNo      = currentDetail.HouseNo;
             if (!WMS.Common.WMSWebService.service.CreateInitialProductBarcode(stockmodel, label, Convert.ToInt16(txtBatchQty.Text), ref label_lst, ref strErrMsg))
             {
                 MessageBox.Show("生成条码失败:" + strErrMsg);
                 return;
             }
             int printqty = Convert.ToInt16(txtPrintQty.Text);
             List <WebService.ProductLabel_Model> list = new List <WebService.ProductLabel_Model>();
             for (int i = 0; i < label_lst.Count; i++)
             {
                 label_lst[i].qrbarcode = Print_Func.ConvertImageToString(Print_Func.CreateQRCode(label_lst[i].barcode));
                 for (int j = 0; j < printqty; j++)
                 {
                     list.Add(label_lst[i]);
                 }
             }
             FrmStockLabelPrint frm = new FrmStockLabelPrint(model, list);
             frm.ShowDialog();
             txtWhereMaterialNo.Text  = "";
             txtWhereWarehouseNo.Text = "";
             txtWhereHouseNo.Text     = "";
             txtWhereAreaNo.Text      = "";
             btnSearch_Click(null, null);
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message);
         }
     }
 }
示例#23
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();
            }
        }
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (txtcinvstd.Enabled)
            {
                reportViewer1.LocalReport.EnableExternalImages = true;
                reportViewer1.LocalReport.DataSources.Clear();
                reportViewer1.LocalReport.DataSources.Clear();

                foreach (WebService.ProductLabel_Model labelModel in label_lst)
                {
                    labelModel.invstd    = txtcinvstd.Text;
                    labelModel.ordercode = txtOrderCode.Text;
                    labelModel.smallQR   = Print_Func.ConvertImageToString(new BarCode128().EncodeBarcode(labelModel.BarcodeExpress, 300, 50, false));//Print_Func.CreateQRCode(labelModel.BarcodeExpress)
                    if (labelModel.outpackqty.Equals(""))
                    {
                        labelModel.barcode = labelModel.labeltype + "@" + labelModel.materialno + "@" + labelModel.ordercode + "@" + labelModel.POCode + "@0001@" + labelModel.BarcodeExpress;
                    }
                    else
                    {
                        labelModel.barcode = labelModel.labeltype + "@" + labelModel.materialno + "@" + labelModel.ordercode + "@" + labelModel.POCode + "@" + Convert.ToInt16(labelModel.outpackqty).ToString().PadLeft(4, '0') + "@" + labelModel.BarcodeExpress;
                    }
                    //labelModel.CUName = txtSupCode.Text;
                    //if (chkRemark.Checked)
                    //{
                    //    labelModel.Remark = "内部使用";
                    //}
                    //else
                    //{
                    //    labelModel.Remark = "";
                    //}
                    if (labelModel.prdversion != null && labelModel.prdversion != "")
                    {
                        if (labelModel.prdversion.Equals("0"))
                        {
                            labelModel.qrbarcode = Print_Func.ConvertImageToString(Print_Func.CreateQRCode(labelModel.barcode));
                            labelModel.smallQR   = Print_Func.ConvertImageToString(Print_Func.CreateQRCode(labelModel.BarcodeExpress));
                        }
                        else if (labelModel.prdversion.Equals("1"))
                        {
                            labelModel.qrbarcode = Print_Func.ConvertImageToString(Print_Func.CreateQRCode(labelModel.BarcodeExpress));
                        }
                        else
                        {
                            labelModel.qrbarcode = Print_Func.ConvertImageToString(Print_Func.CreateQRCode(@"http://www.shimge-pump.com/?sn=" + labelModel.BarcodeExpress));
                        }
                    }
                    else
                    {
                        labelModel.qrbarcode = Print_Func.ConvertImageToString(Print_Func.CreateQRCode(labelModel.barcode));
                    }
                }

                string strErrMsg = "";
                if (!WMS.Common.WMSWebService.service.RePrintChangeSave(label_lst, ref strErrMsg))
                {
                    MessageBox.Show(strErrMsg);
                }
                foreach (WebService.ProductLabel_Model labelModel in label_lst)
                {
                    if (labelModel.outpackqty.Equals("1") || labelModel.outpackqty.Equals("0001"))
                    {
                        labelModel.outpackqty = "";
                    }
                }
                ReportDataSource rds = new ReportDataSource("DataSet1", label_lst);

                reportViewer1.LocalReport.DataSources.Add(rds);
                if (label_lst[0].prdversion != null && label_lst[0].prdversion != "")
                {
                    if (label_lst[0].prdversion.Equals("0"))
                    {
                        reportViewer1.LocalReport.ReportEmbeddedResource = @"JingXinWMS.Print.Report3.rdlc";
                    }
                    else if (label_lst[0].prdversion.Equals("1"))
                    {
                        reportViewer1.LocalReport.ReportEmbeddedResource = @"JingXinWMS.Print.Report5.rdlc";
                    }
                    else
                    {
                        reportViewer1.LocalReport.ReportEmbeddedResource = @"JingXinWMS.Print.Report5.rdlc";
                    }
                    //reportViewer1.LocalReport.ReportEmbeddedResource = @"JingXinWMS.Print.Report4.rdlc";
                }
                else
                {
                    reportViewer1.LocalReport.ReportEmbeddedResource = @"JingXinWMS.Print.Report2.rdlc";
                }
                reportViewer1.LocalReport.Refresh();
                this.reportViewer1.RefreshReport();
                this.reportViewer1.RefreshReport();
            }
        }
        private void 查询ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string strErrMsg = "";
            string serialno  = txtVoucherNo.Text.Trim();

            if (!new System.Text.RegularExpressions.Regex(@"^[0-9]\d*$").IsMatch(txtQty.Text))
            {
                MessageBox.Show("数量必须是正整数");
                return;
            }
            if (WMS.Common.WMSWebService.service.RePrintByBarcode(chkOuter.Checked, serialno, Convert.ToInt16(txtQty.Text), ref label_lst, ref strErrMsg))
            {
                reportViewer1.LocalReport.EnableExternalImages = true;
                reportViewer1.LocalReport.DataSources.Clear();
                reportViewer1.LocalReport.DataSources.Clear();
                bool isDifferent = false;
                foreach (WebService.ProductLabel_Model labelModel in label_lst)
                {
                    if (labelModel.prdversion != null && labelModel.prdversion != "")
                    {
                        if (labelModel.prdversion.Equals("0"))
                        {
                            labelModel.qrbarcode = Print_Func.ConvertImageToString(Print_Func.CreateQRCode(labelModel.barcode));
                            labelModel.smallQR   = Print_Func.ConvertImageToString(Print_Func.CreateQRCode(labelModel.BarcodeExpress));
                        }
                        else if (labelModel.prdversion.Equals("1"))
                        {
                            labelModel.qrbarcode = Print_Func.ConvertImageToString(Print_Func.CreateQRCode(labelModel.BarcodeExpress));
                        }
                        else
                        {
                            labelModel.smallQR   = Print_Func.ConvertImageToString(new BarCode128().EncodeBarcode(labelModel.BarcodeExpress, 300, 50, false));//Print_Func.CreateQRCode(labelModel.BarcodeExpress)
                            labelModel.qrbarcode = Print_Func.ConvertImageToString(Print_Func.CreateQRCode(@"http://www.shimge-pump.com/?sn=" + labelModel.BarcodeExpress));
                        }
                    }
                    else
                    {
                        labelModel.qrbarcode = Print_Func.ConvertImageToString(Print_Func.CreateQRCode(labelModel.barcode));
                    }

                    //labelModel.smallQR = Print_Func.ConvertImageToString(Print_Func.CreateQRCode(labelModel.BarcodeExpress));
                    if (!isDifferent && label_lst[0].invstd.Equals(labelModel.invstd) && label_lst[0].ordercode.Equals(labelModel.ordercode))
                    {
                        isDifferent = false;
                    }
                    else
                    {
                        isDifferent = true;
                    }
                    if (labelModel.outpackqty.Equals("1") || labelModel.outpackqty.Equals("0001"))
                    {
                        labelModel.outpackqty = "";
                    }
                }
                if (isDifferent)
                {
                    txtcinvstd.Text      = "";
                    txtcinvstd.Enabled   = false;
                    txtOrderCode.Text    = "";
                    txtOrderCode.Enabled = false;
                    //txtSupCode.Text = "";
                    //txtSupCode.Enabled = false;
                    MessageBox.Show("该批条码不是同一批次");
                }
                else
                {
                    txtcinvstd.Text      = label_lst[0].invstd;
                    txtcinvstd.Enabled   = true;
                    txtOrderCode.Text    = label_lst[0].ordercode;
                    txtOrderCode.Enabled = true;
                    //txtSupCode.Text = label_lst[0].CUName;
                    //txtSupCode.Enabled = true;
                    //if(label_lst[0].Remark.Equals("内部使用"))
                    //{
                    //    chkRemark.Checked = true;
                    //}
                    //else
                    //{
                    //    chkRemark.Checked = false;
                    //}
                }
                ReportDataSource rds = new ReportDataSource("DataSet1", label_lst);

                reportViewer1.LocalReport.DataSources.Add(rds);
                if (label_lst[0].prdversion != null && label_lst[0].prdversion != "")
                {
                    if (label_lst[0].prdversion.Equals("0"))
                    {
                        reportViewer1.LocalReport.ReportEmbeddedResource = @"JingXinWMS.Print.Report3.rdlc";
                    }
                    else if (label_lst[0].prdversion.Equals("1"))
                    {
                        reportViewer1.LocalReport.ReportEmbeddedResource = @"JingXinWMS.Print.Report5.rdlc";
                    }
                    else
                    {
                        reportViewer1.LocalReport.ReportEmbeddedResource = @"JingXinWMS.Print.Report5.rdlc";
                    }
                    //reportViewer1.LocalReport.ReportEmbeddedResource = @"JingXinWMS.Print.Report4.rdlc";
                }
                else
                {
                    reportViewer1.LocalReport.ReportEmbeddedResource = @"JingXinWMS.Print.Report2.rdlc";
                }
                reportViewer1.LocalReport.Refresh();
                this.reportViewer1.RefreshReport();
                this.reportViewer1.RefreshReport();
            }
            else
            {
                MessageBox.Show(strErrMsg);
                label_lst = null;
            }
        }
示例#26
0
 private void BindComboboxs()
 {
     Common.Common_Func.BindComboBoxAddAll(Print_Func.GetOrderType(), cbbVoucherType);
 }
示例#27
0
        private void PrintBarcode()
        {
            btnGetMaterial.Focus();

            bool isPrinted = false;

            string strPrintCode = string.Empty;
            int    iPrintQty    = 0;
            int    iPrintCount  = 0;
            string strLogo      = Print_Func.GetBoxLogoStr(VoucherType.任意单据);
            string strContent   = string.Empty;
            string strClear     = Print_Func.GetBoxClearStr(VoucherType.任意单据);

            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(strContent))
                    {
                        strPrintCode += strLogo;
                        strPrintCode += strContent;
                        strPrintCode += strClear;
                        Print_Func.SendStringToPrinter(strPrintCode);
                    }

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

                if (!PrintRow(barcode, 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);
                }

                ClearForm();
            }
        }
示例#28
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();
            }
        }
示例#29
0
        private void PrintBarcode()
        {
            btnSearch.Focus();

            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 (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(strContent))
                    {
                        strPrintCode += strLogo;
                        strPrintCode += strContent;
                        strPrintCode += strClear;
                        Print_Func.SendStringToPrinter(strPrintCode);
                    }

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

                if (!PrintRow(barcode, 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);
                }

                //GetListQueryData();
            }

            SetBarcodeParameter(dgvList.CurrentCell.RowIndex);
        }