From 686cf147f2c2e881cc1621320a701cff7e682490 Mon Sep 17 00:00:00 2001 From: "ruoxing.wang" <88384874@qq.com> Date: Wed, 31 Jul 2024 16:42:29 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E6=89=93=E4=B8=8D=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E7=9A=84bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- InjectionSearch/FrmBarCodeSearchNew.cs | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/InjectionSearch/FrmBarCodeSearchNew.cs b/InjectionSearch/FrmBarCodeSearchNew.cs index 9cc5ad9..4d74e8b 100644 --- a/InjectionSearch/FrmBarCodeSearchNew.cs +++ b/InjectionSearch/FrmBarCodeSearchNew.cs @@ -187,8 +187,17 @@ namespace InjectionSearch ////report.PrintPreview(true); //report.Print(false); - - Print(md.OneBarCode, md.BarCode, md.Import); + //(glacialList1.SelectedItems[0] as GlacialComponents.Controls.GLItem).SubItems[1].Text + string productName = string.Empty; + if (glacialList1.SelectedItems.Count > 0) + { + GlacialComponents.Controls.GLItem gLItem = glacialList1.SelectedItems[0] as GlacialComponents.Controls.GLItem; + if(gLItem.SubItems.Count > 1) + { + productName = gLItem.SubItems[1].Text; + } + } + Print(md.OneBarCode, md.BarCode, md.Import, productName); #endregion @@ -345,6 +354,7 @@ namespace InjectionSearch md.PrintType = 1; DataTable pdt = pbll.SearchIsImportByStockNo(stockNo); + string productName = string.Empty; if (pdt != null && pdt.Rows.Count > 0) { if (pdt.Rows[0]["isImport"].ToString() == "1") @@ -355,6 +365,7 @@ namespace InjectionSearch { md.Import = ""; } + productName = pdt.Rows[0]["ProductName"].ToString(); } if (bll.Add_Info(md)) @@ -372,7 +383,7 @@ namespace InjectionSearch ////report.PrintPreview(true); //report.Print(false); - Print(NewOneCode, newcode, md.Import); + Print(NewOneCode, newcode, md.Import, productName); #endregion @@ -527,7 +538,7 @@ namespace InjectionSearch LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); } } - void Print(string NewOneCode,string newcode,string Import) + void Print(string NewOneCode,string newcode,string Import,string productName) { string filename = _printTemplateName; @@ -542,7 +553,9 @@ namespace InjectionSearch row["OneBarCode"] = NewOneCode; row["BarCode"] = newcode; - row["ProductName"] = comboBox2.Text + ";"; + + + row["ProductName"] = productName + ";"; row["IsImport"] = Import; string reportName = ConfigurationManager.AppSettings["Printer"];