客户对账单二开添加字段
客户对账单二开添加字段,继承原来客户对账单表单插件Statement基类
public class khdzdBillPlugin:Statement { string customerName = ""; //过滤条件往来单位 string newtempTable = ""; //新的临时表 bool NewSearch = false; //是否是新查询的数 public override void BarItemClick(BarItemClickEventArgs e) { if (e.BarItemKey == "tbFilter") { this.customerName = ""; NewSearch = true; } if (e.BarItemKey == "tbRefresh") { NewSearch = true; } base.BarItemClick(e); } public override void DataChanged(DataChangedEventArgs e) { if (e.Field.Key == "FCombo") { NewSearch = false; } base.DataChanged(e); } protected override void Refresh() { if (this.filterPara == null) { return; } string oldSelectedValue = Convert.ToString(this.View.Model.GetValue("FCombo")); if (Convert.ToBoolean(this.filterPara.CustomFilter["FByContact"])) { customerName = this.GetCustomerData(oldSelectedValue); } dropTempTable(); base.Refresh(); } public override void BeforeClosed(BeforeClosedEventArgs e) { dropTempTable(); base.BeforeClosed(e); } /// 将标准的对账单生成的临时表数据复制到带有扩展字段的临时表里面去 public void CopyDataToNewTempTable() { var custmoFilter = this.filterPara.CustomFilter; DynamicObjectCollection jszh = custmoFilter["F_UGWH_Assistant_83g"] as DynamicObjectCollection; string where = ""; if (!jszh.IsNullOrEmptyOrWhiteSpace()) { foreach (var item in jszh) { string FDATAVALUE = TypeUtil.GetDynamicObjectNdata(item["F_UGWH_Assistant_83g"], "FDataValue"); where += "'" + FDATAVALUE + "',"; } if (!where.IsNullOrEmptyOrWhiteSpace()) { where = "where FPRESETTEXT1 in (" + where.Substring(0, where.Length - 1) + ") "; } } this.newtempTable = GetTempTable(); string sql = string.Format(@"/*dialect*/ select * into {1} from ( select 'FPRESETTEXT1'=iif(t2.FPRESETTEXT1 is null ,'',t2.FPRESETTEXT1)+iif(t3.FPRESETTEXT1 is null ,'',t3.FPRESETTEXT1)+iif(t4.FPRESETTEXT1 is null ,'',t4.FPRESETTEXT1), t1.* from {0} t1 left join t_AR_receivable t2 on t1.FID=t2.FID and t1.FFORMID='AR_receivable' left join T_AR_RECEIVEBILL t3 on t1.FID=t3.FID and t1.FFORMID='AR_RECEIVEBILL' left join T_AR_REFUNDBILL t4 on t1.FID=t4.FID and t1.FFORMID='AR_REFUNDBILL' ) tab {2}", this.tempTable, this.newtempTable,where); DBUtils.Execute(this.Context, sql); } /// 获取新的带有扩展字段的数据 public DataTable GetNewData() { CopyDataToNewTempTable(); DataTable dataByContactUnit = StatementServiceHelper.GetDataByContactUnit(base.Context, this.newtempTable, customerName); return dataByContactUnit; } /// 获取新的带扩展字段的汇总数据 public DataTable GetNewSumDate() { DataTable sumDataByContactUnit = StatementServiceHelper.GetSumDataByContactUnit(base.Context, this.newtempTable, this.agingKeys.Keys.ToList(), customerName); return sumDataByContactUnit; } public override void SetListData(DataTable data) { if (NewSearch) { DataTable dt = GetNewData(); string oldTempTable = this.tempTable; this.tempTable = this.newtempTable; this.newtempTable = oldTempTable; base.SetListData(dt); } else { base.SetListData(data); } } public override void SetListSumData(DataTable data) { if (NewSearch) { DataTable dt = GetNewSumDate(); base.SetListSumData(dt); } else { base.SetListSumData(data); } } /// 删除临时表 private void dropTempTable() { if (!string.IsNullOrWhiteSpace(this.newtempTable)) { IDBService dbservice = Kingdee.BOS.App.ServiceHelper.GetService<IDBService>(); dbservice.DeleteTemporaryTableName(this.Context, new string[] { this.newtempTable }); this.newtempTable = ""; } } /// 获取临时表名称 private string GetTempTable() { IDBService dbservice = Kingdee.BOS.App.ServiceHelper.GetService<IDBService>(); string[] temptables = dbservice.CreateTemporaryTableName(this.Context, 1); return temptables[0]; } }
2、客户对账单注册插件,停用继承的插件
string FDATAVALUE = TypeUtil.GetDynamicObjectNdata(item["F_UGWH_Assistant_83g"], "FDataValue")
--TypeUtil.GetDynamicObjectNdata 这个是封装了什么方法嘛,提示这个错误
客户对账单二开添加字段
客户对账单二开添加字段,继承原来客户对账单表单插件Statement基类 public class khdzdBillPlugin:Statement { string customerName =...
点击下载文档
本文2024-09-16 18:27:49发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-22307.html
您需要登录后才可以发表评论, 登录登录 或者 注册
最新文档
热门文章