using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using UUN;
using System.Data.SqlClient;

public partial class Admin_PageSystem_Select_Album : System.Web.UI.Page
{
    private 访问 访问;
    protected String SQL;
    protected String 数量SQL;
    protected String 返回类型;
    protected void Page_Load(object sender, EventArgs e)
    {
        访问 = new 访问(this.Context);
        访问.开始处理("选择专辑", "网站后台", "选择专辑", new 访问.回调委托(ZhiXing));
        访问.关闭连接();
    }

    private void ZhiXing()
    {
        访问.验证管理员();
        返回类型 = Request.QueryString["type"];

        SQL = "SELECT [ID],[专辑名称] FROM [" + 程序.数据表前缀 + "内容_音乐_专辑] ORDER BY [ID] DESC";
        数量SQL = "SELECT COUNT(ID) FROM [" + 程序.数据表前缀 + "内容_音乐_专辑]";

        if (!this.IsPostBack)
            生成数据();
    }

    private void 生成数据()
    {
        SqlCommand 语句 = new SqlCommand(数量SQL, 访问.连接);

        后台分页 分页 = new 后台分页(Convert.ToInt32(语句.ExecuteScalar()),
            Convert.ToInt32(Request.QueryString["page"]),
            10,
            "Select_Album.aspx");

        DataSet 数据 = new DataSet();
        语句 = new SqlCommand(SQL, 访问.连接);
        SqlDataAdapter 填充 = new SqlDataAdapter(语句);
        填充.Fill(数据, (分页.当前页 - 1) * 10, 10, "专辑");

        GridView1.DataSource = 数据;
        GridView1.DataBind();

        FenYeDaiMa.Text = 分页.生成代码();
    }
}
