|
@@ -35,6 +35,7 @@ namespace PTMedicalInsurance.Common
|
|
|
class CardReader
|
|
|
{
|
|
|
const string DllPath = @"HeaSecReadInfo.dll";
|
|
|
+ private static bool initilaized = false;
|
|
|
|
|
|
[DllImport(DllPath, EntryPoint = "Init", CharSet = CharSet.Ansi, ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
|
|
|
static extern int Init(StringBuilder pInitInfo, StringBuilder pErrMsg);
|
|
@@ -48,13 +49,18 @@ namespace PTMedicalInsurance.Common
|
|
|
[DllImport(DllPath, EntryPoint = "DailySinIn", CharSet = CharSet.Ansi, ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
|
|
|
static extern IntPtr DailySinIn(StringBuilder OutData);
|
|
|
|
|
|
+ //电子凭证
|
|
|
+ [DllImport("HeaSecReadInfo.dll", EntryPoint = "EcQuery", CharSet = CharSet.Ansi, ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
|
|
|
+ public static extern int NationEcTrans(StringBuilder InData, StringBuilder OutData);
|
|
|
+
|
|
|
public CardReader()
|
|
|
{
|
|
|
-
|
|
|
+ CardReader.Init();
|
|
|
}
|
|
|
|
|
|
- public int Init()
|
|
|
+ public static int Init()
|
|
|
{
|
|
|
+ if (initilaized) return 0;
|
|
|
string errMsg = "";
|
|
|
int result = -1;
|
|
|
try
|
|
@@ -65,6 +71,7 @@ namespace PTMedicalInsurance.Common
|
|
|
StringBuilder sbUSER = new StringBuilder(4096);
|
|
|
sbInitInfo.Append(JsonHelper.toJsonString(initInfo));
|
|
|
result = Init(sbInitInfo, sbUSER);
|
|
|
+ initilaized = true;
|
|
|
return result;
|
|
|
}
|
|
|
catch (Exception ex)
|