Ejemplo n.º 1
0
        public ActionResult ShortlistCandidates(Guid jobAdId, Guid[] candidateIds)
        {
            try
            {
                // Look for the jobAd.

                var employer = CurrentEmployer;

                var jobAd = _jobAdsQuery.GetJobAd <JobAdEntry>(jobAdId);
                if (jobAd == null)
                {
                    return(JsonNotFound("job ad"));
                }

                // Add candidates.

                var statuses = _jobAdApplicantsCommand.ShortlistApplicants(employer, jobAd, candidateIds);

                return(BuildModelFromStatus(jobAd, statuses));
            }
            catch (UserException ex)
            {
                ModelState.AddModelError(ex, new StandardErrorHandler());
            }

            return(Json(new JsonResponseModel()));
        }
Ejemplo n.º 2
0
        protected Member CreateShortlistedCandidate(IEmployer employer, JobAdEntry jobAd, int index)
        {
            var member = CreateMember(index);

            _jobAdApplicantsCommand.ShortlistApplicants(employer, jobAd, new[] { member.Id });
            return(member);
        }
Ejemplo n.º 3
0
        private IList <Member> CreateShortlistedCandidates(int count, IEmployer employer, JobAdEntry jobAd)
        {
            var members = new List <Member>();

            for (var index = 0; index < count; ++index)
            {
                var member = CreateMember(index);
                _jobAdApplicantsCommand.ShortlistApplicants(employer, jobAd, new[] { member.Id });
                members.Add(member);
            }

            return(members);
        }