protected void storeSPSendClientParams_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;
            }

            storeSPSendClientParams.DataSource = SPSendClientParamsWrapper.FindAllByOrderByAndClientID(sortFieldName, (e.Dir == SortDirection.DESC), pageIndex, limit, this.SPClientID, out recordCount);
            e.TotalCount = recordCount;

            storeSPSendClientParams.DataBind();
        }
예제 #2
0
        protected void storeSPSendClientParams_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            int clientID = 0;


            if (!string.IsNullOrEmpty(e.Parameters["clientID"]))
            {
                try
                {
                    clientID = int.Parse(e.Parameters["clientID"]);
                }
                catch
                {
                }
            }

            if (clientID == 0)
            {
                storeSPSendClientParams.DataSource = new List <SPSendClientParamsWrapper>();
                e.TotalCount = 0;
                return;
            }



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

            storeSPSendClientParams.DataSource = SPSendClientParamsWrapper.FindAllByOrderByAndClientID(sortFieldName, (e.Dir == SortDirection.DESC), pageIndex, limit, clientID, out recordCount);
            e.TotalCount = recordCount;

            storeSPSendClientParams.DataBind();
        }