this.Model.SetValue赋值慢,可使用如下办法提高单据体数据插入速度原创
101人赞赏了该文章
1,946次浏览
编辑于2024年03月01日 22:42:14
if (e.BarItemKey.EqualsIgnoreCase("BEC_tbButton")) { Int64 orgId = this.Context.CurrentOrganizationInfo.ID; this.View.Model.DeleteEntryData("FEntity"); string sql = string.Format("/*dialect*/EXEC CPZ_QT @orgId={0}", orgId); var entity = this.View.BillBusinessInfo.GetEntity("FEntity"); var rows = this.View.Model.GetEntityDataObject(entity); DynamicObjectCollection doc = DBUtils.ExecuteDynamicObject(this.Context, sql); for (int i = 0; i < doc.Count; i++) { var row = new DynamicObject(rows.DynamicCollectionItemPropertyType); row["Seq"] = rows.Count + 1; BaseDataField Material = this.View.BusinessInfo.GetField("FPRODUCTID") as BaseDataField; var materialObj = Kingdee.BOS.ServiceHelper.BusinessDataServiceHelper.LoadSingle(this.Context, doc[i]["FMATERIALID"], fldMaterial.RefFormDynamicObjectType); Material.RefIDDynamicProperty.SetValue(row, doc[i]["FMATERIALID"]); Material.DynamicProperty.SetValue(row, materialObj); rows.Add(row); } this.View.UpdateView("FEntity"); }
赞 101
101人点赞
还没有人点赞,快来当第一个点赞的人吧!
打赏
0人打赏
还没有人打赏,快来当第一个打赏的人吧!
推荐阅读