BorrowHistory.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.Reader
  16. {
  17.     public partial class BorrowHistory : System.Web.UI.Page
  18.     {
  19.         protected void Page_Load(object sender, EventArgs e)
  20.         {
  21.             if (!IsPostBack)
  22.             {
  23.                 BindData();
  24.             }
  25.             
  26.         }
  27.         public void BindData()
  28.         {
  29.             Users user = new Users();
  30.             string userID = Convert.ToString(Session["userID"]);
  31.             DataSet dsBorrowHistory = user.GetBorrowHistory(userID);
  32.             //dsBorrowBook = user.GetBorrowBook(userID);
  33.             if (dsBorrowHistory.Tables[0].Rows.Count > 0)
  34.             {
  35.                 this.gvBorrowHistory.DataSource = dsBorrowHistory;
  36.                 gvBorrowHistory.DataBind();
  37.                // this.TrMsg.Visible = false;       //有借阅记录则显示列表,并不显示提示
  38.             }
  39.             else                                  //没有借阅记录则不显示gridview,并给出提示信息
  40.             {
  41.               //  this.TrGrid.Visible = false;
  42.                // lblMsgNoBorrow.Text = "你好,你还没有借阅历史记录";
  43.             }
  44.         }
  45.     }
  46. }