using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace BookDemo.QA.Admin
{
    public partial class Users : System.Web.UI.Page
    {

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                #region 原始读取数据库方法
                //BookDemoEntities ctx = new BookDemoEntities();
                //List<QAUserInfo> userInfo = ctx.QAUserInfo.ToList();//取出所有的QAUserInfo实体信息，不进行筛选
                //gvUsers.DataSource = userInfo;//将gvUsers的数据源设为userInfo
                //gvUsers.DataBind();//将数据绑定到gvUsers上
                #endregion

                #region 从缓存中读取
                UserInfoCache userInfoCache = new UserInfoCache();
                gvUsers.DataSource = userInfoCache.Data;//将gvUsers的数据源设为userInfo
                gvUsers.DataBind();//将数据绑定到gvUsers上
                #endregion
            }
        }
    }
}
