示例#1
0
        public bool AddRequirement(Skill requirement, int vacancyId)
        {
            var skillExist = _skillLogic.SelectAll().FirstOrDefault(r => r.Name == requirement.Name);

            if (skillExist == null)
            {
                requirement = _skillLogic.Insert(requirement);
            }
            else
            {
                requirement.Id = skillExist.Id;
            }

            try
            {
                return(_vacancyDao.InsertRequirement(requirement, vacancyId) != 0);
            }
            catch
            {
                return(false);
            }
        }
示例#2
0
        public bool AddSkill(Skill skill, int employeeId)
        {
            var skillExist = _skillLogic.SelectAll().FirstOrDefault(s => s.Name == skill.Name);

            if (skillExist == null)
            {
                skill = _skillLogic.Insert(skill);
            }
            else
            {
                skill.Id = skillExist.Id;
            }

            try
            {
                return(_employeeDao.InsertSkill(skill, employeeId) != 0);
            }
            catch
            {
                return(false);
            }
        }