服务插件中实现触发相关单据实体服务规则
关键以下三句: /* //IDynamicFormViewService dynamicFormView = view as IDynamicFormViewService; IBillViewService dynamicFormView = view as IBillViewService; dynamicFormView.UpdateValue(FFieldId, iRow, dto.TAXPRICE); */ public static void UpdateAmt(Context context, string formId, string fId, string ormEntry, HashSet<SelfDto> hashEntry) { try { IOperationResult operationLocalResult = null; try { if (formId.IsNullOrEmptyOrWhiteSpace() || fId.IsNullOrEmptyOrWhiteSpace() || ormEntry.IsNullOrEmptyOrWhiteSpace() || hashEntry.IsEmpty() ) return; IBillView view = Utils.CreateView(context, null, formId); DynamicObject billObejct = Utils.LoadBillObjects(context, formId, fId); view.Model.DataObject = billObejct; DynamicObjectCollection entryCollect = billObejct[ormEntry] as DynamicObjectCollection; if (entryCollect.IsEmpty()) return; //IDynamicFormViewService dynamicFormView = view as IDynamicFormViewService; IBillViewService dynamicFormView = view as IBillViewService; //处理 表头 变更价 赋值为 1:变更,0:未变更 dynamicFormView.UpdateValue(string.Format("{0}_H",hashEntry.First().OrmISCHANGE), 0, hashEntry.First().ISCHANGE); //处理 表体 变更价及含税单价等 for (int iRow = 0, ilen = entryCollect.Count; iRow < ilen; iRow++) { foreach (SelfDto dto in hashEntry) { if (entryCollect[iRow].GetPrimaryKeyValue<long>() == dto.EntryId) { //含税单价:标准字段 标识,字段名,绑定实体属性 此三者名称不相同 string FFieldId; if (string.IsNullOrEmpty(dto.FTAXPRICE2)) FFieldId = string.Format(@"F{0}", dto.OrmTAXPRICE); else FFieldId = dto.FTAXPRICE2; dynamicFormView.UpdateValue(FFieldId, iRow, dto.TAXPRICE); dynamicFormView.UpdateValue(dto.OrmISCHANGE, iRow, dto.ISCHANGE); } } } operationLocalResult = ServiceHelper.GetService<ISaveService>().Save(context, view.BusinessInfo, new DynamicObject[] { view.Model.DataObject }); } catch (Exception ex) { if (operationLocalResult != null) { bool bRet = operationLocalResult.IsSuccess; string strRet = operationLocalResult.ValidationErrors.Count > 0 ? operationLocalResult.ValidationErrors.FirstOrDefault().Message : String.Empty; Kingdee.BOS.Log.Logger.Info("采购订单变更单审核操作", string.Format(@"catch IsSuccess:{0},产生异常信息:{1},ex:{2}", bRet, strRet, ex.StackTrace.ToString())); } else Kingdee.BOS.Log.Logger.Info("采购订单变更单审核操作", string.Format(@"catch 产生异常信息:ex:{0}", ex.StackTrace.ToString())); } finally { if (operationLocalResult != null) { bool bRet = operationLocalResult.IsSuccess; string strRet = operationLocalResult.ValidationErrors.Count > 0 ? operationLocalResult.ValidationErrors.FirstOrDefault().Message : String.Empty; Kingdee.BOS.Log.Logger.Info("采购订单变更单审核操作", string.Format(@"finally IsSuccess:{0},产生异常信息:{1}", bRet, strRet)); } } } catch (Exception ex) { //throw ex; } }
服务插件中实现触发相关单据实体服务规则
关键以下三句:/* //IDynamicFormViewService dynamicFormView = view as IDynamicFormViewService; IBillViewService dynamicFormView = v...
点击下载文档
上一篇:用户权限分配下一篇:用本机代码调用各个K3Cloud环境的数据库
本文2024-09-16 18:39:13发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-23535.html
您需要登录后才可以发表评论, 登录登录 或者 注册
最新文档
热门文章