Esempio n. 1
0
        protected InternalApplication AssertInternalApplication(Guid applicationId, JobAdEntry jobAd, Guid applicantId, bool isPending, bool hasSubmitted, string coverLetterText, Action <InternalApplication> assertApplication)
        {
            var application = _memberApplicationsQuery.GetInternalApplication(applicationId);

            AssertApplication(application, applicationId, jobAd.Id, applicantId, a => AssertInternalApplication(a, isPending, coverLetterText, assertApplication));
            Assert.AreEqual(hasSubmitted, _jobAdApplicationSubmissionsQuery.HasSubmittedApplication(applicantId, jobAd.Id));
            return(application);
        }
Esempio n. 2
0
        private void AssertNoApplication(IEmployer employer, Guid applicantId, params IJobAd[] jobAds)
        {
            Assert.AreEqual(0, _jobAdApplicantsQuery.GetApplications(employer, applicantId).Count);

            foreach (var jobAd in jobAds)
            {
                Assert.IsFalse(_jobAdApplicationSubmissionsQuery.HasSubmittedApplication(applicantId, jobAd.Id));
            }

            Assert.AreEqual(0, _jobAdApplicationSubmissionsQuery.GetSubmittedApplicationJobAdIds(applicantId).Count);
            Assert.AreEqual(0, _jobAdApplicationSubmissionsQuery.GetSubmittedApplicationJobAdIds(applicantId, from j in jobAds select j.Id).Count);
        }
Esempio n. 3
0
 private MemberJobAdView GetMemberJobAdView(IMember member, JobAd jobAd)
 {
     return(new MemberJobAdView(
                jobAd,
                _jobAdProcessingQuery.GetJobAdProcessing(jobAd),
                GetContactDetails(_employersQuery.GetEmployer(jobAd.PosterId), jobAd),
                GetEmployerCompanyName(jobAd),
                member != null && _jobAdViewsQuery.HasViewedJobAd(member.Id, jobAd.Id),
                member != null && _jobAdApplicationSubmissionsQuery.HasSubmittedApplication(member.Id, jobAd.Id),
                member != null && _jobAdFlagListsQuery.IsFlagged(member, jobAd.Id),
                member != null && _jobAdFoldersQuery.IsInMobileFolder(member, jobAd.Id)));
 }
Esempio n. 4
0
        private InternalApplication CreateApplication(Guid memberId, Guid jobAdId, string coverLetterText, Action <InternalApplication> setApplication)
        {
            // Check that the job hasn't already been applied for.

            if (_jobAdApplicationSubmissionsQuery.HasSubmittedApplication(memberId, jobAdId))
            {
                throw new AlreadyAppliedException();
            }

            // Create the application.

            var application = new InternalApplication
            {
                PositionId      = jobAdId,
                ApplicantId     = memberId,
                CoverLetterText = coverLetterText,
            };

            setApplication(application);

            return(application);
        }
Esempio n. 5
0
        Guid IInternalApplicationsCommand.Submit(AnonymousContact contact, IJobAd jobAd, Guid fileReferenceId)
        {
            // Check that the job hasn't already been applied for.

            if (_jobAdApplicationSubmissionsQuery.HasSubmittedApplication(contact.Id, jobAd.Id))
            {
                throw new AlreadyAppliedException();
            }

            // Create the application.

            var application = new InternalApplication
            {
                PositionId   = jobAd.Id,
                ApplicantId  = contact.Id,
                ResumeFileId = fileReferenceId,
            };

            // Submit it.

            _jobAdApplicationSubmissionsCommand.CreateApplication(jobAd, application);
            _jobAdApplicationSubmissionsCommand.SubmitApplication(jobAd, application);
            return(application.Id);
        }