예제 #1
0
        public System.Data.DataRow Get(PanelContext data)
        {
            ModelDBHelper helper = ModelDBHelper.Create(data.ModelName);
            DataTable     dt     = helper.Query(CreatePKCriteria(data.DataKey), CreateOrders(data.Orders), 0, 0);

            return(dt.Rows.Count > 0 ? dt.Rows[0] : dt.NewRow());
        }
예제 #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));
        }