Exemplo n.º 1
0
        private void InitializePaging(PagingControl ctlPagingControl, int totalRecords, int pageSize)
        {
            ctlPagingControl.TotalRecords = totalRecords;
            ctlPagingControl.PageSize     = pageSize;
            ctlPagingControl.CurrentPage  = _pageIndex;

            var querystring = "";

            if (ddlRecordsPerPage.SelectedIndex != 0)
            {
                querystring += "&PageRecords=" + ddlRecordsPerPage.SelectedValue;
            }
            if (_portalId >= 0)
            {
                querystring += "&pid=" + _portalId;
            }
            if (_logTypeKey != "*" && !String.IsNullOrEmpty(_logTypeKey))
            {
                querystring += "&LogTypeKey=" + _logTypeKey;
            }

            ctlPagingControl.QuerystringParams = querystring;
            ctlPagingControl.TabID             = TabId;
            ctlPagingControl.Visible           = true;
        }
Exemplo n.º 2
0
        protected void InitPager(PagingControl pager)
        {
            pager.CurrentPage       = CurrentPage;
            pager.TabID             = TabId;
            pager.PageSize          = PageSize;
            pager.PageLinksPerPage  = Settings.MaxPageLinks;
            pager.Mode              = PagingControlMode.PostBack;
            pager.QuerystringParams = "pagingModuleId=" + ModuleId;

            pager.ShowStatus    = Settings.PagerShowStatus ?? NewsConfig.Instance.StreamModule.PagerShowStatus;
            pager.ShowFirstLast = Settings.PagerShowFirstLast ?? NewsConfig.Instance.StreamModule.PagerShowFirstLast;

            pager.ListCssClass         = "pagination";
            pager.ItemCssClass         = "page-item";
            pager.LinkCssClass         = "page-link";
            pager.StatusCssClass       = "news-pager-status";
            pager.CurrentItemCssClass  = "active";
            pager.InactiveItemCssClass = "disabled";

            pager.PrevText     = LocalizeString("Pager_Prev.Text");
            pager.NextText     = LocalizeString("Pager_Next.Text");
            pager.FirstText    = LocalizeString("Pager_First.Text");
            pager.LastText     = LocalizeString("Pager_Last.Text");
            pager.CurrentText  = LocalizeString("Pager_Current.Text");
            pager.AriaLabel    = LocalizeString("Pager_ArialLabel.Text");
            pager.StatusFormat = LocalizeString("Pager_StatusFormat.Text");
        }
Exemplo n.º 3
0
        /// <summary>
        /// Sets up a DNN <see cref="PagingControl"/>.
        /// </summary>
        /// <param name="pagingControl">The pager control.</param>
        /// <param name="totalRecords">The total records.</param>
        /// <param name="queryStringKeys">The QueryString keys which should be persisted when the paging links are clicked.</param>
        protected void SetupPagingControl(PagingControl pagingControl, int totalRecords, params string[] queryStringKeys)
        {
            if (pagingControl == null)
            {
                throw new ArgumentNullException("pagingControl");
            }

            pagingControl.Visible           = totalRecords != 0;
            pagingControl.TotalRecords      = totalRecords;
            pagingControl.CurrentPage       = this.CurrentPageIndex;
            pagingControl.TabID             = this.TabId;
            pagingControl.QuerystringParams = GenerateQueryStringParameters(this.Request, queryStringKeys);
        }
Exemplo n.º 4
0
    public void BindNews()
    {
        try
        {
            DataSet dsrptNews = new DataSet();
            objDAEntities.IsActive           = true;
            objDAEntities.jcPageSize         = PageSize;
            objDAEntities.jcCurrentPageIndex = PagingControl.CurrentPage;
            dsrptNews = (DataSet)objBusinessLogic.GetNewsDetails(objDAEntities);

            if (dsrptNews.Tables[0].Rows.Count > 0)
            {
                rptNews.DataSource = dsrptNews;
                rptNews.DataBind();

                if (Convert.ToInt32(dsrptNews.Tables[0].Rows[0]["TotalRecord"]) <= PageSize)
                //if (TotalRecords <= PageSize)
                {
                    //divPAgerControl.Visible = false;
                    PagingControl.Visible = false;
                }
                else
                {
                    // divPAgerControl.Visible = true;
                    PagingControl.Visible           = true;
                    PagingControl.PageSize          = PageSize;
                    PagingControl.TotalRecordsCount = Convert.ToInt32(dsrptNews.Tables[0].Rows[0]["TotalRecord"]);
                    //PagerControls.TotalRecordsCount = TotalRecords;
                    PagingControl.BuildPages();
                }
            }
            else
            {
                //divPAgerControl.Visible = false;
                PagingControl.Visible = false;
                // divNoRecordFound.Visible = true;
            }

            //////rptNews.DataSource = dsrptNews;
            //////rptNews.DataBind();
        }
        catch (Exception ex)
        {
            //Response.Write("Total Records : " + ex.ToString());
        }
    }
Exemplo n.º 5
0
        private void InitializePaging(PagingControl ctlPagingControl, int TotalRecords, int PageSize)
        {
            ctlPagingControl.TotalRecords = TotalRecords;
            ctlPagingControl.PageSize     = PageSize;
            ctlPagingControl.CurrentPage  = PageIndex;
            string strQuerystring = "";

            if (ddlRecordsPerPage.SelectedIndex != 0)
            {
                strQuerystring += "&PageRecords=" + ddlRecordsPerPage.SelectedValue;
            }
            if (intPortalID >= 0)
            {
                strQuerystring += "&PortalID=" + intPortalID.ToString();
            }
            if (strLogTypeKey != "*" && !String.IsNullOrEmpty(strLogTypeKey))
            {
                strQuerystring += "&LogTypeKey=" + strLogTypeKey;
            }
            ctlPagingControl.QuerystringParams = strQuerystring;
            ctlPagingControl.TabID             = TabId;
        }
Exemplo n.º 6
0
 public IActionResult Get([FromQuery] PagingControl <MyColumnFilter> pc)
 {
     return(new JsonResult(pc));
 }