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"); }