C#按钮插件调用存储过程

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

C#按钮插件调用存储过程

using Kingdee.BOS;

using Kingdee.BOS.App.Data;

using Kingdee.BOS.Core.DynamicForm;

using Kingdee.BOS.Core.DynamicForm.PlugIn;

using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;

using Kingdee.BOS.Orm.DataEntity;

using Kingdee.BOS.Util;

using System;

using System.Collections.Generic;

using System.ComponentModel;


namespace Kingdee.K3Cloud.Test.Plugin

{

    /// <summary>

    /// 

    /// </summary>

    [HotUpdate]

    [Description("调用存储过程")]

    public class BillPlugInvokeStoreProcedure : AbstractOperationServicePlugIn

    {

        public override void AfterExecuteOperationTransaction(AfterExecuteOperationTransaction e)

        {

            DynamicObject[] dynamicObjects = e.DataEntitys;

            string billNo = String.Empty;

            long bilId = 0;


            //获取单据号,内码

            foreach (dynamic dynamicObject in dynamicObjects)

            {

                bilId = dynamicObject["Id"];

                billNo = dynamicObject["BillNo"].ToString();

            }


            //储存过程名

            var procedureName = "P_Sub_OrderToOA";


            //储存过程参数

            var sqlParameterList = new List<SqlParam>();

            sqlParameterList.Add(new SqlParam("@FBillNo", KDDbType.AnsiString, billNo));

            DBUtils.ExecuteStoreProcedure(this.Context, procedureName, sqlParameterList);

            

            //操作结果消息

            OperateResult operateResult = new OperateResult();

            operateResult.Message += string.Format("单据的单据号【{0}】,内码【{1}】。", billNo, bilId);

            this.OperationResult.OperateResult.Add(operateResult);

        }

    }

}


C#按钮插件调用存储过程

using Kingdee.BOS;using Kingdee.BOS.App.Data;using Kingdee.BOS.Core.DynamicForm;using Kingdee.BOS.Core.DynamicForm.PlugIn;usin...
点击下载文档
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息