添加采购入库单接口
统一
This commit is contained in:
@@ -10,6 +10,23 @@ namespace NX.ERP.U8.Store
|
||||
{
|
||||
private string voucherID;
|
||||
|
||||
private string Url;
|
||||
|
||||
public string LoadUrl
|
||||
{
|
||||
get
|
||||
{
|
||||
return $"{Url}/Load";
|
||||
}
|
||||
}
|
||||
|
||||
public string AddUrl
|
||||
{
|
||||
get
|
||||
{
|
||||
return $"{Url}/Add";
|
||||
}
|
||||
}
|
||||
|
||||
protected string VoucherID
|
||||
{
|
||||
@@ -18,14 +35,15 @@ namespace NX.ERP.U8.Store
|
||||
return this.voucherID;
|
||||
}
|
||||
}
|
||||
public VoucherBase(string voucherID)
|
||||
public VoucherBase(string voucherID, string Url)
|
||||
{
|
||||
this.voucherID = voucherID;
|
||||
this.Url = Url;
|
||||
}
|
||||
|
||||
protected string HeadTemplate
|
||||
{
|
||||
get
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.GetHeadTemplate();
|
||||
}
|
||||
@@ -42,7 +60,7 @@ namespace NX.ERP.U8.Store
|
||||
|
||||
private string GetHeadTemplate()
|
||||
{
|
||||
var strTemlate = FileHelp.ReadFile(AppDomain.CurrentDomain.BaseDirectory + $"XMLDOM\\XMLDomHead{this.voucherID}.xml");
|
||||
var strTemlate = FileHelp.ReadFile(AppDomain.CurrentDomain.RelativeSearchPath + $"XMLDOM\\XMLDomHead{this.voucherID}.xml");
|
||||
if (strTemlate == string.Empty)
|
||||
{
|
||||
this.LoadTemplate();
|
||||
@@ -53,7 +71,7 @@ namespace NX.ERP.U8.Store
|
||||
|
||||
private string GetBodyTemplate()
|
||||
{
|
||||
var strTemlate = FileHelp.ReadFile(AppDomain.CurrentDomain.BaseDirectory + $"XMLDOM\\XMLDomBody{this.voucherID}.xml");
|
||||
var strTemlate = FileHelp.ReadFile(AppDomain.CurrentDomain.RelativeSearchPath + $"XMLDOM\\XMLDomBody{this.voucherID}.xml");
|
||||
if (strTemlate == string.Empty)
|
||||
{
|
||||
this.LoadTemplate();
|
||||
@@ -68,18 +86,18 @@ namespace NX.ERP.U8.Store
|
||||
VoucherParameter rdVoucherParameter = null;
|
||||
try
|
||||
{
|
||||
if (!Directory.Exists(AppDomain.CurrentDomain.BaseDirectory + "XMLDOM"))
|
||||
if (!Directory.Exists(AppDomain.CurrentDomain.RelativeSearchPath + "XMLDOM"))
|
||||
{
|
||||
Directory.CreateDirectory(AppDomain.CurrentDomain.BaseDirectory + "XMLDOM");
|
||||
Directory.CreateDirectory(AppDomain.CurrentDomain.RelativeSearchPath + "XMLDOM");
|
||||
}
|
||||
rdVoucherParameter = new VoucherParameter();
|
||||
rdVoucherParameter.VoucherType =this.VoucherID;
|
||||
rdVoucherParameter.VoucherType = this.VoucherID;
|
||||
rdVoucherParameter.IsGetBlank = true;
|
||||
U8LoginContext.Instance.LoadRdVoucher(rdVoucherParameter);
|
||||
U8LoginContext.Instance.LoadRdVoucher(this.LoadUrl, rdVoucherParameter);
|
||||
if (rdVoucherParameter.ReturnValue)
|
||||
{
|
||||
FileHelp.WriteFile(rdVoucherParameter.DomHead.xml, AppDomain.CurrentDomain.BaseDirectory + $"XMLDOM\\XMLDomHead{this.voucherID}.xml");
|
||||
FileHelp.WriteFile(rdVoucherParameter.DomBody.xml, AppDomain.CurrentDomain.BaseDirectory + $"XMLDOM\\XMLDomBody{this.voucherID}.xml");
|
||||
FileHelp.WriteFile(rdVoucherParameter.DomHead.xml, AppDomain.CurrentDomain.RelativeSearchPath + $"XMLDOM\\XMLDomHead{this.voucherID}.xml");
|
||||
FileHelp.WriteFile(rdVoucherParameter.DomBody.xml, AppDomain.CurrentDomain.RelativeSearchPath + $"XMLDOM\\XMLDomBody{this.voucherID}.xml");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user