Exemple #1
0
        public JsonResult GetAutoSkills(string Prefix, int empId)
        {
            List <Skill> result;

            if (string.IsNullOrEmpty(Prefix))
            {
                result = skillsbusinessManager.GetUnmappedSkillsByEmpId(empId);
            }
            else
            {
                result = skillsbusinessManager.GetUnmappedSkillsByEmpId(empId);
                result = result.Where(s => s.Name.ToLower().Contains(Prefix.ToLower())).ToList();
            }

            var translatedResult = SkillModel.Translate(result); // to avoid circular reference

            return(Json(translatedResult, JsonRequestBehavior.AllowGet));
        }
Exemple #2
0
        //************************************ Autocomplete *********************************************
        // autocomplete for skills
        public JsonResult GetAutoSkills(string Prefix)
        {
            List <Skill> result;
            List <Skill> all;

            if (string.IsNullOrEmpty(Prefix))
            {
                all    = skillsbusinessManager.GetAll();
                result = all.Except(searchSkills, new IdComparer()).ToList();
            }
            else
            {
                all    = skillsbusinessManager.GetAll();
                result = all.Except(searchSkills, new IdComparer()).ToList();
                result = result.Where(s => s.Name.ToLower().Contains(Prefix.ToLower())).ToList();
            }

            var translatedResult = SkillModel.Translate(result);

            return(Json(translatedResult, JsonRequestBehavior.AllowGet));
        }