Ejemplo n.º 1
0
    protected void BtnAddVideo_Click(object sender, EventArgs e)
    {
        if (!this.chkYes.Checked)
        {
            RegisterStartupScript("alertMessage", "<script>alert('请确认你的文件符合Topfo的上传条款,请勾上最下方复选框!'); </script>");
            return;
        }
        DateTime dt = DateTime.Now;
        //string result = Tz888.Common.FileHelper.UploadLargeFile(Telerik.WebControls.RadUploadContext.Current, "y", dt, ".wmv,.rm", 20480000);
        string result = Tz888.Common.FileHelper.UploadLargeFile(Telerik.WebControls.RadUploadContext.Current, Page.User.Identity.Name.ToString(), dt, ".wmv,.rm", 20480000);

        switch (result)
        {
        case "1": Response.Write("<script>alert('文件超过指定大小');location.href='UpdateVideo.aspx';</script>"); Response.End(); break;

        case "2": Response.Write("<script>alert('只允许上传.wmv,.rm类型的文件');location.href='UpdateVideo.aspx';</script>"); Response.End(); break;

        case "3": Response.Write("<script>alert('未上传成功');location.href='UpdateVideo.aspx';</script>"); Response.End(); break;
        }
        if (result != "")
        {
            Tz888.Model.TPVideo TPVideoModel = new Tz888.Model.TPVideo();
            TPVideoModel.infoID       = Convert.ToInt64(Request.QueryString["id"].ToString());
            TPVideoModel.Title        = this.txtTitle.Value.Trim();
            TPVideoModel.publishT     = System.DateTime.Now;
            TPVideoModel.Descript     = "";
            TPVideoModel.InfoCode     = "Video";
            TPVideoModel.infotypeID   = "Video";
            TPVideoModel.LoginName    = Page.User.Identity.Name.ToString();
            TPVideoModel.subTitle     = this.txtTitle.Value.Trim();
            TPVideoModel.HtmlURL      = ViewState["strSavePath"].ToString() + result;
            TPVideoModel.MiniatureUrl = ViewState["strSavePath"].ToString() + result.Substring(0, result.IndexOf(".", 0)) + ".jpg";
            TPVideoModel.Author       = this.txtAuthor.Value.Trim();
            if (this.txtAuthor.Value.Trim() == "请填写该视频的版权所有者")
            {
                TPVideoModel.Author = "";
            }
            TPVideoModel.Origin         = this.hidradioType.Value.Trim();
            TPVideoModel.Content        = Tz888.Common.Utility.PageValidate.TxtToHtml(this.txtContent.Value.Trim());
            TPVideoModel.ProvinceID     = this.ZoneSelectControl1.ProvinceID.Trim();
            TPVideoModel.CityID         = this.ZoneSelectControl1.CityID.Trim();
            TPVideoModel.CountyID       = this.ZoneSelectControl1.CountyID.Trim();
            TPVideoModel.IsRedirect     = 0;
            TPVideoModel.RedirectUrl    = "";
            TPVideoModel.Created        = System.DateTime.Now;
            TPVideoModel.Createby       = Page.User.Identity.Name.ToString();
            TPVideoModel.strRemark      = "";
            TPVideoModel.Summary        = "";
            TPVideoModel.KeyWord        = this.txtKeyWord.Value.Trim();
            TPVideoModel.AuditingRemark = "";

            Tz888.SQLServerDAL.TPVideo tpm = new Tz888.SQLServerDAL.TPVideo();
            bool infoID = tpm.UpdateVideoMess(TPVideoModel);
            if (infoID == true)
            {
                Response.Redirect("VideoSuccess.aspx");
            }
            else
            {
                RegisterStartupScript("alertMessage", "<script>alert('更新失败!'); </script>");
            }
        }
    }
Ejemplo n.º 2
0
 /// <summary>
 ///  更新视频信息
 /// </summary>
 public bool UpdateVideoMess(Tz888.Model.TPVideo model)
 {
     return(dal.UpdateVideoMess(model));
 }
Ejemplo n.º 3
0
 public long InsertVideo(Tz888.Model.TPVideo model)
 {
     return(dal.InsertVideo(model));
 }
Ejemplo n.º 4
0
 /// <summary>
 ///  添加视频信息
 /// </summary>
 public bool InsertVideoMess(Tz888.Model.TPVideo model)
 {
     return(dal.InsertVideoMess(model));
 }