public IView AddLecture(int courseId, string lectureName)
        {
            if (!this.HasCurrentUser)
            {
                throw new ArgumentException("There is no currently logged in user.");
            }

            if (!this.User.IsInRole(Role.Lecturer))
            {
                throw new AuthorizationFailedException("The current user is not authorized to perform this operation.");
            }

            Course course = this.GetCourseById(courseId);
            // BUG FIXED: add correct name to the lecture
            var lecture = new Lecture(lectureName);
            course.AddLecture(lecture);

            return this.View(course);
        }
Exemple #2
0
 public void AddLecture(Lecture lecture)
 {
     this.Lectures.Add(lecture);
 }
Exemple #3
0
 public void AddLecture(Lecture lecture)
 {
     this.Lectures.Add(lecture);
 }