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