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 mp4Type : System.Web.UI.Page
{
    DataBaseLayer db = new DataBaseLayer();
    public mp4films mf = new mp4films();
    public int iTypeID;
    protected void Page_Load(object sender, EventArgs e)
    {
        string sTypeID = Request.QueryString["tid"].ToString();
        if (sTypeID != "")
        {
            iTypeID = Convert.ToInt32(sTypeID);
            DataListBind(iTypeID);
        }

    }
    public void DataListBind(int tid)
    {
        SqlParameter[] prams ={
            db.ParamBuilder("@TypeID",tid,SqlDbType.Int)
        };
        int count = db.DataSetFactoryWithPager(DataList1, AspNetPager1, "Pr_Mp4_GetMp4ByType", "Pr_Mp4_GetMp4NumByType", prams);
        Label1.Text = "共" +count.ToString() + "条";
    }
    protected void AspNetPager1_PageChanged(object src, Wuqi.Webdiyer.PageChangedEventArgs e)
    {
        AspNetPager1.CurrentPageIndex = e.NewPageIndex;
        DataListBind(iTypeID);
    }
    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>");
        }
    }
}
