コード例 #1
0
        public async Task <IActionResult> Index()
        {
            var model = new GetStudyGroupsViewModel();

            model.Input.AcademicSubjectId = null;
            model.Input.TeacherId         = null;
            var resultGetTeachers = await _teacherService.GetTeachers(new GetTeachersInput());

            if (resultGetTeachers.IsSuccessed)
            {
                ViewBag.Teachers =
                    new SelectList(resultGetTeachers.Value.Items, "Id", "FullName");
            }
            var resultGetAcademicSubjects = await _academicSubjectService.GetAcademicSubjects(new GetAcademicSubjectsInput());

            if (resultGetAcademicSubjects.IsSuccessed)
            {
                ViewBag.AcademicSubjects =
                    new SelectList(resultGetAcademicSubjects.Value.Items, "Id", "Name");
            }
            var result = await _studyGroupService.GetStudyGroups(model.Input);

            if (result.IsSuccessed)
            {
                model.Value = result.Value;
            }
            return(View(model));
        }
コード例 #2
0
        public async Task <IActionResult> Index()
        {
            var model  = new GetInfoModel();
            var result = await _teacherService.GetTeachers(new GetTeachersInput());

            if (result.IsSuccessed)
            {
                model.Value = result.Value;
            }
            return(View(model));
        }