物料审核之后抓取界面数据 插入中间表,写在那个方法里,不清楚,如下代码,为何在表单插件中注册,并保存,然后登陆客户端点击物料录入,新增 保存 提交审核 点击之后都不会提示信息,请问是代码问题还是操作问题,代码如下,请指导,万分感谢。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Kingdee.BOS.Core.Bill.PlugIn;//单据接口继承 类 AbstractBillPlugIn
//using Kingdee.BOS.Core.Metadata.EntityElement;
//using Kingdee.BOS.Orm.DataEntity;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;//BarItemClickEventArgs 参数事件 类库
//using Kingdee.BOS.Core.Bill.PlugIn.Args;//BarItemClickEventArgs 参数事件 类库
//using Kingdee.BOS.Core.DynamicForm.PlugIn.ControlModel;
//using Kingdee.BOS.Core.Metadata;
using System.Data;//DbType 类库
using Kingdee.BOS.Util;
//using Kingdee.BOS.Core.DynamicForm;
using Kingdee.BOS;
using Kingdee.K3.BD.ServiceHelper;
using Kingdee.BOS.Core.Bill;
using Kingdee.K3.BD;
//using Kingdee.BOS.Core.Metadata.ControlElement;
//using Kingdee.BOS.Cache;
namespace MaterilTestPlugIn
{
public class Class1 : AbstractBillPlugIn
{
//重写按钮点击事件
#region
public override void BarItemClick(BarItemClickEventArgs e)
{
base.BarItemClick(e);
switch (e.BarItemKey.ToUpperInvariant())
{
case "TBAPPROVE":
/* string number = "";
object material_num = this.View.Model.GetValue("FNUMBER") as object;
if (material_num != null)
{
number = Convert.ToString(material_num);
}
else
{
this.View.ShowErrMessage("编码为空","",MessageBoxType.Notice);
break;
}
string name="";
object material_name = this.View.Model.GetValue("FNAME") as object;
if (material_num != null)
{
name = Convert.ToString(material_name);
}
else
{
this.View.ShowErrMessage("名称为空", "", MessageBoxType.Notice);
break;
}
InsertDateToNewTable(number,name);
*/
this.View.ShowMessage("按钮点击成功。");
break;
default:
break;
}
}
public override void AfterBarItemClick(AfterBarItemClickEventArgs e)
{
base.AfterBarItemClick(e);
switch (e.BarItemKey.ToUpperInvariant())
{
case "TBAPPROVE":
this.View.ShowMessage("审核按钮点击之后成功。");
break;
default:
break;
}
}
public override void AfterButtonClick(AfterButtonClickEventArgs e)
{
base.AfterButtonClick(e);
this.View.ShowMessage("按钮点击之后成功。");
}
#endregion
public void InsertDateToNewTable(string num,string nam)
{
List
string sql = "insert into t_bd_goodsTypeHz (fnumber,fname) values(@num,@nam)";
list.Add( new SqlParam("num", DbType.String, num));
list.Add( new SqlParam("nam", DbType.String, nam));
// DBServiceHelper.Execute(this.View.Context, sql, list);
}
}
}
推荐阅读