You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.7 KiB
C#

using BarTenderPrint.codeType;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
namespace BarTenderPrint
{
public class QRCodePrintEquip:PrintEquip
{
public override bool AddPara()
{
var para = base.ParaClass as barcodLable;
string SerialNum = para.SerialNum;
if (para != null)
{
try
{
if (base.EngineFormat.SubStrings.Count == 0)
{
return true;
}
base.EngineFormat.SubStrings["code0"].Value = SerialNum;
base.EngineFormat.SubStrings["code1"].Value = SerialNum;
return true;
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
return false;
}
}
else
{
return false;
}
}
private ICodeType DynamicClass(string codeType)
{
try
{
//根据类型,动态生成业务类
Assembly assembly = Assembly.GetExecutingAssembly(); // 获取当前程序集
string AssemName = "BarTenderPrint.codeType.codeType" + codeType;
Console.WriteLine("动态生成类:" + AssemName);
//var obj = assembly.CreateInstance(AssemName, true);
return (ICodeType)assembly.CreateInstance(AssemName); ;
}
catch (Exception ex)
{
return null;
}
}
}
}