示例#1
0
        /// <summary>
        /// Bind contact role gridview
        /// </summary>
        private void BindGrid()
        {
            // Get user branch info
            dtUserBranch = userMngr.GetUserBranchInfo();

            int pageSize  = AspNetPager1.PageSize;
            int pageIndex = 1;

            if (isReset == true)
            {
                pageIndex = AspNetPager1.CurrentPageIndex = 1;
            }
            else
            {
                pageIndex = AspNetPager1.CurrentPageIndex;
            }

            string strWhare    = " AND UserEnabled=1";
            int    recordCount = 0;

            DataSet contactRoles = null;

            try
            {
                contactRoles = userMngr.GetListForGridView(pageSize, pageIndex, strWhare, out recordCount, OrderName, OrderType);
            }
            catch (Exception exception)
            {
                LPLog.LogMessage(exception.Message);
            }

            AspNetPager1.PageSize    = pageSize;
            AspNetPager1.RecordCount = recordCount;

            gridList.DataSource = contactRoles;
            gridList.DataBind();
        }