Esempio n. 1
0
        public ActionResult AddLecture1(Lecture lecture)
        {
            lectureService.InsertLecture(lecture);
            var lectureId = lectureService.GetLectureByNameAndCourseId(lecture.Title, lecture.CourseId).Id;

            if (Session["file"] as IEnumerable <HttpPostedFileBase> != null)
            {
                foreach (var image in Session["file"] as IEnumerable <HttpPostedFileBase> )
                {
                    imageService.UploadImageToDB(image, lectureId);
                }
            }

            return(RedirectToAction("Index", "Home"));
        }
 public ActionResult AddLecture(Lecture lecture)
 {
     lectureService.InsertLecture(lecture);
     return(RedirectToAction("LectureList", "Lecture"));
 }