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

📄 querybooksoverform.aspx.cs

📁 图书租借管理系统源码 主要功能模块有: 系统首页 图书管理 读者管理 借阅管理 查询管理 系统管理 图书类别设置 出版公司设置 馆藏图书管理 会
💻 CS
字号:
//文件名:QueryBooksOverForm.aspx.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;

using System.Data.SqlClient;
public partial class QueryManage_QueryBooksOverForm : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string MyForbidString = Session["MyForbid"].ToString();
        if (MyForbidString.IndexOf("D7") > 1)
        {
            Server.Transfer("~/SystemManage/AllErrorHelp.aspx");
        }
    }
    private static string MySQL = "";
    private static string MyDate = "";
    protected void Button1_Click(object sender, EventArgs e)
    {//查询超期图书
        DataTable MyQueryTable = new System.Data.DataTable();
        SqlConnection MyConnection = new SqlConnection();
        MyConnection.ConnectionString = ConfigurationManager.ConnectionStrings["MyBooksDBConnectionString"].ConnectionString;
        MyConnection.Open();
        MySQL = "SELECT * FROM 超期未还图书视图 WHERE ('" + this.TextBox1.Text + "'>应还日期)  AND (归还日期 IS NULL) AND (遗失图书 IS NULL)"+
           " AND (图书类别 LIKE '%" + this.DropDownList1.SelectedValue.ToString() +
           "%') AND (图书书号 LIKE '%" + this.TextBox4.Text +
           "%')  AND (图书书名 LIKE '%" + this.TextBox3.Text +
           "%')  AND (图书作者 LIKE '%" + this.TextBox5.Text +
           "%') AND (出版公司 LIKE '%" + this.TextBox6.Text + "%')";
        MyDate = "当前查询日期:" + this.TextBox1.Text ;
        SqlDataAdapter MyAdapter = new SqlDataAdapter(MySQL, MyConnection);
        MyAdapter.Fill(MyQueryTable);
        this.GridView1.DataSource = MyQueryTable;
        this.GridView1.DataBind();
        if (MyConnection.State == ConnectionState.Open)
        {
            MyConnection.Close();
        }
    }
    public string MyPrintSQL
    {//设置要传递到打印页的数据
        get
        {
            return MySQL;
        }
    }
    public String MyPrintDate
    {//设置要传递到打印页的数据
        get
        {
            return MyDate;
        }
    }
    protected void Button2_Click(object sender, EventArgs e)
    {//打印超期图书
        Server.Transfer("~/QueryManage/QueryBooksOverPrint.aspx");
    }
}

⌨️ 快捷键说明

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