其他入库修改

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

@@ -85,10 +85,35 @@ namespace NX.ERP.U8.Store
}
public bool UpdateVoucher(ProductStoreIn storeIn)
public string SaveVoucher(Model.Request.ProductStoreIn storeIn)
{
var voucherParameter = this.LoadVoucher($"id='{storeIn.Id}'");
if (voucherParameter.DomHead.selectSingleNode("//rs:data").childNodes.length == 0)
{
return this.AddVoucher(storeIn);
}
else
{
if (this.UpdateVoucher(storeIn, voucherParameter))
{
return storeIn.Id.ToString();
}
else
{
throw new Exception("保存错误");
}
}
}
public bool UpdateVoucher(ProductStoreIn storeIn, VoucherParameter voucherParameter=null)
{
if (voucherParameter == null)
{
voucherParameter = this.LoadVoucher($"id='{storeIn.Id}'");
}
DOMDocument domBody = voucherParameter.DomBody;
if (storeIn.Source == "生产订单")