Beispiel #1
0
        public bool ChangeSkills(ChangeSkills skills)
        {
            var user            = userRepository.GetByName(UserInfo.UserName);
            var userInfo        = candidateRepository.GetById(user.Result.Id);
            var candidateSkills = this.candidateSkillReadRepository.GetManyByIds(new int[] { userInfo.Id });

            try
            {
                candidateSkills.ToList().ForEach(x => { candidateSkillDeleteRepository.Delete(x); });
                candidateSkillRepository.Save();

                var skillsASd = skills.Skills.Select(x => new CandidateSkill {
                    CandidateId = userInfo.Id, SkillId = x
                }).ToList();

                skillsASd.ForEach(x => candidateSkillRepository.Add(x));
                candidateSkillRepository.Save();
            }
            catch (Exception ex)
            {
                return(false);
            }

            return(true);
        }
Beispiel #2
0
        public IActionResult ChangeSkills([FromBody] ChangeSkills changeSkills)
        {
            if (ModelState.IsValid)
            {
                var response = this.positionsApplicationService.ChangeSkills(changeSkills);
                return(Json(response));
            }

            return(Json(false));
        }
Beispiel #3
0
        public IActionResult ChangeSkills([FromBody] ChangeSkills changeSkills)
        {
            if (ModelState.IsValid)
            {
                skillsService.ChangeSkills(changeSkills);

                return(Json(true));
            }

            return(Json(false));
        }
        public bool ChangeSkills(ChangeSkills changePositionRequiredSkills)
        {
            try
            {
                var position = this.positionsReadRepository.GetById(changePositionRequiredSkills.PositionId);

                position.PositionSkill = changePositionRequiredSkills.RequiredSkills.Select(x => new PositionSkill()
                {
                    PositionId = changePositionRequiredSkills.PositionId,
                    SkillId    = x
                }).ToList();

                this.positionsUpdateRepository.Update(position);
                this.companiesRepository.Save();

                return(true);
            }
            catch (Exception ex)
            {
                this.logger.LogError(ex.InnerException, JsonConvert.SerializeObject(changePositionRequiredSkills));
                throw ex;
            }
        }