📄 detail.aspx.cs
字号:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace e_librarys
{
/// <summary>
/// Detail 的摘要说明。
/// </summary>
public partial class Detail : System.Web.UI.Page
{
protected void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
string ID = Request.QueryString["BookId"].ToString();
SqlConnection Conn = new SqlConnection("server=(local);database=e_library;uid=sa;pwd=");
Conn.Open();
SqlDataAdapter Da = new SqlDataAdapter("select * from Book_Info a,Payment b where B_ID='"+ID+"' and a.B_PMT_ID=b.P_ID",Conn);
DataSet Ds = new DataSet();
Da.Fill(Ds);
DataList_Detail.DataSource = Ds.Tables[0];
DataList_Detail.DataBind();
Conn.Close();
}
#region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
}
#endregion
protected void Button_HomePage_Click(object sender, System.EventArgs e)
{
if(Session["U_ID"]!=null)
Response.Redirect("Welcome.aspx");
else
Response.Redirect("Begin.aspx");
}
protected void Button_Poetry_Click(object sender, System.EventArgs e)
{
string StrSql="select * from Book_Info a,Book_Style b,Book_DetailStyle c where B_S_Name='诗歌' and b.B_S_ID=c.B_S_ID and a.B_BDS_ID=c.B_DS_ID";
Session["StrSql"]=StrSql;
Response.Redirect("Massage.aspx");
}
protected void Button_ForiegnLiterature_Click(object sender, System.EventArgs e)
{
string StrSql="select * from Book_Info a,Book_Style b,Book_DetailStyle c where B_S_Name='外国文学' and b.B_S_ID=c.B_S_ID and a.B_BDS_ID=c.B_DS_ID";
Session["StrSql"]=StrSql;
Response.Redirect("Massage.aspx");
}
protected void Button_PhilosophyReligion_Click(object sender, System.EventArgs e)
{
string StrSql="select * from Book_Info a,Book_Style b,Book_DetailStyle c where B_S_Name='哲学宗教' and b.B_S_ID=c.B_S_ID and a.B_BDS_ID=c.B_DS_ID";
Session["StrSql"]=StrSql;
Response.Redirect("Massage.aspx");
}
protected void LinkButton1_Click(object sender, System.EventArgs e)
{
if(Session["T_Status"].ToString()=="1")
Response.Redirect("TanancyMassage.aspx");
else
Response.Write("<Script Language='JavaScript'>alert('你还没有预定图书')</Script>");
}
protected void LinkButton2_Click(object sender, System.EventArgs e)
{
if(Session["T_Status"].ToString()=="2")
Response.Redirect("TanancyMassage.aspx");
else
Response.Write("<Script Language='JavaScript'>alert('你还没有租赁图书')</Script>");
}
protected void LinkButton3_Click(object sender, System.EventArgs e)
{
if(Session["T_Status"].ToString()=="2")
Response.Redirect("TanancyMassage.aspx");
else
Response.Write("<Script Language='JavaScript'>alert('你还没有租赁图书')</Script>");
}
protected void LinkButton4_Click(object sender, System.EventArgs e)
{
if(Session["T_Status"].ToString()=="2")
Response.Redirect("TanancyMassage.aspx");
else
Response.Write("<Script Language='JavaScript'>alert('你还没有租赁图书')</Script>");
}
protected void Button_Novel_Click1(object sender, EventArgs e)
{
string StrSql = "select * from Book_Info a,Book_Style b,Book_DetailStyle c where B_S_Name='小说' and b.B_S_ID=c.B_S_ID and a.B_BDS_ID=c.B_DS_ID";
Session["StrSql"] = StrSql;
Response.Redirect("Massage.aspx");
}
protected void Button_PoliticsEconomics_Click1(object sender, EventArgs e)
{
string StrSql = "select * from Book_Info a,Book_Style b,Book_DetailStyle c where B_S_Name='政治经济' and b.B_S_ID=c.B_S_ID and a.B_BDS_ID=c.B_DS_ID";
Session["StrSql"] = StrSql;
Response.Redirect("Massage.aspx");
}
protected void Button_EnglishReading_Click1(object sender, EventArgs e)
{
string StrSql = "select * from Book_Info a,Book_Style b,Book_DetailStyle c where B_S_Name='英语读物' and b.B_S_ID=c.B_S_ID and a.B_BDS_ID=c.B_DS_ID";
Session["StrSql"] = StrSql;
Response.Redirect("Massage.aspx");
}
protected void Button_ComputerBooks_Click1(object sender, EventArgs e)
{
string StrSql = "select * from Book_Info a,Book_Style b,Book_DetailStyle c where B_S_Name='电脑书籍' and b.B_S_ID=c.B_S_ID and a.B_BDS_ID=c.B_DS_ID";
Session["StrSql"] = StrSql;
Response.Redirect("Massage.aspx");
}
protected void Button_MathPhysicsChemistry_Click1(object sender, EventArgs e)
{
string StrSql = "select * from Book_Info a,Book_Style b,Book_DetailStyle c where B_S_Name='数理化' and b.B_S_ID=c.B_S_ID and a.B_BDS_ID=c.B_DS_ID";
Session["StrSql"] = StrSql;
Response.Redirect("Massage.aspx");
}
protected void Button_All_Click1(object sender, EventArgs e)
{
string StrSql = "select * from Book_Info";
Session["StrSql"] = StrSql;
Response.Redirect("Massage.aspx");
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -