Example #1
0
        //Display course information
        // GET: /Courses/CourseInfo
        public ActionResult CourseInfo(int courseId)
        {
            logManager.AddEventLog("CoursesController => CourseInfo ActionResult called(GET)", "ActionResult");
            var course = coursesManager.GetSpecificCourse(courseId);

            ViewBag.Lector = coursesManager.GetLectorInfo(course);
            string currentUserId = User.Identity.GetUserId();

            ViewBag.UserIsSignedToCourse = coursesManager.UserIsSignedToCourse(courseId, currentUserId);
            ViewBag.UserIsLector         = false;
            ViewBag.CourseStatusEnded    = false;

            if (course.CourseStatus == Course.Status.Ended)
            {
                ViewBag.CourseStatusEnded = true;
            }

            if (course.LectorId == currentUserId)
            {
                ViewBag.UserIsLectorOfThisCourse = true;
            }
            else
            {
                ViewBag.UserIsLectorOfThisCourse = false;
            }

            return(View(course));
        }