插件中(表单插件)调用批号规则获取批号并填入单据中方法。

栏目:云星空知识作者:金蝶来源:金蝶云社区发布:2024-09-16浏览:1

插件中(表单插件)调用批号规则获取批号并填入单据中方法。

      /// <summary>

        /// 表单插件中调用批号规则获取批号方法,ctx上下文,view this.View,flotkey 批号字段标识,lotorm批号字段绑定实体属性 引用Kingdee.K3.SCM.ServiceHelper,Kingdee.BOS.Core

        /// </summary>

        /// <param name="ctx"></param>

        /// <param name="view"></param>

        /// <param name="flotkey"></param>

        /// <param name="lotorm"></param>

        public void GetFlotBill(Context ctx, IBillView view, string flotkey, string lotorm)

        {

            LotField lotField = view.Model.BusinessInfo.GetField(flotkey) as LotField;

            ExtendedDataEntitySet extendedDataEntitySet = new ExtendedDataEntitySet();

            extendedDataEntitySet.Parse(new Kingdee.BOS.Orm.DataEntity.DynamicObject[] { view.Model.DataObject }, view.Model.BusinessInfo);

            ExtendedDataEntity[] array = extendedDataEntitySet.FindByEntityKey(lotField.EntityKey);

            CodeAppResult codeAppResult = StockServiceHelper.GenerateLotMasterByCodeRule(ctx, view.Model.BillBusinessInfo, lotField, array);

            var flots = codeAppResult.CodeNumbers;

            Entity entity = view.Model.BusinessInfo.GetEntryEntity(lotField.EntityKey);

            for (int i = 0; i < flots.Count; i++)

            {

                if (!flots[i].Value.IsNullOrEmptyOrWhiteSpace())

                {

                    Kingdee.BOS.Orm.DataEntity.DynamicObject obj = view.Model.GetEntityDataObject(entity, i);

                    obj[lotorm + "_Text"] = flots[i].Value[0];

                }

            }

            view.UpdateView(lotField.EntityKey);

        }



view this.View,flotkey 批号字段标识   这个是什么啊,, 我要传入什么参数

插件中(表单插件)调用批号规则获取批号并填入单据中方法。

/// <summary> /// 表单插件中调用批号规则获取批号方法,ctx上下文,view this.View,flotkey 批号字段标识,lotor...
点击下载文档
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息