其他入库修改

This commit is contained in:
gongxh
2021-03-15 16:32:40 +08:00
parent 67d0581674
commit d20c4451c5
6 changed files with 94 additions and 16 deletions

View File

@@ -95,11 +95,36 @@ namespace NX.ERP.U8.Store
}
public bool UpdateVocher(Model.Request.OtherStoreInOut storeIn)
public string SaveVoucher(Model.Request.OtherStoreInOut storeIn)
{
var voucherParameter = this.LoadVoucher($"id='{storeIn.Id}'");
if (voucherParameter.DomHead.selectSingleNode("//rs:data").childNodes.length == 0)
{
return this.AddVocher(storeIn);
}
else
{
if (this.UpdateVocher(storeIn, voucherParameter))
{
return storeIn.Id.ToString();
}
else
{
throw new Exception("保存错误");
}
}
}
public bool UpdateVocher(Model.Request.OtherStoreInOut storeIn, VoucherParameter voucherParameter = null)
{
var voucherParameter = base.LoadVoucher($" id={storeIn.Id}");
if (voucherParameter == null)
{
voucherParameter = base.LoadVoucher($" id={storeIn.Id}");
}
DOMDocument domBody = voucherParameter.DomBody;
for (var n = 0; n < storeIn.details.Count(); n++)
{