HLW/web/User/List.aspx.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace HLW.web.User
{
    public partial class List : System.Web.UI.Page
    {
        public int pcount = 0; //总条数
         
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Session["UserList"] = " 1=1 ";
                BindRptData();
            }
        }


        #region 数据绑定
        public void BindRptData()
        {
            string strWhere = Session["UserList"] + "";
            BLL.Users bll = new BLL.Users();
            DataSet ds = bll.GetList(strWhere + "  order by userId ");
            DataView dv = ds.Tables[0].DefaultView;
            //利用PAGEDDAGASOURCE类来分页
            PagedDataSource pds = new PagedDataSource();
            AspNetPager1.RecordCount = dv.Count;
            pds.DataSource = dv;
            pds.AllowPaging = true;
            pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;
            pds.PageSize = AspNetPager1.PageSize;
            //获得总条数
            pcount = bll.GetRecordCount(strWhere);
            if (this.pcount > 0)
            {
                this.lbtnDel.Enabled = true;
            }
            else
            {
                this.lbtnDel.Enabled = false;
            }
            //绑定数据
            rptList.DataSource = pds;
            rptList.DataBind();
        }
        #endregion


        protected void btnSelect_Click(object sender, EventArgs e)
        {
            string strWhere = " 1=1 ";
            if (txtKeywords.Text.Trim().Length >= 1)
            {
后面还有 39 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。