Beispiel #1
0
        string IExternalJobAdsQuery.GetRedirectName(MemberJobAdView jobAd)
        {
            //return the company name for JXT; return the integrator use name otherwise
            if (jobAd.Integration.IntegratorUserId == _jxtIntegratorUserId)
            {
                return(jobAd.ContactDetails.CompanyName);
            }

            return(_integrationQuery.GetIntegrationSystem <Ats>(
                       _integrationQuery.GetIntegratorUser(jobAd.Integration.IntegratorUserId.Value).IntegrationSystemId).
                   Name);
        }
Beispiel #2
0
 protected JobAdModel GetJobAdModel(IMember member, MemberJobAdView jobAd, IEmployer jobPoster)
 {
     return(new JobAdModel
     {
         JobAd = jobAd,
         DistinctViewedCount = _jobAdViewsQuery.GetDistinctViewedCount(jobAd.Id),
         JobPoster = jobPoster,
         Applicant = GetApplicantModel(member),
         SuggestedJobs = GetSuggestedJobs(member, jobAd),
         CurrentSearch = MemberContext.CurrentSearch,
         ContactedLastWeek = _cacheManager.GetCachedItem <FeaturedStatistics>(HttpContext.Cache, CacheKeys.FeaturedStatistics).MemberAccesses,
         IntegratorName = jobAd.Integration.IntegratorUserId == null ? string.Empty : _externalJobAdsQuery.GetRedirectName(jobAd),
         Folders = GetFoldersModel(),
         Status = new JobAdStatusModel(),
         OrganisationCssFile = HttpContext.GetOrganisationJobAdCssFile(jobPoster.Organisation.Id),
     });
 }
Beispiel #3
0
        private JobAdFeedElement GetJobAdFeed(MemberJobAdView jobAd, IDictionary <Guid, int> credits, IDictionary <Guid, Guid?> affiliateIds)
        {
            const string method = "GetJobAdFeed";

            try
            {
                var viewJobAdUrl  = jobAd.GenerateJobAdUrl();
                var applyJobAdUrl = jobAd.GenerateJobAdUrl();

                Employer employer = null;

                int credit;
                if (!credits.TryGetValue(jobAd.PosterId, out credit))
                {
                    employer = _employersQuery.GetEmployer(jobAd.PosterId);
                    credit   = GetEmployerCredit(employer);
                    credits[jobAd.PosterId] = credit;
                }

                Guid?affiliateId;
                if (!affiliateIds.TryGetValue(jobAd.PosterId, out affiliateId))
                {
                    if (employer == null)
                    {
                        employer = _employersQuery.GetEmployer(jobAd.PosterId);
                    }
                    affiliateId = employer.Organisation.AffiliateId;
                    affiliateIds[jobAd.PosterId] = affiliateId;
                }

                // Only add the job ad if it is not associated with an affiliate.

                if (affiliateId != null)
                {
                    return(null);
                }

                return(jobAd.Map(viewJobAdUrl.AbsoluteUri, applyJobAdUrl.AbsoluteUri, credit > 0));
            }
            catch (Exception ex)
            {
                EventSource.Raise(Event.Error, method, "Cannot get the job ad feed for job ad '" + jobAd.Id + "'.", ex, new StandardErrorHandler(), Event.Arg("jobAdId", jobAd.Id));
                return(null);
            }
        }
Beispiel #4
0
        public static JobAdFeedElement Map(this MemberJobAdView jobAd, string viewJobAdUrl, string applyJobAdUrl, bool featured)
        {
            return(new JobAdFeedElement
            {
                ApplyJobAdUrl = applyJobAdUrl,
                ViewJobAdUrl = viewJobAdUrl,
                Featured = featured,
                BulletPoints = jobAd.Description.BulletPoints == null ? null : jobAd.Description.BulletPoints.ToArray(),
                ContactDetails = jobAd.ContactDetails == null
                    ? null
                    : new ContactDetails {
                    FirstName = jobAd.ContactDetails.FirstName, LastName = jobAd.ContactDetails.LastName, EmailAddress = jobAd.ContactDetails.EmailAddress, FaxNumber = jobAd.ContactDetails.FaxNumber, PhoneNumber = jobAd.ContactDetails.PhoneNumber, SecondaryEmailAddresses = jobAd.ContactDetails.SecondaryEmailAddresses
                },
                RecruiterCompanyName = jobAd.ContactDetails == null
                    ? null
                    : jobAd.ContactDetails.CompanyName,
                Content = jobAd.Description.Content,
                ExternalApplyUrl = jobAd.Integration.ExternalApplyUrl,
                ExternalReferenceId = jobAd.Integration.ExternalReferenceId,

                // Explicitly do not output the status to the feed.

                Status = null,

                Id = jobAd.Id,
                EmployerCompanyName = string.IsNullOrEmpty(jobAd.Description.CompanyName) ? null : jobAd.Description.CompanyName,
                Industries = jobAd.Description.Industries != null ? (from i in jobAd.Description.Industries select i.Name).ToList() : null,
                JobTypes = jobAd.Description.JobTypes,
                Location = jobAd.Description.Location != null?jobAd.Description.Location.ToString() : string.Empty,
                               PackageDetails = jobAd.Description.Package,
                               PositionTitle = jobAd.Description.PositionTitle,
                               Postcode = jobAd.Description.Location != null ? (jobAd.Description.Location.Postcode ?? string.Empty) : string.Empty,
                               ResidencyRequired = jobAd.Description.ResidencyRequired,
                               Salary = jobAd.Description.Salary != null
                    ? new Salary
                {
                    LowerBound = jobAd.Description.Salary.LowerBound, UpperBound = jobAd.Description.Salary.UpperBound, Rate = jobAd.Description.Salary.Rate, Currency = jobAd.Description.Salary.Currency
                }

                    : null,
                Summary = jobAd.Description.Summary,
                Title = jobAd.Title,
            });
        }