增加引用VoucherCO_PU,Info_PU
1、加载到货单
//登录U8
U8Login.clsLogin m_ologin = new U8Login.clsLoginClass();
if (!m_ologin.Login("SA", "990", "2023", "demo", "DEMO", "2023-01-31", "127.0.0.1", ""))
{
strResult = "login failed ";
}
//初始化VoucherCO_PUVoucherCO_PU.clsVoucherCO_PUClass coPu = new VoucherCO_PU.clsVoucherCO_PUClass();
MSXML2.IXMLDOMDocument2 domHead = new MSXML2.DOMDocument();
MSXML2.IXMLDOMDocument2 domBody = new MSXML2.DOMDocument();
VoucherVerify.UseMode useMode = VoucherVerify.UseMode.CS;
Info_PU.ClsS_Infor clsInfo = new Info_PU.ClsS_Infor();
clsInfo.Init(ref m_ologin);
bool bPositive=true;
string sBillType = "";
conn.Open(m_ologin.UfDbName);
coPu.Init(VoucherCO_PU.vouchertype.采购到货单, ref m_ologin, ref conn, ref clsInfo, ref bPositive, ref sBillType, ref sBillType, ref useMode, sBillType, sBillType);
//加载到货单
string vouchid = "1000000002";
coPu.GetVoucherData(ref domHead, ref domBody, null, vouchid);
2、新增到货单
//新增到货单
object oMissing = Type.Missing;
string overstr="";
MSXML2.IXMLDOMDocument2 curDom = null;
MSXML2.IXMLDOMDocument2 domMsg = null;
strResult = coPu.VoucherSave(domHead, domBody,2,ref oMissing,ref curDom,useMode,ref overstr,ref domMsg);
if ((string.IsNullOrEmpty(strResult)) || (strResult == "True"))
{
strResult = "set success!";
string newID = (string)oMissing;
}
3、审核到货单
//审核到货单
strResult = coPu.ConfirmArr(domHead);
//弃审到货单
strResult = coPu.CancelconfirmArr(domHead);
if ((string.IsNullOrEmpty(strResult)) || (strResult == "true"))
{ strResult = "verify success!"; }
4、删除到货单
//删除到货单
strResult = coPu.Delete(domHead, domBody);
if ((string.IsNullOrEmpty(strResult)) || (strResult == "true"))
{ strResult = "delete success!"; }