?? history.aspx.cs
字號:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
namespace Library_BS
{
/// <summary>
/// History 的摘要說明。
/// </summary>
public class History : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Label Label1;
protected System.Web.UI.WebControls.Label lblBarCode;
protected System.Web.UI.WebControls.Label Label3;
protected System.Web.UI.WebControls.Label lblReaderName;
protected System.Web.UI.WebControls.DataGrid gridHistory;
private void Page_Load(object sender, System.EventArgs e)
{
this.lblBarCode.Text=Request["RegistName"];
this.lblReaderName.Text=Request["barcode"];
string connStr="server=\'(local)\'; trusted_connection=true; database=\'Library\'";
SqlConnection myConnection=new SqlConnection(connStr);
myConnection.Open();
//string w=Request["namei"].ToString();
string queryStr="select ActionTime as 操作時間,ActionType as 操作類型,BookName as 書名,IndexID as 索引號,BookID as 條碼號 from Action where UserBarCode='"+lblReaderName.Text+"'";
SqlDataAdapter myDataAdapter=new SqlDataAdapter(queryStr,myConnection);
DataSet myDataSet=new DataSet();
myDataAdapter.Fill(myDataSet,"1");
if (myDataSet.Tables["1"].Rows.Count>0)
{
//Label3.Text="所有借的圖書現(xiàn)在歷史信息:";
gridHistory.DataSource=myDataSet.Tables["1"].DefaultView;
gridHistory.DataBind();
}
}
#region Web 窗體設(shè)計(jì)器生成的代碼
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 該調(diào)用是 ASP.NET Web 窗體設(shè)計(jì)器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 設(shè)計(jì)器支持所需的方法 - 不要使用代碼編輯器修改
/// 此方法的內(nèi)容。
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -