示例#1
0
        protected void storeSPChannel_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            string sortFieldName = "";

            if (e.Sort != null)
            {
                sortFieldName = e.Sort;
            }

            if (sortFieldName == "ChannelTypeName")
            {
                sortFieldName = "ChannelType";
            }

            bool isDesc = (e.Dir == Ext.Net.SortDirection.DESC);

            PageQueryParams pageQueryParams = WebUIHelper.GetPageQueryParamFromStoreRefreshDataEventArgs(e, this.PagingToolBar1.PageSize);

            if (string.IsNullOrEmpty(sortFieldName))
            {
                sortFieldName = "Id";
                isDesc        = true;
            }

            storeSPChannel.DataSource = SPChannelWrapper.FindAllByOrderBy(sortFieldName, isDesc, pageQueryParams);
            e.Total = pageQueryParams.RecordCount;

            storeSPChannel.DataBind();
        }
        protected void storeSPChannel_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            int    recordCount   = 0;
            string sortFieldName = "";

            if (e.Sort != null)
            {
                sortFieldName = e.Sort;
            }

            int startIndex = 0;

            if (e.Start > -1)
            {
                startIndex = e.Start;
            }

            int limit = this.PagingToolBar1.PageSize;

            int pageIndex = 1;

            if ((startIndex % limit) == 0)
            {
                pageIndex = startIndex / limit + 1;
            }
            else
            {
                pageIndex = startIndex / limit;
            }

            storeSPChannel.DataSource = SPChannelWrapper.FindAllByOrderBy(sortFieldName, (e.Dir == Ext.Net.SortDirection.DESC), pageIndex, limit, out recordCount);
            e.Total = recordCount;

            storeSPChannel.DataBind();
        }
示例#3
0
        protected void storeSPChannel_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            string sortFieldName = "";

            if (e.Sort != null)
            {
                sortFieldName = e.Sort;
            }

            if (sortFieldName == "ChannelTypeName")
            {
                sortFieldName = "ChannelType";
            }

            int startIndex = 0;

            if (e.Start > -1)
            {
                startIndex = e.Start;
            }

            int limit = this.PagingToolBar1.PageSize;

            int pageIndex = 1;

            if ((startIndex % limit) == 0)
            {
                pageIndex = startIndex / limit + 1;
            }
            else
            {
                pageIndex = startIndex / limit;
            }


            PageQueryParams pageQueryParams = new PageQueryParams();

            pageQueryParams.PageSize  = limit;
            pageQueryParams.PageIndex = pageIndex;

            storeSPChannel.DataSource = SPChannelWrapper.FindAllByOrderBy(sortFieldName, (e.Dir == Ext.Net.SortDirection.DESC), pageQueryParams);
            e.Total = pageQueryParams.RecordCount;

            storeSPChannel.DataBind();
        }