Пример #1
0
    /// <summary>
    /// Ìî³äÊý¾Ý
    /// </summary>
    protected override void FillPageNum()
    {
        long curPage   = dataSource.CurrentPage + 1;
        long totlePage = dataSource.TotlePage;

        this.Visible = true;
        if (dataSource.TotleRecords == 0)
        {
            this.Visible = false;
            return;
        }
        TotlePage        = totlePage;
        CurrentPage      = dataSource.CurrentPage;
        lblPage.Text     = TotlePage.ToString();
        lblCP.InnerText  = dataSource.TotleRecords.ToString();
        txtPage.Value    = curPage.ToString();
        btnLast.Enabled  = true;
        btnNext.Enabled  = true;
        btnFirsh.Enabled = true;
        btnUp.Enabled    = true;
        if (dataSource.CurrentPage == 0)
        {
            //lbPri.Enabled = false;

            btnFirsh.Enabled = false;
            btnUp.Enabled    = false;
        }
        if (dataSource.CurrentPage >= TotlePage - 1)
        {
            //lbNext.Enabled = false;
            btnLast.Enabled = false;
            btnNext.Enabled = false;
        }
    }
Пример #2
0
    /// <summary>
    /// Ìî³äÊý¾Ý
    /// </summary>
    protected override void FillPageNum()
    {
        long curPage   = dataSource.CurrentPage + 1;
        long totlePage = dataSource.TotlePage;

        this.Visible = true;
        if (dataSource.TotleRecords == 0)
        {
            this.Visible = false;
            return;
        }
        TotlePage       = totlePage;
        CurrentPage     = dataSource.CurrentPage;
        lblPage.Text    = TotlePage.ToString();
        lblCP.InnerText = dataSource.TotleRecords.ToString();
        txtPage.Value   = curPage.ToString();
        //btnLast.Enabled = true;
        //btnNext.Enabled = true;
        //btnFirsh.Enabled = true;
        //btnUp.Enabled = true;
        //if (dataSource.CurrentPage == 0)
        //{
        //    //lbPri.Enabled = false;

        //    btnFirsh.Enabled = false;
        //    btnUp.Enabled = false;
        //}
        //if (dataSource.CurrentPage >= TotlePage - 1)
        //{
        //    //lbNext.Enabled = false;
        //    btnLast.Enabled = false;
        //    btnNext.Enabled = false;
        //}
        PagerUrlCreater url = new PagerUrlCreater();

        if (dataSource.CurrentPage != 0)
        {
            url[RequestPageNumName] = "1";
            btnFirsh.NavigateUrl    = url.GetUrl();
            url[RequestPageNumName] = CurrentPage.ToString();
            btnUp.NavigateUrl       = url.GetUrl();
        }
        if (dataSource.CurrentPage < TotlePage - 1)
        {
            url[RequestPageNumName] = TotlePage.ToString();
            btnLast.NavigateUrl     = url.GetUrl();
            url[RequestPageNumName] = (CurrentPage + 2).ToString();
            btnNext.NavigateUrl     = url.GetUrl();
        }
    }