//得到单据体实体
Entity PayableEntity = this.View.BillBusinessInfo.GetEntity("F_UAYT_Entity1");
//得到单据体实体数据包
DynamicObjectCollection PayableRows = this.Model.GetEntityDataObject(PayableEntity);
//编写SQL语句
string PayableSql ="XXXXXXXXX";
PayableSql = string.Format(PayableSql, startDate, endDate);
DynamicObjectCollection OPayableData = DBUtils.ExecuteDynamicObject(this.Context, PayableSql);
if (OPayableData.Count > 0)
{
for (int i = 0; i < OPayableData.Count; i++)
{
DynamicObject row = new DynamicObject(PayableEntity.DynamicObjectType);
row["XX"] = OPayableData[i]["XX"]; //单据状态
row["XX"] = OPayableData[i]["XX"]; //单据类型
row["XX"] = OPayableData[i]["XX"]; //立账类型
PayableRows.Add(row);
}
}
推荐阅读