修改模板路径

This commit is contained in:
admin
2021-01-21 13:51:38 +08:00
parent 9f9e429205
commit f84e9f2e5e
2 changed files with 23 additions and 7 deletions

View File

@@ -15,11 +15,29 @@ namespace NX.ERP.U8.Store
private string BaseUrl;
private static string BasePath;
private const string FLODER_NAME = "xml";
static VoucherBase()
{
BasePath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, FLODER_NAME);
if (!Directory.Exists(BasePath))
{
Directory.CreateDirectory(BasePath);
}
}
private string BodyFile
{
get
{
return $"{AppDomain.CurrentDomain.BaseDirectory}\\XMLDOM\\XMLDomBody{this.voucherID}.xml";
return System.IO.Path.Combine(BasePath, $"XMLDomBody{this.voucherID}.xml");
}
}
@@ -28,7 +46,8 @@ namespace NX.ERP.U8.Store
get
{
return $"{AppDomain.CurrentDomain.BaseDirectory}\\XMLDOM\\XMLDomHead{this.voucherID}.xml";
return System.IO.Path.Combine(BasePath, $"XMLDomHead{this.voucherID}.xml");
}
}
protected string LoadUrl
@@ -257,16 +276,12 @@ namespace NX.ERP.U8.Store
private void LoadTemplate()
{
VoucherParameter rdVoucherParameter = null;
try
{
if (!Directory.Exists(AppDomain.CurrentDomain.BaseDirectory + "XMLDOM"))
{
Directory.CreateDirectory(AppDomain.CurrentDomain.BaseDirectory + "XMLDOM");
}
rdVoucherParameter = new VoucherParameter
{
VoucherType = this.VoucherID,