From 0f8453d5b7d8be39afe5ca89596553484b98d127 Mon Sep 17 00:00:00 2001 From: "ruoxing.wang" <88384874@qq.com> Date: Thu, 25 Jul 2024 10:02:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=A8=E5=A1=91=E6=9F=A5=E8=AF=A2=E6=89=93?= =?UTF-8?q?=E7=A0=81=E5=8A=9F=E8=83=BD,=E5=8E=9F=E6=9D=A5=E6=98=AF?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E4=B8=8A=E9=9D=A2=E6=9F=A5=E8=AF=A2=E6=89=93?= =?UTF-8?q?=E5=8D=B0,=E6=94=B9=E4=B8=BA=E7=BB=99=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E8=B5=8B=E5=80=BC=E6=95=B0=E6=8D=AE=E6=BA=90=E5=90=8E=E7=9A=84?= =?UTF-8?q?=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- InjectionPC/App.config | 15 ++-- InjectionSearch/App.config | 10 ++- InjectionSearch/FrmBarCodeSearchNew.cs | 75 ++++++++++++++---- InjectionSearch/InjectionSearch.csproj | 8 +- .../{P02 - 副本.grf => 111 - 副本.grf} | Bin MESClassLibrary/Model/BarCodeModel.cs | 3 + 6 files changed, 85 insertions(+), 26 deletions(-) rename InjectionSearch/Report/{P02 - 副本.grf => 111 - 副本.grf} (100%) 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; }