コード例 #1
0
ファイル: AdminService.cs プロジェクト: EldarMamishev/ITT
        public async Task <ShowStudentsAdminView> ShowStudents()
        {
            List <Student> teachers = await _studentRepository.GetAllStudentsByCompany(ApplicationConstants.CurrentCompanyId);

            ShowStudentsAdminView result = _studentMapper.MapStudentModelsToViewModels(teachers);

            return(result);
        }
コード例 #2
0
        public ShowStudentsAdminView MapStudentModelsToViewModels(List <Student> model)
        {
            var viewModel = new ShowStudentsAdminView();

            foreach (Student teacher in model)
            {
                var viewModelItem = new StudentShowStudentsAdminViewItem();
                viewModelItem.UserName = teacher.UserName;
                viewModelItem.FullName = $"{teacher.LastName} {teacher.FirstName} {teacher.MiddleName}";

                viewModel.Students.Add(viewModelItem);
            }

            return(viewModel);
        }
コード例 #3
0
        public async Task <IActionResult> ShowStudents()
        {
            ShowStudentsAdminView result = await _adminService.ShowStudents();

            return(View(viewName: "Students/Students", result));
        }