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 mp4Down : System.Web.UI.Page
{
    public mp4films mf = new mp4films();
    public string downSize;
    public int downRecommend, hits;
    public string downTitle, typeName, downFormat,updateTime, downIntro, downUrl;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            if (Request.QueryString["did"] != "")
            {
                int downID =Convert.ToInt32(Request.QueryString["did"].ToString());
                //绑定数据
                GetMp4Data(downID);
                //增加点击数
                mf.AddMp4Hits(downID);
            }
        }
    }
    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>");
        }
    }
    public void GetMp4Data(int DownID)
    {
        SqlDataReader dr = mf.GetMp4DataByDownID(DownID);
        if (dr.Read())
        {
            downTitle = dr["DownTitle"].ToString();
            typeName = dr["TypeName"].ToString();
            downFormat = dr["DownFormat"].ToString();
            downSize = dr["DownSize"].ToString() ;
            hits = Convert.ToInt32(dr["Hits"].ToString());
            downRecommend = Convert.ToInt32(dr["DownRecommend"].ToString());
            updateTime=Convert.ToDateTime(dr["UpdateTime"]).ToString("yyyy-MM-dd");
            downIntro=dr["DownIntro"].ToString();
            downUrl = dr["DownUrl"].ToString();
        }
        dr.Close();
    }

}
