diff --git a/SlnMesnac.LabelPrint.BarTender/PrintManager.cs b/SlnMesnac.LabelPrint.BarTender/PrintManager.cs index e8461c5..6abce43 100644 --- a/SlnMesnac.LabelPrint.BarTender/PrintManager.cs +++ b/SlnMesnac.LabelPrint.BarTender/PrintManager.cs @@ -14,6 +14,7 @@ namespace SlnMesnac.LabelPrint.BarTender public class PrintManager { private LogHelper logHelper = LogHelper.Instance; + private string modelPath = ""; #region 单例实现 private static readonly Lazy lazy = new Lazy(() => new PrintManager()); @@ -26,7 +27,11 @@ namespace SlnMesnac.LabelPrint.BarTender } #endregion - public PrintManager() { } + public PrintManager() + { + modelPath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory); + Console.WriteLine(modelPath); + } /// /// 标签打印 @@ -98,7 +103,7 @@ namespace SlnMesnac.LabelPrint.BarTender { bool result = false; PrintEquip equip = new GasLabelPrintEquip(); - equip.tempPath = "C:\\temp\\bartender打印模板\\Gas.btw"; + equip.tempPath = modelPath + "lableTemplate\\Gas.btw"; equip.ParaClass = labelInfo; equip.Open(); result = equip.print(); @@ -114,7 +119,7 @@ namespace SlnMesnac.LabelPrint.BarTender { bool result = false; PrintEquip equip = new TFLabelPrintEquip(); - equip.tempPath = "C:\\temp\\bartender打印模板\\TF.btw"; + equip.tempPath = modelPath + "lableTemplate\\TF.btw"; equip.ParaClass = labelInfo; equip.Open(); result = equip.print(); @@ -130,7 +135,7 @@ namespace SlnMesnac.LabelPrint.BarTender { bool result = false; PrintEquip equip = new DrumLabelPrintEquip(); - equip.tempPath = "C:\\temp\\bartender打印模板\\Drum.btw"; + equip.tempPath = modelPath + "lableTemplate\\Drum.btw"; equip.ParaClass = labelInfo; equip.Open(); result = equip.print(); @@ -143,7 +148,7 @@ namespace SlnMesnac.LabelPrint.BarTender { bool result = false; PrintEquip equip = new UnitLabelPrintEquip(); - equip.tempPath = "C:\\temp\\bartender打印模板\\Unit.btw"; + equip.tempPath = modelPath + "lableTemplate\\Unit.btw"; equip.ParaClass = labelInfo; equip.Open(); result = equip.print(); @@ -156,7 +161,7 @@ namespace SlnMesnac.LabelPrint.BarTender { bool result = false; PrintEquip equip = new PalletLabelPrintEquip(); - equip.tempPath = "C:\\temp\\bartender打印模板\\Pallet.btw"; + equip.tempPath = modelPath + "lableTemplate\\Pallet.btw"; equip.ParaClass = labelInfo; equip.Open(); result = equip.print(); diff --git a/SlnMesnac.LabelPrint/MainWindow.xaml b/SlnMesnac.LabelPrint/MainWindow.xaml index 505aae2..9c7de26 100644 --- a/SlnMesnac.LabelPrint/MainWindow.xaml +++ b/SlnMesnac.LabelPrint/MainWindow.xaml @@ -5,7 +5,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:SlnMesnac.LabelPrint" mc:Ignorable="d" - Title="RFID 打印系统" Height="650" Width="1000" ResizeMode="NoResize" Topmost="False" Icon="Icon.png"> + Title="标签打印系统" Height="650" Width="1000" ResizeMode="NoResize" Topmost="False" Icon="Icon.png"> @@ -23,7 +23,7 @@