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 System.Data.SqlClient;

public partial class mp4Format : System.Web.UI.Page
{
    DataBaseLayer db = new DataBaseLayer();
    public mp4films mf = new mp4films();
    public string formatName;
    protected void Page_Load(object sender, EventArgs e)
    {
        formatName = Request.QueryString["format"].ToString();
        if (formatName != "")
        {
            DataListBind(formatName);
        }

    }
    public void DataListBind(string formatName)
    {
        SqlParameter[] prams ={
            db.ParamBuilder("@FormatName",formatName,SqlDbType.VarChar)
        };
        int count = db.DataSetFactoryWithPager(DataList1, AspNetPager1, "Pr_Mp4_GetMp4ByFormat", "Pr_Mp4_GetMp4NumByFormat", prams);
        Label1.Text = "共" + count.ToString() + "条";
    }
    protected void AspNetPager1_PageChanged(object src, Wuqi.Webdiyer.PageChangedEventArgs e)
    {
        AspNetPager1.CurrentPageIndex = e.NewPageIndex;
        DataListBind(formatName);
    }
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        string mp4Name = TextBox1.Text.Trim().ToString();
        if (mp4Name != "")
        {
            Response.Redirect("mp4search.aspx?name=" + mp4Name);
        }
        else
        {
            Response.Write("<script>alert(\"请输入关键字！\")</script>");
        }
    }
}
