diff --git a/NX.ERP.U8/Store/STVoucherBase.cs b/NX.ERP.U8/Store/STVoucherBase.cs
index bc0b218..b20aa11 100644
--- a/NX.ERP.U8/Store/STVoucherBase.cs
+++ b/NX.ERP.U8/Store/STVoucherBase.cs
@@ -110,26 +110,92 @@ namespace NX.ERP.U8.Store
}
}
+
+ private static object lockHeadobj = new object();
+ private static string strTemlateHead = "";
+
+ ///
+ ///
+ ///
+ ///
private string GetHeadTemplate()
{
- var strTemlate = FileHelp.ReadFile(HeadFile);
- if (strTemlate == string.Empty)
+
+ if (!string.IsNullOrEmpty(strTemlateHead))
{
- this.LoadTemplate();
- strTemlate = GetHeadTemplate();
+ return strTemlateHead;
}
- return strTemlate;
+ else
+ {
+ lock (lockHeadobj)
+ {
+
+ if (!string.IsNullOrEmpty(strTemlateHead))
+ {
+ return strTemlateHead;
+ }
+ else
+ {
+ strTemlateHead = FileHelp.ReadFile(HeadFile);
+ if (string.IsNullOrEmpty(strTemlateHead))
+ {
+ this.LoadTemplate();
+ strTemlateHead = GetHeadTemplate();
+ }
+ return strTemlateHead;
+
+ }
+
+
+ }
+
+
+ }
+
+
}
+
+
+ private static object lockBodyobj = new object();
+ private static string strTemlateBody = "";
+ ///
+ ///
+ ///
+ ///
private string GetBodyTemplate()
{
- var strTemlate = FileHelp.ReadFile(BodyFile);
- if (strTemlate == string.Empty)
+
+ if (!string.IsNullOrEmpty(strTemlateBody))
{
- this.LoadTemplate();
- strTemlate = GetBodyTemplate();
+ return strTemlateBody;
+ }
+ else
+ {
+ lock (lockBodyobj)
+ {
+
+ if (!string.IsNullOrEmpty(strTemlateBody))
+ {
+ return strTemlateHead;
+ }
+ else
+ {
+ strTemlateBody = FileHelp.ReadFile(BodyFile);
+ if (string.IsNullOrEmpty(strTemlateBody))
+ {
+ this.LoadTemplate();
+ strTemlateBody = GetHeadTemplate();
+ }
+ return strTemlateBody;
+
+ }
+
+
+ }
+
+
}
- return strTemlate;
}
@@ -306,14 +372,15 @@ namespace NX.ERP.U8.Store
{
u8ApiBroker.AssignNormalValue("domPosition", para.DomPosition);
}
- if (para.cnnFrom!=null)
+ if (para.cnnFrom != null)
{
u8ApiBroker.AssignNormalValue("cnnFrom", para.cnnFrom);
- } else
- {
- u8ApiBroker.AssignNormalValue("cnnFrom",null);
}
-
+ else
+ {
+ u8ApiBroker.AssignNormalValue("cnnFrom", null);
+ }
+
if (para.DOMMsg != null)
{
u8ApiBroker.AssignNormalValue("domMsg", para.DOMMsg);