QueryBorrowHistory.aspx.cs
上传用户:gooyliu
上传日期:2018-09-29
资源大小:5816k
文件大小:2k
源码类别:

.net编程

开发平台:

C#

  1. using System;
  2. using System.Collections;
  3. using System.Configuration;
  4. using System.Data;
  5. using System.Linq;
  6. using System.Web;
  7. using System.Web.Security;
  8. using System.Web.UI;
  9. using System.Web.UI.WebControls;
  10. using System.Web.UI.WebControls.WebParts;
  11. using System.Web.UI.HtmlControls;
  12. using System.Xml.Linq;
  13. using System.Data.SqlClient;
  14. using BusinessLogicLayer;
  15. namespace Web.SysOperator
  16. {
  17.     public partial class QueryBorrowHistory : System.Web.UI.Page
  18.     {
  19.         protected void Page_Load(object sender, EventArgs e)
  20.         {
  21.         }
  22.         public void BindData()
  23.         {
  24.             Users user = new Users();
  25.             string userID = txtReaderID.Text.Trim().ToString();
  26.             DataSet dsBorrowHistory = user.GetBorrowHistory(userID);
  27.             //dsBorrowBook = user.GetBorrowBook(userID);
  28.             if (dsBorrowHistory.Tables[0].Rows.Count > 0)
  29.             {
  30.                 this.gvBorrowHistory.DataSource = dsBorrowHistory;
  31.                 gvBorrowHistory.DataBind();
  32.                 // this.TrMsg.Visible = false;       //有借阅记录则显示列表,并不显示提示
  33.             }
  34.             else                                  //没有借阅记录则不显示gridview,并给出提示信息
  35.             {
  36.                 //  this.TrGrid.Visible = false;
  37.                 // lblMsgNoBorrow.Text = "你好,你还没有借阅历史记录";
  38.             }
  39.         }
  40.         protected void btnQuery_Click(object sender, EventArgs e)
  41.         {
  42.             BindData();
  43.             gridTable.Visible = true;
  44.         }
  45.         protected void btnReset_Click(object sender, EventArgs e)
  46.         {
  47.             this.txtReaderID.Text = string.Empty;
  48.         }
  49.     }
  50. }