From d40ac9f44fa3aba4692110509209f281f15aaba7 Mon Sep 17 00:00:00 2001 From: "ruoxing.wang" <88384874@qq.com> Date: Thu, 7 Aug 2025 11:23:23 +0800 Subject: [PATCH] 2 --- PunchingMistake/FrmAssemble.cs | 10 +++++----- PunchingMistake/Printer.cs | 13 ++++++++++--- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/PunchingMistake/FrmAssemble.cs b/PunchingMistake/FrmAssemble.cs index b0b9ca0..7050323 100644 --- a/PunchingMistake/FrmAssemble.cs +++ b/PunchingMistake/FrmAssemble.cs @@ -31,7 +31,7 @@ namespace PunchingMistake private string _partNo1 = string.Empty; private string _partNo2 = string.Empty; private string _carModelCode = string.Empty; - private string _barCodeFormate = string.Empty; + private string _barCodeFormat = string.Empty; /// /// 当前设备行数据ID /// @@ -58,10 +58,10 @@ namespace PunchingMistake private void FrmAssemble_Load(object sender, EventArgs e) { - _barCodeFormate = ConfigurationManager.AppSettings["BarCodeFormate"]; - if (string.IsNullOrEmpty(_barCodeFormate)) + _barCodeFormat = ConfigurationManager.AppSettings["BarCodeFormat"]; + if (string.IsNullOrEmpty(_barCodeFormat)) { - MessageBox.Show("配置文件中,条码格式[BarCodeFormate]不能为空."); + MessageBox.Show("配置文件中,条码格式[BarCodeFormat]不能为空."); return; } //stationId = ProScreenFunc.GetStationId(stationNo); @@ -487,7 +487,7 @@ namespace PunchingMistake // string serailNo = "00001"; string assembleBarCode = ""; - if(_barCodeFormate == "MI") + if(_barCodeFormat == "MI") { assembleBarCode = _uniqueBll.GetPunchSerialNoMI(partNo1, 5, ref serailNo); } diff --git a/PunchingMistake/Printer.cs b/PunchingMistake/Printer.cs index 5777c98..35ab37c 100644 --- a/PunchingMistake/Printer.cs +++ b/PunchingMistake/Printer.cs @@ -49,9 +49,16 @@ namespace PunchingMistake } static string GetPrintFileName() { - string templateName = ConfigurationManager.AppSettings["PrintTemplate"].ToString(); - - return System.AppDomain.CurrentDomain.BaseDirectory + $"Report\\{templateName}.grf"; + + string templateName = ConfigurationManager.AppSettings["BarCodeFormat"].ToString(); + if(templateName == "MI") + { + return System.AppDomain.CurrentDomain.BaseDirectory + $"Report\\总成条码MI.grf"; + } + else + { + return System.AppDomain.CurrentDomain.BaseDirectory + $"Report\\总成条码Hyundai.grf"; + } } } }