⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bborrowquery.aspx.cs

📁 图书馆管理系统 包含有数据库等 和详细的页面设计 是一个不错的程序
💻 CS
字号:
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;

public partial class SysQuery_BBorrowQuery : System.Web.UI.Page
{
    BorrowandBackManage borrowandbackmanage = new BorrowandBackManage();
    protected void Page_Load(object sender, EventArgs e)
    {
        this.Title = "图书借阅查询页面";
        if (!IsPostBack)
        {
            gvBind();
        }
    }
    protected void btnQuery_Click(object sender, EventArgs e)
    {
        gvBind();
    }
    protected void gvBorrowInfo_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        gvBorrowInfo.PageIndex = e.NewPageIndex;
        gvBind();
    }
    protected void ddlCondition_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (ddlCondition.SelectedValue == "借阅时间")
        {
            Label1.Visible = Label2.Visible = Label3.Visible = txtFTime.Visible = txtTTime.Visible = true;
            txtCondition.Visible = false;
        }
        else
        {
            Label1.Visible = Label2.Visible = Label3.Visible = txtFTime.Visible = txtTTime.Visible = false;
            txtCondition.Visible = true;
        }
    }
    protected void gvBind()
    {
        DataSet ds = null;
        int intCondition = ddlCondition.SelectedIndex;
        if (intCondition <= 3)
        {
            if (txtCondition.Text == "")
            {
                ds = borrowandbackmanage.GetAllBoBaBook("view_BookBRInfo");
            }
            else
            {
                switch (intCondition)
                {
                    case 0:
                        borrowandbackmanage.BookCode = txtCondition.Text;
                        ds = borrowandbackmanage.FindBoBaBookByBCode(borrowandbackmanage, "view_BookBRInfo");
                        break;
                    case 1:
                        borrowandbackmanage.BookName= txtCondition.Text;
                        ds = borrowandbackmanage.FindBoBaBookByBName(borrowandbackmanage, "view_BookBRInfo");
                        break;
                    case 2:
                        borrowandbackmanage.ReadID = txtCondition.Text;
                        ds = borrowandbackmanage.FindBoBaBookByReaderID(borrowandbackmanage, "view_BookBRInfo");
                        break;
                    case 3:
                        borrowandbackmanage.Name = txtCondition.Text;
                        ds = borrowandbackmanage.FindBoBaBookByReader(borrowandbackmanage, "view_BookBRInfo");
                        break;
                }
            }
        }
        else
        {
            if (txtFTime.Text == "" || txtTTime.Text == "")
            {
                Response.Write("<script>alert('请输入正确的借阅时间')</script>");
            }
            else
            {
                borrowandbackmanage.FromTime = Convert.ToDateTime(txtFTime.Text);
                borrowandbackmanage.ToTime = Convert.ToDateTime(txtTTime.Text);
                ds = borrowandbackmanage.FindBoBaBookByBoTime(borrowandbackmanage, "view_BookBRInfo");
            }

        }
        gvBorrowInfo.DataSource = ds;
        gvBorrowInfo.DataBind();
    }
}

⌨️ 快捷键说明

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