protected void Uploadvideobtn_Click(object sender, EventArgs e)
    {
        string filename = "";

        if (Videoupload.FileName != null)
        {
            filename = Videoupload.FileName;
            Videoupload.SaveAs(Server.MapPath("~/LMS/Videos/" + filename));
        }

        //ThumbCreator.CreateThumb(Server.MapPath("~/LMS/Videos/" + filename),"testthumb",10.0);
        // return;
        string Thumbnail = DateTime.Now.Millisecond + "_thumbnail1.png";



        string duration = GetThumbnail("Videos/" + filename, "Videos/Thumbnails/" + Thumbnail);
        string title    = videoTitle.Text;
        string desc     = Description.Text;
        int    crsid    = int.Parse(Request.QueryString["course"]);

        Video_Lecture_tbl videolect = new Video_Lecture_tbl {
            VideoPath = filename, Duration = duration, Thumbnails = Thumbnail, CourseID = crsid, Description = desc, Video_Title = title, AddDate = DateTime.Now.Date
        };
        DBFunctions db = new DBFunctions();

        db.addvideos(videolect);
        Response.Redirect("UploadAssignments.aspx?course=" + Request.QueryString["course"] + "&tab=videos");
    }
    protected void Uploadvideobtn_Click(object sender, EventArgs e)
    {

        
        string filename = "";
        if (Videoupload.FileName != null)
        {
            filename = Videoupload.FileName;
            Videoupload.SaveAs(Server.MapPath("~/LMS/Videos/" + filename));
        }

        //ThumbCreator.CreateThumb(Server.MapPath("~/LMS/Videos/" + filename),"testthumb",10.0);
       // return;
        string Thumbnail = DateTime.Now.Millisecond+"_thumbnail1.png";



        string duration = GetThumbnail("Videos/" + filename, "Videos/Thumbnails/" + Thumbnail);
        string title = videoTitle.Text;
        string desc = Description.Text;
        int crsid = int.Parse(Request.QueryString["course"]);

        Video_Lecture_tbl videolect= new Video_Lecture_tbl {VideoPath=filename,Duration=duration,Thumbnails=Thumbnail,CourseID=crsid,Description=desc,Video_Title=title,AddDate=DateTime.Now.Date };
        DBFunctions db = new DBFunctions();
        db.addvideos(videolect);
        Response.Redirect("UploadAssignments.aspx?course=" + Request.QueryString["course"] + "&tab=videos");
    }
Ejemplo n.º 3
0
 public void addvideos(Video_Lecture_tbl vid)
 {
     db = new CollegeERPDBEntities();
     db.Video_Lecture_tbl.Add(vid);
     db.SaveChanges();
 }