protected Member CreateRejectedCandidate(IEmployer employer, JobAdEntry jobAd, int index) { var member = CreateMember(index); var application = new InternalApplication { ApplicantId = member.Id }; _jobAdApplicationSubmissionsCommand.CreateApplication(jobAd, application); _jobAdApplicationSubmissionsCommand.SubmitApplication(jobAd, application); _jobAdApplicantsCommand.RejectApplicants(employer, jobAd, new[] { member.Id }); return(member); }
public ActionResult RejectCandidates(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")); } // Remove candidates. var statuses = _jobAdApplicantsCommand.RejectApplicants(employer, jobAd, candidateIds); return(BuildModelFromStatus(jobAd, statuses)); } catch (UserException ex) { ModelState.AddModelError(ex, new StandardErrorHandler()); } return(Json(new JsonResponseModel())); }