private void PageGo(object sender, EventArgs e) { int inputPageNo = 0; if (!int.TryParse(tbPage.Text, out inputPageNo)) { tbPage.Clear(); return; } if (inputPageNo < 1 || inputPageNo > pageCount) { tbPage.Clear(); return; } if (inputPageNo == pageNo) { return; } pageNo = inputPageNo; if (PageChanged != null) { PageChanged(sender, e); return; } IPageSplit iPage = GetIPageSplitObj(); if (iPage != null) { iPage.PageGo(inputPageNo); } }
/// <summary> /// Initializes a new instance of the <see cref="PageSelector<EntityType>"/> class. /// </summary> /// <param name="gateway">The gateway.</param> /// <param name="ps">The ps.</param> public PageSelector(Gateway gateway, IPageSplit ps) { Check.Require(gateway != null, "gateway could not be null."); Check.Require(ps != null, "ps could not be null."); this.gateway = gateway; this.ps = ps; }
private void DbHelperReadSecondPage(object val) { IPageSplit ps = gateway.DbHelper.SelectPageSplit("Orders", new string[] { "*" }, "OrderID > @OrderID", "OrderID desc", "OrderID", new object[] { 10 }); ps.PageSize = 100; DataSet ds = ps.GetPage(2); ds = null; ps = null; }
private object DbHelperReadFirstPage() { IPageSplit ps = gateway.DbHelper.SelectPageSplit("Orders", new string[] { "*" }, "OrderID > @OrderID", "OrderID desc", "OrderID", new object[] { 10 }); ps.PageSize = 100; DataSet ds = ps.GetPage(1); ds = null; ps = null; return(null); }
private void btfirst_Click(object sender, EventArgs e) { pageNo = 1; if (PageChanged != null) { PageChanged(sender, e); DataBind(); return; } IPageSplit iPage = GetIPageSplitObj(); if (iPage != null) { iPage.MoveFirst(); } }
public static DataSet FindList(string fields, string tablename, string keyId, string order, string expression, int PageSize, int PageIndex, out int RowCount) { string SelectSql = string.Format("SELECT {0} from {1}", fields, tablename); if (expression != null && expression != string.Empty) { SelectSql = SelectSql + " WHERE " + expression; } SelectSql += order; Gateway gateway = Gateway.Default; IPageSplit PageSplit = gateway.Db.GetPageSplit(SelectSql, keyId, null); PageSplit.PageSize = PageSize; RowCount = PageSplit.GetRowCount(); DataSet ds = PageSplit.GetPage(PageIndex); return(ds); }
/// <summary> /// <para>Creates an <see cref="IPageSplit"/> for a SQL page splitable select query.</para> /// </summary> /// <param name="selectStatement"><para>The text of the basic select query for all rows.</para></param> /// <param name="keyColumn"><para>The sigle main DEFAULT_KEY of the query.</para></param> /// <param name="paramValues"><para>The param values of the query.</para></param> /// <returns><para>The <see cref="IPageSplit"/> for the SQL query.</para></returns> public IPageSplit GetPageSplit(string selectStatement, string keyColumn, object[] paramValues) { IPageSplit ps = dbProvider.CreatePageSplit(this, selectStatement, keyColumn, paramValues); return(ps); }