MyBookShop/BookShop/Admin/BookList.aspx.cs

(开头部分) 3KB

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

using BLL;
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using Core;

namespace BookShop.Admin
{
    public partial class BookList : System.Web.UI.Page
    {
        /// <summary>
        /// 初始化BLLUserInfo类
        /// </summary>
        BLLBooks bll = new BLLBooks();
        /// <summary>
        /// 定义页面ID
        /// </summary>
        public int PageIndex { get; set; }
        /// <summary>
        /// 定义搜索属性
        /// </summary>
        public string Search { get; set; }
        

        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["txtSearch"] != null)
            {
                this.Search = Request.QueryString["txtSearch"].ToString();
                ShowData();
            }
            if (!IsPostBack)
            {
                ShowData();
            }
        }
        /// <summary>
        /// 显示数据
        /// </summary>
        private void ShowData()
        {
            if (Request.QueryString["page"] == null)
            {
                PageIndex = 1;
            }
            else
            {
                int index;
                int.TryParse(Request.QueryString["page"], out index);
                PageIndex = index == 0 ? 1 : index;
            }
            PagerHelper<Books> list = bll.GetList(0,this.PageIndex,this.Search);
            this.reBookList.DataSource = list;
            this.reBookList.DataBind();
            ViewState["pager"] = list.GetHtml;
后面还有 48 行代码,购买后查看完整代码

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

AI 解读 AI

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

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