diff --git a/InjectionPC/App.config b/InjectionPC/App.config index 790ce64..e7a30ad 100644 --- a/InjectionPC/App.config +++ b/InjectionPC/App.config @@ -2,15 +2,15 @@ - - + + - + @@ -24,7 +24,7 @@ - + @@ -37,8 +37,11 @@ - - + + + + diff --git a/InjectionSearch/App.config b/InjectionSearch/App.config index 4bde880..03e8a93 100644 --- a/InjectionSearch/App.config +++ b/InjectionSearch/App.config @@ -2,12 +2,16 @@ - + + - - + + + + diff --git a/InjectionSearch/FrmBarCodeSearchNew.cs b/InjectionSearch/FrmBarCodeSearchNew.cs index 349efb8..4363c58 100644 --- a/InjectionSearch/FrmBarCodeSearchNew.cs +++ b/InjectionSearch/FrmBarCodeSearchNew.cs @@ -25,7 +25,7 @@ namespace InjectionSearch public FrmBarCodeSearchNew() { InitializeComponent(); - _printTemplateName = Application.StartupPath + "\\Report\\P02 - 副本.grf"; + _printTemplateName = Application.StartupPath + "\\Report\\111 - 副本.grf"; } private void initProduct() @@ -113,6 +113,11 @@ namespace InjectionSearch _stationTable = sbll.SearchAllInfo(); } + /// + /// 补打 + /// + /// + /// private void label18_Click(object sender, EventArgs e) { string code = ""; @@ -171,15 +176,18 @@ namespace InjectionSearch #region 打印条码 - GridppReport report = new GridppReport(); + //GridppReport report = new GridppReport(); - report.Register(""); - //report.LoadFromFile(@"D:\P02 - 副本.grf"); - report.LoadFromFile(_printTemplateName); - report.ConnectionString = ConfigurationManager.ConnectionStrings["report"].ToString(); + //report.Register(""); + ////report.LoadFromFile(@"D:\P02 - 副本.grf"); + //report.LoadFromFile(_printTemplateName); + //report.ConnectionString = ConfigurationManager.ConnectionStrings["report"].ToString(); + + ////report.PrintPreview(true); + //report.Print(false); + + Print(md.OneBarCode, md.BarCode, md.Import); - //report.PrintPreview(true); - report.Print(false); #endregion bll.Update_Info(md); @@ -351,19 +359,25 @@ namespace InjectionSearch { #region 打印条码 - GridppReport report = new GridppReport(); + //GridppReport report = new GridppReport(); + + //report.Register(""); + ////report.LoadFromFile(@"D:\P02.grf"); + ////report.LoadFromFile(@"D:\P02 - 副本.grf"); + //report.LoadFromFile(_printTemplateName); + //report.ConnectionString = ConfigurationManager.ConnectionStrings["report"].ToString(); - report.Register(""); - //report.LoadFromFile(@"D:\P02.grf"); - //report.LoadFromFile(@"D:\P02 - 副本.grf"); - report.LoadFromFile(_printTemplateName); - report.ConnectionString = ConfigurationManager.ConnectionStrings["report"].ToString(); + ////report.PrintPreview(true); + //report.Print(false); - //report.PrintPreview(true); - report.Print(false); + Print(NewOneCode, newcode, md.Import); + #endregion + + + bll.Update_Info(md); } @@ -511,7 +525,36 @@ namespace InjectionSearch LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); } } + void Print(string NewOneCode,string newcode,string Import) + { + + string filename = _printTemplateName; + DataTable headTable = new DataTable(); + headTable.Columns.Add("StationNo"); + headTable.Columns.Add("OneBarCode"); + headTable.Columns.Add("BarCode"); + headTable.Columns.Add("ProductName"); + headTable.Columns.Add("IsImport"); + DataRow row = headTable.NewRow(); + row["StationNo"] = Program.station; + row["OneBarCode"] = NewOneCode; + row["BarCode"] = newcode; + row["ProductName"] = comboBox2.Text + ";"; + row["IsImport"] = Import; + string reportName = ConfigurationManager.AppSettings["Printer"]; + + headTable.Rows.Add(row); + + InjectionPC.ReportHelper rp = new InjectionPC.ReportHelper(filename, headTable, null, + (int)GRPaperOrientation.grpoDefault, 1, reportName); + rp.Report.Print(false); + + + + InjectionPC.LogHelper.WriteLog("打印时间:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + ";" + NewOneCode); + + } private void button1_Click(object sender, EventArgs e) { BarCodeBLL bll = new BarCodeBLL(); diff --git a/InjectionSearch/InjectionSearch.csproj b/InjectionSearch/InjectionSearch.csproj index 279feaf..783c40f 100644 --- a/InjectionSearch/InjectionSearch.csproj +++ b/InjectionSearch/InjectionSearch.csproj @@ -64,6 +64,12 @@ + + LogHelper.cs + + + ReportHelper.cs + Form @@ -112,7 +118,7 @@ Settings.settings True - + PreserveNewest diff --git a/InjectionSearch/Report/P02 - 副本.grf b/InjectionSearch/Report/111 - 副本.grf similarity index 100% rename from InjectionSearch/Report/P02 - 副本.grf rename to InjectionSearch/Report/111 - 副本.grf diff --git a/MESClassLibrary/Model/BarCodeModel.cs b/MESClassLibrary/Model/BarCodeModel.cs index 9f2d138..c73c77b 100644 --- a/MESClassLibrary/Model/BarCodeModel.cs +++ b/MESClassLibrary/Model/BarCodeModel.cs @@ -12,6 +12,9 @@ namespace MESClassLibrary.Model public string OneBarCode { get; set; } public string BarCode { get; set; } public string StockNo { get; set; } + /// + /// 0自动打印,1手工打印,2补打 + /// public int PrintType { get; set; } public string StationID { get; set; }