Epicor BPM中调用BO


C# 全选
// 没有要更新的行项目
if(String.IsNullOrEmpty(callContextBpmData.Character01)) return;
List<int> updatePackLines = new List<int>();
try
{
    updatePackLines = callContextBpmData.Character01.Split(",").Select(x=>int.Parse(x)).ToList();
    if(updatePackLines.Count==0) return;
}
catch(Exception ex) {
    throw new Ice.Common.BusinessObjectException(new Ice.Common.BusinessObjectMessage("更新供应商价格出错,无法解析出需要更新价格的行项目:"+ callContextBpmData.Character01){
        Type=Ice.Common.BusinessObjectMessageType.Error
    });
}

var tmpDs = ds;
using(var bo = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.ReceiptSvcContract>(this.Db)) {
    foreach(var packLine in updatePackLines) {
        var o = tmpDs.RcvDtl.Where(w=>w.PackLine == packLine).First();
        
        var s_headrow = tmpDs.RcvHead[0];

        tmpDs = new ReceiptTableset();

        var headRow = tmpDs.RcvHead.NewRow();
        BufferCopy.Copy(s_headrow,headRow);
        tmpDs.RcvHead.Add(headRow);
        
        var sourceRow =  tmpDs.RcvDtl.NewRow();
        var updateRow =  tmpDs.RcvDtl.NewRow();

        BufferCopy.Copy(o,sourceRow);
        BufferCopy.Copy(o,updateRow);

        tmpDs.RcvDtl.Add(sourceRow);
        tmpDs.RcvDtl.Add(updateRow);
        
        updateRow.RowMod = "U";

        try
        {
                // ref ReceiptTableset ds, int vendorNum, string purPoint, string packSlip, int packLine, decimal suppPrice, out string warningMsg
                string warningMsg;
                bo.CheckSupplierPrice(ref tmpDs,o.VendorNum,o.PurPoint,o.PackSlip,o.PackLine,0,out warningMsg);
                updateRow["DocScrVendorUnitCost"] = 0m;
                //  int vendorNum, string purPoint, string packSlip, int packLine
                bo.OnChangeDtlSupplierPrice(ref tmpDs,o.VendorNum,o.PurPoint,o.PackSlip,o.PackLine);

                bool RunChkLCAmtBeforeUpdate = true;
                bool RunChkHdrBeforeUpdate = true; 
                int ipVendorNum = o.VendorNum;
                string ipPurPoint= o.PurPoint;
                string ipPackSlip = o.PackSlip;
                int ipPackLine = 0;

                bool lRunPreUpdate = true;
                bool lRunCreatePartLot=false;
                string partNum="";
                string lotNum="";
                bool lOkToUpdate= true;
                bool lRunChkDtl= true; 
                bool lRunCheckCompliance = false;  
                bool lRunChkDtlCompliance= true;
                /*
                bool RunChkLCAmtBeforeUpdate, bool RunChkHdrBeforeUpdate, int ipVendorNum, string ipPurPoint, string ipPackSlip, 
                int ipPackLine, out string cLCAmtMessage, out string opUpliftWarnMsg, out string opReceiptWarnMsg, out string opArriveWarnMsg, 
                bool lRunChkDtl, out string qMessageStr, out string sMessageStr, out string lcMessageStr, out string pcMessageStr, 
                bool lRunChkDtlCompliance, out string qDtlComplianceMsgStr, bool lRunCheckCompliance, out bool lCompliant, bool lRunPreUpdate, 
                out bool lRequiresUserInput, bool lRunCreatePartLot, string partNum, string lotNum, bool lOkToUpdate, 
                out bool lUpdateWasRun, out string wrnLines, ref ReceiptTableset ds
                */
                // out参数
                string cLCAmtMessage, opUpliftWarnMsg, opReceiptWarnMsg, opArriveWarnMsg;
                
                string qMessageStr,sMessageStr, lcMessageStr, pcMessageStr;
                
                string qDtlComplianceMsgStr; 
                
                bool lCompliant,lRequiresUserInput;
                bool lUpdateWasRun;
                string wrnLines;

                // 保存
                bo.UpdateMaster(RunChkLCAmtBeforeUpdate,RunChkHdrBeforeUpdate,ipVendorNum,ipPurPoint,ipPackSlip
                    ,ipPackLine,out cLCAmtMessage, out opUpliftWarnMsg, out opReceiptWarnMsg, out opArriveWarnMsg
                    ,lRunChkDtl, out qMessageStr, out sMessageStr, out lcMessageStr, out pcMessageStr
                    ,lRunChkDtlCompliance, out qDtlComplianceMsgStr,lRunCheckCompliance, out lCompliant, lRunPreUpdate
                    , out lRequiresUserInput, lRunCreatePartLot, partNum, lotNum, lOkToUpdate
                    , out lUpdateWasRun, out wrnLines,ref tmpDs);
                
                // 刷新返回的数据,避免界面显示不一致
                var _dsRow =  ds.RcvDtl.Where(w=>w.PackLine == packLine).First();
                var _newRow =  tmpDs.RcvDtl.Where(w=>w.PackLine == packLine).First();
                BufferCopy.Copy(_newRow,_dsRow);
                
        }
        catch(Exception ex) {
            throw new Ice.Common.BusinessObjectException(new Ice.Common.BusinessObjectMessage("异常:"+ex.Message){
                    Type=Ice.Common.BusinessObjectMessageType.Error
                });
        }
        
    }
}
版权声明:本文为YES开发框架网发布内容,转载请附上原文出处连接
张国生
上一篇:Epicor BPM对结果进行排序
下一篇:密码过期问题跟踪
评论列表

发表评论

评论内容
昵称:
关联文章

Epicor BPM调用BO
EpicorBPM调用自定义函数
Epicor BPM自定义代码弹出错误提醒
Epicor BPM对结果进行排序
Epicor访问调用Function库
BPM数据库存放位置
Epicor自建表在Function,BPM,BAQ的使用
函数调用BO保留原有的行,新增更新行U
epicor自定义函数调用API接口
Epicor BPM 解析字符串得到List对象并转换为json字符串
Epicor Function保存表数据
关于Epicor函数Db
关于Epicor函数Db
Epicor图层代码数据库保存位置
.NET大型项目开发必备(9)--http请求调用(Post与Get)
Epicor客户端安装
Electron调用C#类库dll
Epicor安装步骤
Epicor解决方案 项目类型说明
Epicor页面根据不同权限显示不同的表格列

联系我们
联系电话:15090125178(微信同号)
电子邮箱:garson_zhang@163.com
站长微信二维码
微信二维码