我跟根据林荫大道cc大神的代码练习的,不知道咋就在这一步卡住了,(红色标注)大神们,帮忙看看是什么情况看?
以下是林荫大道cc大神的源代码:
using System; using System.Collections.Generic;
using System.Linq; using System.Text;
using Kingdee.BOS.Core.DynamicForm.PlugIn;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using Kingdee.BOS.Orm.DataEntity;
using Kingdee.BOS.App.Data; using System.ComponentModel;
using Kingdee.BOS.Core.DynamicForm;
using System.Data;
namespace Kingdee.Bos.Update.List.Plugln {
[Description("批改更新值")]
[Kingdee.BOS.Util.HotUpdate]
//继承动态表单
public class UpdateDataFace:AbstractDynamicFormPlugIn
{
//定义几个字段 object FID;
object FType;
string sql;
DataSet ds = new DataSet();
DataTable dt = new DataTable();
//销售出库单加载时参数FID传进来
public override void OnLoad(EventArgs e)
{
base.OnLoad(e);
//接收FID的值
FID = this.View.OpenParameter.GetCustomParameter("FID");
//把FID加到上一节添加的字段上面
this.View.Model.SetValue("FID", FID.ToString());
}
//加载后,点击批改按钮,更新值
public override void BarItemClick(BarItemClickEventArgs e)
{
base.BarItemClick(e);
IOperationResult opResult = new OperationResult();
//当点击批改按钮
if (e.BarItemKey == "YDIE_tbBatchUpdate")
{
//定义数组
string[] strFID;
//通过逗号分隔拆分数组
strFID = this.View.Model.GetValue("FID").ToString().Trim().Split(','); for (int i = 0; i < strFID.Length; i++)
{
//更新销售出库单,单据头表T_SAL_OUTSTOCK,物料属性F_YDIE_WLSX字段
//获取物料属性批量修改里面的 F_YDIE_WLSX值
//返回 sql = "/*dialect*/update T_SAL_OUTSTOCK set F_YDIE_WLSX = '" + this.Model.DataObject["F_YDIE_WLSX"].ToString() + "' where FID=" + strFID[i] + ";select FBILLNO from T_SAL_OUTSTOCK where FID=" + strFID[i];
//执行sql
ds = DBUtils.ExecuteDataSet(this.Context, sql);
dt = ds.Tables[0];
if (dt.Rows.Count > 0)
{
opResult.OperateResult.Add(new OperateResult()
{
Name = "更新" + dt.Rows[0]["FBILLNO"].ToString(),
Message = "更新成功!",
MessageType = MessageType.Normal,
SuccessStatus = true
});
}
//仿物料列表,弹窗
this.View.ShowOperateResult(opResult.OperateResult); } } } } }
作者:林荫大道cc
来源:金蝶云社区
原文链接:https://vip.kingdee.com/article/68308462308118272
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
推荐阅读