public int GetCount(PanelContext data) { ModelDBHelper helper = ModelDBHelper.Create(data.ModelName); Criteria ct = CreateQueryCriteria(data.QueryFields, data); return(helper.Count(ct)); }
public System.Data.DataTable Query(PanelContext data, out int recordcount, ref int pageindex) { ModelDBHelper helper = ModelDBHelper.Create(data.ModelName); Criteria ct = CreateQueryCriteria(data.QueryFields, data); recordcount = helper.Count(ct); int startindex, itemscount; Utils.BuidlPagerParam(recordcount, data.PageSize, ref pageindex, out startindex, out itemscount); return(helper.Query(ct, CreateOrders(data.Orders), startindex, itemscount)); }