Exemplo n.º 1
0
        public async Task <ShowTeachersAdminView> ShowTeachers()
        {
            List <Teacher> teachers = await _teacherRepository.GetAllTeachersByCompany(ApplicationConstants.CurrentCompanyId);

            ShowTeachersAdminView result = _teacherMapper.MapTeacherModelsToViewModels(teachers);

            return(result);
        }
Exemplo n.º 2
0
        public ShowTeachersAdminView MapTeacherModelsToViewModels(List <Teacher> model)
        {
            var viewModel = new ShowTeachersAdminView();

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

                viewModel.Teachers.Add(viewModelItem);
            }

            return(viewModel);
        }
Exemplo n.º 3
0
        public async Task <IActionResult> ShowTeachers()
        {
            ShowTeachersAdminView result = await _adminService.ShowTeachers();

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