change -修改模板路径

master
frankiecao 10 months ago committed by 启龙 曹
commit 0dd0458079

@ -14,6 +14,7 @@ namespace SlnMesnac.LabelPrint.BarTender
public class PrintManager
{
private LogHelper logHelper = LogHelper.Instance;
private string modelPath = "";
#region 单例实现
private static readonly Lazy<PrintManager> lazy = new Lazy<PrintManager>(() => 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);
}
/// <summary>
/// 标签打印
@ -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();

@ -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">
<!--<Window.Background>
<ImageBrush ImageSource="/templates/image/background.jpg" />
</Window.Background>-->
@ -23,7 +23,7 @@
</Border.Effect>
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Left" Orientation="Horizontal">
<Button Content="导入文件" Command="{Binding ImportFilesCommand}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#007DFA" BorderBrush="#007DFA" Margin="10,0,10,0"/>
<Button Content="手动执行" Command="{Binding ManualExecutionCommand}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#CC9900" BorderBrush="#CC9900" Margin="0,0,10,0"/>
<Button Content="手动执行" Command="{Binding ManualExecutionCommand}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#FF9900" BorderBrush="#FF9900" Margin="0,0,10,0"/>
<Button Content="开始打印" Command="{Binding StartPrintCommand}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#009900" BorderBrush="#009900" Margin="0,0,10,0"/>
<Button Content="停止打印" Command="{Binding StopPrintCommand}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#FF0033" BorderBrush="#FF0033" Margin="0,0,10,0"/>
</StackPanel>

@ -5,7 +5,7 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{B55D0578-0611-47D8-828B-81A3445C18A1}</ProjectGuid>
<OutputType>WinExe</OutputType>
<OutputType>Exe</OutputType>
<RootNamespace>SlnMesnac.LabelPrint</RootNamespace>
<AssemblyName>SlnMesnac.LabelPrint</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>

Loading…
Cancel
Save