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

        if (LectureUpload.FileName != null)
        {
            filename = LectureUpload.FileName;
            LectureUpload.SaveAs(Server.MapPath("~/LMS/Lectures/" + filename));
        }
        DateTime          dt          = Calendar1.SelectedDate;
        string            lectretitle = LectureTitle.Text;
        Lecture_Notes_tbl lecture     = new Lecture_Notes_tbl {
            Lecture_Title = lectretitle, Lecture_Path = filename, CourseID = int.Parse(Request.QueryString["course"]), LectureDate = dt
        };
        DBFunctions db = new DBFunctions();

        db.addlectures(lecture);
        Response.Redirect("UploadAssignments.aspx?course=" + Request.QueryString["course"] + "&tab=Lectures");
    }
    protected void lectureouploadbtn_Click(object sender, EventArgs e)
    {
       string filename = "";
       if (LectureUpload.FileName != null)
        {
            filename = LectureUpload.FileName;
            LectureUpload.SaveAs(Server.MapPath("~/LMS/Lectures/" + filename));
        }
       DateTime dt = Calendar1.SelectedDate;
       string lectretitle = LectureTitle.Text;
       Lecture_Notes_tbl lecture = new Lecture_Notes_tbl { Lecture_Title = lectretitle, Lecture_Path = filename, CourseID = int.Parse(Request.QueryString["course"]),LectureDate=dt };
       DBFunctions db = new DBFunctions();
       db.addlectures(lecture);
       Response.Redirect("UploadAssignments.aspx?course=" + Request.QueryString["course"] + "&tab=Lectures");

    }
예제 #3
0
 public void addlectures(Lecture_Notes_tbl lecture)
 {
     db = new CollegeERPDBEntities();
     db.Lecture_Notes_tbl.Add(lecture);
     db.SaveChanges();
 }