예제 #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> AllTeachers(string code)
        {
            ViewBag.Url = Url.Action("AllTeachers", "Teacher");
            Course course = await CourseWebAPI.GetCourseById(code);

            List <Teacher> TeacherList = await TeacherWebAPI.GetTeachersByCourse(code);

            TeacherList.ForEach(x =>
            {
                x.ShowDisciplines = false;
                x.CodeCourse      = code;
            });
            TeacherIndexViewModel teacherIndex = new TeacherIndexViewModel
            {
                Course      = course,
                TeacherList = TeacherList
            };

            return(View(teacherIndex));
        }
예제 #3
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));
        }