BookQuerySystem/bookTypeList.aspx.cs

(开头部分) 2KB

这里只显示每个文件的开头 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;
using BookQuerySystem;

namespace BookQuerySystem
{
  /*
   * author:zhangjia
   * 时间:2014/10/2 9:35
   * 作用:Book的增删改查
   */
    public partial class bookTypeList: System.Web.UI.Page
    {
        BookTypeDao bookTypeDao = new BookTypeDao();
        protected void Page_Load(object sender, EventArgs e)
        {
            int flag = Convert.ToInt32(Context.Request["flag"]);
            if (flag == 1) {
                Alertsuccess.Visible = true;
            }
            if (!IsPostBack)
            {
                BindGrid();
            }
        }

        protected void bookAdd_Click(object sender, EventArgs e)
        {
            Response.Redirect("bookSave.aspx");
        }

        protected void AspNetPagerBookTypeList_PageChanged(object sender, EventArgs e)
        {
            AlertFailure.Visible = false;
            BindGrid();
        }

        //绑定数据源
        public void BindGrid()
        {
            this.AspNetPagerBookTypeList.RecordCount = bookTypeDao.GetAllCount();
            int pageIndex = this.AspNetPagerBookTypeList.CurrentPageIndex - 1;
            int pageSize = this.AspNetPagerBookTypeList.PageSize = 5;
            listBookType.DataSource = bookTypeDao.getBookType(pageIndex, pageSize);
            listBookType.DataBind();
        }
        protected void listBookType_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            //点击删除按钮,删除对应一条的信息
            if (e.CommandName == "delete")
            {
                int bookTypeId = Convert.ToInt32(e.CommandArgument.ToString());
                BookType bookType = new BookType();
                bookType.BookTypeId = bookTypeId;
                try
后面还有 25 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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