예제 #1
0
        public int GetCount(PanelContext data)
        {
            ModelDBHelper helper = ModelDBHelper.Create(data.ModelName);
            Criteria      ct     = CreateQueryCriteria(data.QueryFields, data);

            return(helper.Count(ct));
        }
예제 #2
0
        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));
        }