金蝶云需求:
1、物料新增时,通过快捷方式自动获取老系统K3Wise中对应物料的相关信息;
2、具体相关对应物料字段项信息,由存储过程:exec pro_lyh_get_oldsystemwlxx '002'来查询结果;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Data;
using Kingdee.BOS.Util;
using Kingdee.BOS.App.Data;
using Kingdee.BOS.Core.Bill.PlugIn;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
namespace Lyh.Kingdee.Bos.develop.Plugin
{
[Description("从旧系统中获取物料信息"),HotUpdate]
public class GetWLFromOldsys:AbstractBillPlugIn
{
public override void BarItemClick(BarItemClickEventArgs e)
{
base.BarItemClick(e);
if(e.BarItemKey.Equals("QUYL_tbGetWlXX"))
{
string fnumber;
try
{
fnumber = this.View.Model.GetValue("FOLDNUMBER").ToString();
}
catch
{
this.View.ShowMessage("旧物料编码不能空,请输入“旧物料编码”信息项!");
return;
}
if (fnumber != null)
{
string sql = string.Concat("exec pro_lyh_get_oldsystemwlxx '",fnumber, "'");
DataSet dataSet = DBUtils.ExecuteDataSet(base.Context,sql);
DataTable dataTable = dataSet.Tables[0];
//this.View.ShowMessage(sql);
if (dataTable.Rows.Count > 0)
{
foreach (object obj in dataTable.Rows)
{
DataRow dr = (DataRow)obj;
this.View.Model.SetValue("FNUMBER", dr["FNumber"].ToString());
this.View.Model.SetValue("FName", dr["FName"].ToString());
this.View.Model.SetValue("FSPECIFICATION", dr["FModel"].ToString());
this.View.Model.SetValue("FDESCRIPTION", dr["Fbzxx"].ToString());
}
}
}
}
}
}
}
标签:物料,插件,System,表单,ToString,using,dr,View From: https://www.cnblogs.com/lyh1719/p/17929474.html