accounts_users_list.aspx.cs

来自「小区警务管理系统」· CS 代码 · 共 58 行

CS
58
字号
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace web.SubDocument.UserManage
{
    public partial class UserList : web.Components.BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {                
                BLL.Accounts_Users bll = new BLL.Accounts_Users();
                AspNetPager1.RecordCount = bll.GetRecordCount("");
                ShowUserList();
            }
        }

        /// <summary>
        /// 显示用户列表
        /// </summary>
        private void ShowUserList()
        {
            BLL.Accounts_Users bll = new BLL.Accounts_Users();
            this.Repeater1.DataSource = bll.GetData(AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex, "");
            this.Repeater1.DataBind();

            AspNetPager1.CustomInfoHTML = "页次:<font color=\"red\"><b>" + AspNetPager1.CurrentPageIndex + "</b></font>/" + AspNetPager1.PageCount;
            AspNetPager1.CustomInfoHTML += "页&nbsp;&nbsp;每页显示:" + AspNetPager1.PageSize + "条记录&nbsp;&nbsp;记录数:" + AspNetPager1.StartRecordIndex + "-" + AspNetPager1.EndRecordIndex + "条&nbsp;&nbsp;共" + AspNetPager1.RecordCount + "条";
        }

        protected void AspNetPager1_PageChanged(object sender, EventArgs e)
        {
            ShowUserList();   
        }

        protected void add_Click(object sender, EventArgs e)
        {
            try
            {
                int a = 0;
                int b = 3 / a;
            }
            catch (Exception ex)
            {
                this.ErrorMsg(ex.ToString());
            }
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?