Ejemplo n.º 1
0
        public ActionResult Edit()
        {
            string userId          = User.Identity.GetUserId();
            var    employeeProfile = _employeeService.FindEmployee(userId);

            if (employeeProfile == null)
            {
                return(View("Error"));
            }

            var editModel = new EmployeeProfileViewModel()
            {
                Age = employeeProfile.Age, AboutMe = employeeProfile.AboutMe
            };

            editModel.SelectedSkills = employeeProfile.Skills.Select(p => p.Id).ToArray();

            ViewBag.Skills = GetCategories();
            return(View(editModel));
        }
Ejemplo n.º 2
0
        public ActionResult Jobs(int[] skillsId, string keyWords, int priceFrom = 0)
        {
            int[] employeeSkills = null;

            if (User.Identity.IsAuthenticated)
            {
                string userId         = User.Identity.GetUserId();
                bool   employeeExists = _employeeService.EmployeeProfileExists(userId);

                if (employeeExists)
                {
                    var employee = _employeeService.FindEmployee(userId);
                    employeeSkills = employee.Skills.Select(p => p.Id).ToArray();
                }
            }

            var jobs = _jobService.FindRelevantJobs(skillsId, keyWords, priceFrom, employeeSkills);

            return(Json(jobs));
        }