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#按钮插件调用存储过程
本文2024-09-16 17:12:13发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-14197.html