添加修改功能

This commit is contained in:
gongxh
2021-03-15 09:50:23 +08:00
parent 073bd82663
commit bd8fb8ca93
12 changed files with 277 additions and 41 deletions

View File

@@ -66,6 +66,17 @@ namespace NX.ERP.U8.Store
}
}
protected string UpdateUrl
{
get
{
return $"{BaseUrl}/Update";
}
}
protected string VoucherID
{
get
@@ -189,9 +200,111 @@ namespace NX.ERP.U8.Store
}
protected string UpdateRdVoucher(VoucherParameter para)
{
string VoucherId;
try
{
U8EnvContext u8EnvContext = new U8EnvContext();
u8EnvContext.U8Login = U8LoginContext.Instance.ClsLogin;
U8ApiAddress apiAddress = new U8ApiAddress(this.UpdateUrl);
U8ApiBroker u8ApiBroker = new U8ApiBroker(apiAddress, u8EnvContext);
u8ApiBroker.AssignNormalValue("sVouchType", para.VoucherType);
u8ApiBroker.AssignNormalValue("DomHead", para.DomHead);
u8ApiBroker.AssignNormalValue("domBody", para.DomBody);
if (para.DomPosition != null && para.DomPosition.selectNodes("//z:row").length != 0)
{
u8ApiBroker.AssignNormalValue("domPosition", para.DomPosition);
}
u8ApiBroker.AssignNormalValue("cnnFrom", null);
if (para.DOMMsg != null)
{
u8ApiBroker.AssignNormalValue("domMsg", para.DOMMsg);
}
else
{
u8ApiBroker.AssignNormalValue("domMsg", new DOMDocumentClass());
}
u8ApiBroker.AssignNormalValue("bCheck", para.IsCheck);
u8ApiBroker.AssignNormalValue("bBeforCheckStock", para.IsBeforCheckStock);
u8ApiBroker.AssignNormalValue("bIsRedVouch", para.IsRedVouch);
u8ApiBroker.AssignNormalValue("sAddedState", para.AddedState);
u8ApiBroker.AssignNormalValue("bUpdateNeedEas", true);
// u8ApiBroker.AssignNormalValue("bReMote", para.IsReMote);
if (!u8ApiBroker.Invoke())
{
Exception exception = u8ApiBroker.GetException();
if (exception != null)
{
if (exception is MomSysException)
{
MomSysException ex = exception as MomSysException;
}
else if (exception is MomBizException)
{
MomBizException ex2 = exception as MomBizException;
}
string exceptionString = u8ApiBroker.GetExceptionString();
if (exceptionString.Length != 0)
{
}
}
para.ReturnValue = false;
u8ApiBroker.Release();
}
para.ReturnValue = Convert.ToBoolean(u8ApiBroker.GetReturnValue());
para.DOMMsg = u8ApiBroker.GetResult("domMsg") as DOMDocument;
para.ErrMsg = u8ApiBroker.GetResult("errMsg") as string;
if (para.ReturnValue)
{
}
else
{
throw new Exception(para.ErrMsg);
}
u8ApiBroker.Release();
return "";
}
catch (Exception ex3)
{
throw ex3;
}
finally
{
}
}
protected string AddRdVoucher(VoucherParameter para)
{
string VoucherId;
try
{
U8EnvContext u8EnvContext = new U8EnvContext();
@@ -219,7 +332,8 @@ namespace NX.ERP.U8.Store
u8ApiBroker.AssignNormalValue("bBeforCheckStock", para.IsBeforCheckStock);
u8ApiBroker.AssignNormalValue("bIsRedVouch", para.IsRedVouch);
u8ApiBroker.AssignNormalValue("sAddedState", para.AddedState);
u8ApiBroker.AssignNormalValue("bReMote", para.IsReMote);
// u8ApiBroker.AssignNormalValue("bReMote", para.IsReMote);
if (!u8ApiBroker.Invoke())
{
Exception exception = u8ApiBroker.GetException();
@@ -276,6 +390,25 @@ namespace NX.ERP.U8.Store
protected VoucherParameter LoadVoucher(string where)
{
var rdVoucherParameter = new VoucherParameter
{
VoucherType = this.VoucherID,
IsGetBlank = false,
StrWhere = where
};
this.LoadRdVoucher(rdVoucherParameter);
return rdVoucherParameter;
}
private void LoadTemplate()
{
VoucherParameter rdVoucherParameter = null;