コード例 #1
0
        public async Task <ActionResult> DetailsCourse(string code)
        {
            ViewBag.Url = Url.Action("AllCourses");
            DetailsCourseViewModel detailsCourse = new DetailsCourseViewModel();
            var DisciplineList = await DisciplineWebAPI.GetDisciplinesByCourse(code);

            DisciplineList.ForEach(x =>
            {
                x.ShowTeachers      = false;
                x.CourseOptionRoute = (int)CourseOptionRouteEnum.INDIVIDUAL;
                x.CodeCourse        = code;
            });

            detailsCourse.Course = await CourseWebAPI.GetCourseById(code);

            detailsCourse.DisciplineList = DisciplineList;
            var TeacherList = await TeacherWebAPI.GetTeachersByCourse(code);

            TeacherList.ForEach(x =>
            {
                x.ShowDisciplines = false;
                x.CodeCourse      = code;
            });
            detailsCourse.TeacherList = TeacherList;
            return(View(detailsCourse));
        }
コード例 #2
0
        public async Task <ActionResult> AllDisciplines(string code, int option)
        {
            ViewBag.Url = Url.Action("AllCourses");
            Course course = await CourseWebAPI.GetCourseById(code);

            List <Discipline> DisciplineList = await DisciplineWebAPI.GetDisciplinesByCourse(code);

            DisciplineList.ForEach(x =>
            {
                x.ShowTeachers      = false;
                x.CourseOptionRoute = option;
                x.CodeCourse        = code;
            });
            DisciplineIndexViewModel disciplineIndex = new DisciplineIndexViewModel
            {
                Course         = course,
                DisciplineList = DisciplineList
            };

            return(View(disciplineIndex));
        }