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)); }
public async Task <ActionResult> AllDisciplines() { ViewBag.Url = Url.Action("AllDisciplines"); List <Discipline> DisciplineList = await DisciplineWebAPI.GetAllDisciplines(); DisciplineList.ForEach(x => { x.OptionRoute = (int)DisciplineOptionRouteEnum.ALL; x.ShowTeachers = true; }); return(View(DisciplineList)); }
public async Task <ActionResult> AllTeachers(string code) { ViewBag.Url = Url.Action("AllTeachers", "Teacher"); Discipline discipline = await DisciplineWebAPI.GetDisciplineById(code); List <Teacher> TeacherList = await TeacherWebAPI.GetTeachersByDiscipline(code); TeacherList.ForEach(x => { x.ShowDisciplines = false; x.CodeCourse = code; }); TeacherIndexViewModel teacherIndex = new TeacherIndexViewModel { Discipline = discipline, TeacherList = TeacherList }; return(View(teacherIndex)); }
public async Task <ActionResult> AllDisciplines(string code) { ViewBag.Url = Url.Action("AllDisciplines", "Discipline"); Teacher teacher = await TeacherWebAPI.GetTeacherById(code); List <Discipline> DisciplineList = await DisciplineWebAPI.GetDisciplinesByTeacher(code); DisciplineList.ForEach(x => { x.ShowTeachers = false; x.CodeTeacher = code; }); DisciplineIndexViewModel disciplineIndex = new DisciplineIndexViewModel { Teacher = teacher, DisciplineList = DisciplineList }; return(View(disciplineIndex)); }
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)); }