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 see : System.Web.UI.Page
{
    mp4films mf = new mp4films();
    public int hits;
    public string mp4ID, mp4Title, mp4Size, mp4Url, mp4Intro;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            if (Request.QueryString["mid"] != null)
            {
                mp4ID = Request.QueryString["mid"].ToString();
                //绑定数据
                GetMp4LookData(Convert.ToInt32(mp4ID));
                //增加点击数
                mf.AddMp4LookHits(Convert.ToInt32(mp4ID));
            }
        }
    }
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        string mp4Name = TextBox1.Text.Trim().ToString();
        if (mp4Name != "")
        {
            Response.Redirect("mp4search.aspx?name=" + mp4Name);
        }
        else
        {
            TextBox1.Text = "请输入关键字!";
            //Response.Write("<script>alert(\"请输入关键字！\")</script>");
        }
    }
    public void GetMp4LookData(int Mp4ID)
    {
        SqlDataReader dr = mf.GetMp4LookDataByMp4ID(Mp4ID);
        if (dr.Read())
        {
            mp4Title = dr["Mp4Title"].ToString();
            mp4Size = dr["Mp4Size"].ToString();
            hits = Convert.ToInt32(dr["Hits"].ToString());
            mp4Url = dr["Mp4Url"].ToString();
            mp4Intro = dr["Mp4Intro"].ToString();
        }
        dr.Close();
    }
}
