public ActionResult ReportTemplate()
        {
            var skills = _skillService.GetAllSkills();

            SelectList skillList = new SelectList(skills, "Id", "Subject");

            return(View(skillList));
        }
        public async Task <ActionResult <List <VacancySkillDto> > > GetAllSkills([FromQuery] GetAllSkillsQuery skillsQuery)
        {
            try
            {
                var filter = _mapper.Map <GetAllSkillsFilter>(skillsQuery);
                var skills = await _skillService.GetAllSkills(filter);

                var skillsResponse = _mapper.Map <List <VacancySkillDto> >(skills);
                return(Ok(skillsResponse));
            }
            catch (SkillValidationException exception)
                when(exception.InnerException is NotFoundSubscriptionException)
                {
                    var innerMessage = GetInnerMessage(exception);

                    return(NotFound(innerMessage));
                }
            catch (SkillValidationException exception)
            {
                var innerMessage = GetInnerMessage(exception);

                return(BadRequest(innerMessage));
            }
            catch (SkillServiceException exception)
            {
                return(Problem(exception.Message));
            }
        }
        public IHttpActionResult GetSystemSkills(int page = 1, int count = 15)
        {
            int total;
            var skills = _skillService.GetAllSkills(out total, string.Empty, page, count);
            var model  = skills.Select(x => x.ToModel()).ToList();

            return(RespondSuccess(new { Skills = model, Total = total, Page = page, Count = count }));
        }
示例#4
0
 public SkillViewModel(ISkillService SkillService, INavigationService navigationService)
 {
     _skillService        = SkillService;
     _navigationService   = navigationService;
     skills               = new ObservableCollection <Skill>(_skillService.GetAllSkills());
     AddCommand           = new Command(OnAddCommand);
     LoadCommand          = new Command(OnLoadCommand);
     UpLoadCommand        = new Command(OnUpLoadPhotoCommand);
     SkillSelectedCommand = new Command <Skill>(OnSkillSelectedCommand);
     MessagingCenter.Subscribe <SkillsDetailsViewModel, Skill>
         (this, MessageNames.SkillsChangedMessage, OnSkillsListChange);
 }
示例#5
0
        /// <summary>
        /// Shows list of skills taking pagenumber as argument
        /// </summary>
        /// <param name="page"></param>
        /// <returns></returns>
        public ActionResult Index(int?page)
        {
            //List of skills are ordered by Skill Name
            var skillList = _skillService.GetAllSkills().ToViewModelList().OrderBy(s => s.SkillName);

            //Limited the number of rows per page to 8
            int pageSize   = 8;
            int pageNumber = (page ?? 1);

            ViewBag.CurrentPage = pageNumber;
            return(View(skillList.ToPagedList(pageNumber, pageSize)));
        }
示例#6
0
 public IActionResult Skills()
 {
     try
     {
         var skills = _skillService.GetAllSkills();
         return(Ok(skills));
     }
     catch (Exception exp)
     {
         _logger.LogError(exp.Message);
         return(BadRequest(new { message = "Failed to load skills" }));
     }
 }
示例#7
0
        public IHttpActionResult GetSystemSkills(string search = "", int page = 1, int count = 15)
        {
            int total;

            if (page < 1 || count < 1)
            {
                return(NotFound());
            }

            var skills = _skillService.GetAllSkills(out total, search, page, count);
            var model  = skills.Select(x => x.ToModel(_workContext)).ToList();

            return(Response(new { Success = true, Skills = model, Total = total, Page = page, Count = count }));
        }
示例#8
0
        public async Task <IActionResult> GetAllSkills()
        {
            try
            {
                var skills = await _skillService.GetAllSkills();

                _log.LogInformation($"Returning {skills.Count} skills");
                return(Ok(skills));
            }
            catch (Exception ex)
            {
                _log.LogError($"Something went wrong: {ex}");
                return(StatusCode(500, ex));
            }
        }
示例#9
0
        // GET: api/Skills
        public IHttpActionResult Get()
        {
            var skills = _skillService.GetAllSkills();

            return(Ok(skills));
        }
示例#10
0
        public IActionResult Index()
        {
            var vm = new ResumeViewModel();

            #region Fill data to viewmodel (if it's exist)

            // Get info about current user
            vm.UserInfo = _userInfo;
            var currentStudent = _studentService.GetCurrentStudentByUserInfo(vm.UserInfo.Id);

            //Get current Resume Id
            Resume resume = _resumeService.GetResumeByStudentId(currentStudent.Id);

            //create new resume if it doesn't exist
            if (resume == null)
            {
                _resumeService.CreateResumeForStudent(currentStudent.Id);
            }

            //Fill data to viewmodel
            int resumeId = _resumeService.GetResumeByStudentId(currentStudent.Id).Id;
            vm.ResumeId          = resumeId;
            vm.CurrentResumeStep = _resumeService.GetResumeByStudentId(currentStudent.Id).CurrentStep;

            var stream = _streamService.GetStreamByStudentId(currentStudent.Id);
            if (stream != null)
            {
                vm.StreamFullName = stream.StreamFullName;
            }

            var summary = _summaryService.GetSummaryByResumeId(resumeId);
            if (summary != null)
            {
                vm.Summary = summary.Text;
            }

            string [] existingStudentsSkill = _skillService.GetAllSkillsForStudent(currentStudent.Id).ToArray();
            if (existingStudentsSkill.Length != 0)
            {
                vm.Skills = _skillService.GetAllSkillsForStudent(currentStudent.Id).ToArray();
            }
            else
            {
                //If Student hasn't skills in DB, get the default skills by stream
                vm.Skills = _skillService.GetDefaultSkillsByStream(stream.Id).ToArray();
            }

            vm.ForeignLanguages = _languageService.GetAllForeignLanguagesForResume(resumeId).ToDictionary(x => x.LanguageId, x => x.LanguageLevelId);
            vm.Educations       = _educationService.GetAllEducationsForResume(resumeId).ToArray();
            vm.Courses          = _courseService.GetAllCoursesForResume(resumeId).ToArray();
            vm.Certificates     = _certificateService.GetAllCertificatesForResume(resumeId).ToArray();
            vm.Exams            = _examService.GetAllExamsForResume(resumeId).ToArray();

            WorkExperience[] workExperiences = _workExperienceService.GetWorkExperienceForResume(resumeId).ToArray();
            vm.WorkExperiences = new WorkExperienceViewModel[workExperiences.Length];
            if (workExperiences.Count() != 0)
            {
                for (int i = 0; i < workExperiences.Count(); i++)
                {
                    vm.WorkExperiences[i] = new WorkExperienceViewModel(workExperiences[i]);
                }
            }

            vm.Portfolios      = _portfolioService.GetPortfolioForResume(resumeId).ToArray();
            vm.MilitaryStatus  = _militaryStatusService.GetMilitaryStatusForResume(resumeId);
            vm.Recommendations = _recommendationService.GetAllRecommendationsForResume(resumeId).ToArray();
            vm.AdditionalInfo  = _additionalInfoService.GetAdditionalInfo(resumeId);

            #endregion

            #region Fill data to dropdown lists

            //Get all languages from table Languages
            List <Language> languages = _languageService.GetAllLanguages().ToList();
            languages.Insert(0, languages.First(l => l.Name == "English"));
            var index = languages.FindLastIndex(l => l.Name == "English");
            languages.RemoveAt(index);
            //Fill data to dropdownlist Languages
            vm.Languages = languages;

            //Get all language levels from table LanguageLevels
            List <LanguageLevel> languageLevels = _languageService.GetAllLanguageLevels().ToList();
            languageLevels.Insert(0, new LanguageLevel {
                LevelName = "---", Id = 0
            });
            //Fill data to dropdownlist language levels
            vm.LanguageLevels = languageLevels;

            //Get all skills from table Skills
            vm.SkillList = _skillService.GetAllSkills().ToList();

            //Get all Months, Years from DateService
            vm.Months = _dateService.GetAllMonths();
            vm.Years  = _dateService.GetAllYears().ToList();

            //Fill data to dropdownlist Education Levels
            vm.EducationLevels = _educationService.GetEducationLevels().ToList();

            #endregion

            //TODO: add more other statuses, when they will be implemented
            if (resume != null && resume.Status == ResumeStatuses.Submitted)
            {
                return(RedirectToAction(nameof(ResumeReviewController.Index), "ResumeReview", new { resumeId = resume.Id }));
            }
            else
            {
                return(View("Index", vm));
            }
        }
示例#11
0
 public async Task <IActionResult> GetAllSkills()
 {
     return(Ok(await _skillService.GetAllSkills()));
 }
示例#12
0
        public async Task <IActionResult> EditResume(int resumeId)
        {
            var student = _studentService.GetStudentByResumeId(resumeId);

            ResumeViewModel vm = new ResumeViewModel
            {
                ResumeId         = resumeId,
                UserInfo         = _userInfo,
                StreamFullName   = _streamService.GetStreamByStudentId(student.Id).StreamFullName,
                Summary          = _summaryService.GetSummaryByResumeId(resumeId).Text,
                Skills           = _skillService.GetAllSkillsForStudent(student.Id).ToArray(),
                ForeignLanguages = _languageService.GetAllForeignLanguagesForResume(resumeId).ToDictionary(x => x.LanguageId, x => x.LanguageLevelId),
                Educations       = _educationService.GetAllEducationsForResume(resumeId).ToArray(),
                Courses          = _courseService.GetAllCoursesForResume(resumeId).ToArray(),
                Certificates     = _certificateService.GetAllCertificatesForResume(resumeId).ToArray(),
                Exams            = _examService.GetAllExamsForResume(resumeId).ToArray(),
                Portfolios       = _portfolioService.GetPortfolioForResume(resumeId).ToArray(),
                MilitaryStatus   = _militaryStatusService.GetMilitaryStatusForResume(resumeId),
                AdditionalInfo   = _additionalInfoService.GetAdditionalInfo(resumeId),
                Recommendations  = _recommendationService.GetAllRecommendationsForResume(resumeId).ToArray()
            };

            WorkExperience[] workExperiences = _workExperienceService.GetWorkExperienceForResume(resumeId).ToArray();
            vm.WorkExperiences = new WorkExperienceViewModel[workExperiences.Length];
            if (workExperiences.Count() != 0)
            {
                for (int i = 0; i < workExperiences.Count(); i++)
                {
                    vm.WorkExperiences[i] = new WorkExperienceViewModel(workExperiences[i]);
                }
            }
            #region Fill data to dropdown lists

            //Get all languages from table Languages
            List <Language> languages = _languageService.GetAllLanguages().ToList();
            languages.Insert(0, languages.First(l => l.Name == "English"));
            var index = languages.FindLastIndex(l => l.Name == "English");
            languages.RemoveAt(index);
            //Fill data to dropdownlist Languages
            vm.Languages = languages;

            //Get all language levels from table LanguageLevels
            List <LanguageLevel> languageLevels = _languageService.GetAllLanguageLevels().ToList();
            languageLevels.Insert(0, new LanguageLevel {
                LevelName = "---", Id = 0
            });
            //Fill data to dropdownlist language levels
            vm.LanguageLevels = languageLevels;

            //Get all skills from table Skills
            vm.SkillList = _skillService.GetAllSkills().ToList();

            //Get all Months, Years from DateService
            vm.Months = _dateService.GetAllMonths();
            vm.Years  = _dateService.GetAllYears().ToList();

            //Fill data to dropdownlist Education Levels
            vm.EducationLevels = _educationService.GetEducationLevels().ToList();

            #endregion


            return(View(vm));
        }
        public async Task <IActionResult> GetAllSkill()
        {
            ServiceResponse <List <GetSkillDto> > response = await _skillService.GetAllSkills();

            return(Ok(response));
        }
示例#14
0
 private void OnSkillsListChange(SkillsDetailsViewModel sender, Skill skill)
 {
     skills = new ObservableCollection <Skill>(_skillService.GetAllSkills());
 }
示例#15
0
        /// <summary>
        /// Retrieve all skills
        /// </summary>
        /// <returns>IEnumerable<SkillViewModel></returns>
        public IEnumerable <SkillViewModel> EmployeeRatings()
        {
            var skillList = _skillService.GetAllSkills().ToViewModelList();

            return(skillList);
        }