public async Task <List <FilterViewModel> > getFilters()
        {
            List <Employee> employees = await _employeeRepo.GetEmployees();

            List <Skill> skills = await _skillRepo.GetSkills();

            List <Certification> certifications = await _certificationRepo.GetCertifications();

            List <RoleType> roles = await _roleRepo.getRoles();

            List <FilterViewModel> filters = new List <FilterViewModel>();

            foreach (Employee employee in employees)
            {
                filters.Add(new FilterViewModel(employee));
            }
            foreach (Skill skill in skills)
            {
                filters.Add(new FilterViewModel(skill));
            }
            foreach (Certification certification in certifications)
            {
                filters.Add(new FilterViewModel(certification));
            }
            foreach (RoleType role in roles)
            {
                filters.Add(new FilterViewModel(role));
            }
            return(filters);
        }
Пример #2
0
        public Task <AvailableCertificationsDTO> Handle(GetAvailableCertificationsQuery request, CancellationToken cancellationToken)
        {
            var courses        = _certificationRepository.GetCourses();
            var exams          = _certificationRepository.GetExams();
            var certifications = _certificationRepository.GetCertifications();

            var coursesDTO = new List <StudentCourseDTO>();

            coursesDTO = courses.Select(c => new StudentCourseDTO()
            {
                CourseId = c.Id, CourseTitle = c.Title
            }).ToList();
            var examsDTO = new List <StudentExamDTO>();

            examsDTO = exams.Select(e => new StudentExamDTO()
            {
                ExamId = e.Id, ExamTitle = e.ExamNumber + " - " + e.ExamDescription
            }).ToList();
            var certificationsDTO = new List <StudentCertificationDTO>();

            certificationsDTO = certifications.Select(c => new StudentCertificationDTO()
            {
                CertificationId = c.Id, CertificationTitle = c.CertificationCredential + " - " + c.CertificationDescription
            }).ToList();

            AvailableCertificationsDTO availableCertificationDTO = new AvailableCertificationsDTO()
            {
                Courses        = coursesDTO,
                Exams          = examsDTO,
                Certifications = certificationsDTO
            };

            return(Task.FromResult(availableCertificationDTO));
        }
Пример #3
0
        public async Task <List <CertificationViewModel> > GetCertifications()
        {
            List <Certification> certifications = await _repo.GetCertifications();

            List <CertificationViewModel> certificationViewModels = new List <CertificationViewModel>();

            foreach (Certification certification in certifications)
            {
                CertificationViewModel certificationViewModel = new CertificationViewModel
                {
                    CertificationId   = certification.CertificationId,
                    CertificationName = certification.CertificationName,
                    CertCategoryId    = certification.CertCategory.CertCategoryId,
                    CertCategoryName  = certification.CertCategory.CertCategoryName
                };
                certificationViewModels.Add(certificationViewModel);
            }
            return(certificationViewModels);
        }