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"];