Beispiel #1
0
        public override JobAdSearchCriteria Deconvert(IGetValues values, IDeconverterErrors errors)
        {
            var criteria = new JobAdSearchCriteria();

            DeconvertKeywords(criteria, values, errors);
            DeconvertLocation(criteria, values);

            DeconvertIncludeSynonyms(criteria, values);
            DeconvertSortOrder(criteria, values, errors);

            criteria.AdTitle        = values.GetStringValue(JobAdSearchCriteriaKeys.AdTitle);
            criteria.AdvertiserName = values.GetStringValue(JobAdSearchCriteriaKeys.AdvertiserName);

            criteria.IndustryIds = values.GetGuidArrayValue(JobAdSearchCriteriaKeys.IndustryIds);
            if (criteria.IndustryIds.IsNullOrEmpty())
            {
                criteria.IndustryIds = values.GetGuidArrayValue(JobAdSearchCriteriaKeys.Industries);
            }

            DeconvertJobTypes(criteria, values);
            DeconvertSalary(criteria, values);
            DeconvertRecency(criteria, values);
            DeconvertActivity(criteria, values);
            DeconvertCommunity(criteria, values);

            return(criteria);
        }
Beispiel #2
0
 public override MockModelValues Deconvert(IGetValues values, IDeconverterErrors errors)
 {
     return(new MockModelValues
     {
         NullStringValue = values.GetStringValue("NullStringValue"),
         NotNullStringValue = values.GetStringValue("NotNullStringValue"),
         NullStringArrayValue = values.GetStringArrayValue("NullStringArrayValue"),
         NotNullStringArrayValue = values.GetStringArrayValue("NotNullStringArrayValue"),
         NullBoolValue = values.GetBooleanValue("NullBoolValue"),
         NotNullBoolValue = values.GetBooleanValue("NotNullBoolValue"),
         BoolValue = values.GetBooleanValue("BoolValue") ?? false,
         NullIntValue = values.GetIntValue("NullIntValue"),
         NotNullIntValue = values.GetIntValue("NotNullIntValue"),
         IntValue = values.GetIntValue("IntValue") ?? 0,
         NullDecimalValue = values.GetDecimalValue("NullDecimalValue"),
         NotNullDecimalValue = values.GetDecimalValue("NotNullDecimalValue"),
         DecimalValue = values.GetDecimalValue("DecimalValue") ?? 0,
         NullGuidValue = values.GetGuidValue("NullGuidValue"),
         NotNullGuidValue = values.GetGuidValue("NotNullGuidValue"),
         GuidValue = values.GetGuidValue("GuidValue") ?? Guid.Empty,
         NullGuidArrayValue = values.GetGuidArrayValue("NullGuidArrayValue"),
         NotNullGuidArrayValue = values.GetGuidArrayValue("NotNullGuidArrayValue"),
         NullDateTimeValue = values.GetDateTimeValue("NullDateTimeValue"),
         NotNullDateTimeValue = values.GetDateTimeValue("NotNullDateTimeValue"),
         NullPartialDateValue = values.GetPartialDateValue("NullPartialDateValue"),
         NotNullPartialDateValue = values.GetPartialDateValue("NotNullPartialDateValue"),
         EnumValue = values.GetValue <EnumValue>("EnumValue") ?? EnumValue.No,
         NullEnumValue = values.GetValue <EnumValue>("NullEnumValue"),
         NotNullEnumValue = values.GetValue <EnumValue>("NotNullEnumValue"),
         EnumFlagsValue = values.GetFlagsValue <EnumFlagsValue1>() ?? EnumFlagsValue1.None,
         NullEnumFlagsValue = values.GetFlagsValue <EnumFlagsValue2>(),
         NotNullEnumFlagsValue = values.GetFlagsValue <EnumFlagsValue3>(),
     });
 }
        public override MemberSearchCriteria Deconvert(IGetValues values, IDeconverterErrors errors)
        {
            var criteria = new MemberSearchCriteria();

            DeconvertKeywords(criteria, values, errors);
            DeconvertJobTitles(criteria, values);
            DeconvertCompanies(criteria, values);
            DeconvertLocation(criteria, values);

            DeconvertIncludeSynonyms(criteria, values);
            DeconvertSortOrder(criteria, values, errors);

            criteria.CandidateStatusFlags = values.GetFlagsValue <CandidateStatusFlags>();
            criteria.EducationKeywords    = values.GetStringValue(MemberSearchCriteriaKeys.EducationKeywords);
            criteria.EthnicStatus         = values.GetFlagsValue <EthnicStatus>();
            criteria.VisaStatusFlags      = values.GetFlagsValue <VisaStatusFlags>();

            var jobTypes = values.GetFlagsValue <JobTypes>();

            if (jobTypes != null)
            {
                criteria.JobTypes = jobTypes.Value;
            }

            criteria.IndustryIds = values.GetGuidArrayValue(MemberSearchCriteriaKeys.IndustryIds);

            DeconvertSalary(criteria, values);
            DeconvertRecency(criteria, values);
            DeconvertActivity(criteria, values);
            DeconvertCommunity(criteria, values);
            DeconvertName(criteria, values);

            return(criteria);
        }
 public override DisqusThreadResponse Deconvert(IGetValues values, IDeconverterErrors errors)
 {
     return(new DisqusThreadResponse
     {
         Category = values.GetIntValue("category").Value,
         Reactions = values.GetIntValue("reactions").Value,
         CanModerate = values.GetBooleanValue("canModerate").Value,
         Author = values.GetIntValue("author").Value,
         Forum = values.GetStringValue("forum"),
         Title = values.GetStringValue("title"),
         Dislikes = values.GetIntValue("dislikes").Value,
         Identifiers = values.GetGuidArrayValue("identifiers"),
         UserScore = values.GetIntValue("userScore").Value,
         CreatedAt = values.GetDateTimeValue("createdAt").Value,
         Slug = values.GetStringValue("slug"),
         IsClosed = values.GetBooleanValue("isClosed").Value,
         Posts = values.GetIntValue("posts").Value,
         UserSubscription = values.GetBooleanValue("userSubscription").Value,
         Link = values.GetStringValue("link"),
         Likes = values.GetIntValue("likes").Value,
         CanPost = values.GetBooleanValue("canPost").Value,
         Id = values.GetIntValue("id").Value,
         IsDeleted = values.GetBooleanValue("isDeleted").Value,
     });
 }
 public override JobDetailsMemberModel Deconvert(IGetValues values, IDeconverterErrors errors)
 {
     return(new JobDetailsMemberModel
     {
         JobTitle = values.GetStringValue("JobTitle"),
         JobCompany = values.GetStringValue("JobCompany"),
         IndustryIds = values.GetGuidArrayValue("IndustryIds"),
         RecentProfession = values.GetValue <Profession>("RecentProfession"),
         RecentSeniority = values.GetValue <Seniority>("RecentSeniority"),
         HighestEducationLevel = values.GetValue <EducationLevel>("HighestEducationLevel"),
         DesiredJobTitle = values.GetStringValue("DesiredJobTitle"),
         DesiredJobTypes = values.GetFlagsValue <JobTypes>() ?? Defaults.DesiredJobTypes,
         EthnicStatus = values.GetFlagsValue <EthnicStatus>() ?? Defaults.EthnicStatus,
         Gender = values.GetValue <Gender>("Gender") ?? Defaults.Gender,
         DateOfBirth = new PartialDateConverter(true).Deconvert("DateOfBirth", values),
         Citizenship = values.GetStringValue("Citizenship"),
         VisaStatus = values.GetValue <VisaStatus>("VisaStatus"),
         RelocationPreference = values.GetValue <RelocationPreference>("RelocationPreference") ?? Defaults.RelocationPreference,
         RelocationCountryIds = values.GetIntArrayValue("RelocationCountryIds"),
         RelocationCountryLocationIds = values.GetIntArrayValue("RelocationCountryLocationIds"),
         SecondaryEmailAddress = values.GetStringValue("SecondaryEmailAddress"),
         SecondaryPhoneNumber = values.GetStringValue("SecondaryPhoneNumber"),
         SecondaryPhoneNumberType = values.GetValue <PhoneNumberType>("SecondaryPhoneNumberType") ?? Defaults.SecondaryPhoneNumberType,
     });
 }
 public override OrganisationEmployerSearchCriteria Deconvert(IGetValues values, IDeconverterErrors errors)
 {
     return(new OrganisationEmployerSearchCriteria
     {
         Employers = values.GetBooleanValue("Employers") ?? true,
         Recruiters = values.GetBooleanValue("Recruiters") ?? true,
         VerifiedOrganisations = values.GetBooleanValue("VerifiedOrganisations") ?? true,
         UnverifiedOrganisations = values.GetBooleanValue("UnverifiedOrganisations") ?? true,
         IndustryIds = values.GetGuidArrayValue("IndustryIds"),
         MinimumLogins = values.GetIntValue("MinimumLogins"),
         MaximumLogins = values.GetIntValue("MaximumLogins")
     });
 }
Beispiel #7
0
        public override JobAdModel Deconvert(IGetValues values, IDeconverterErrors errors)
        {
            var jobAd = new JobAdModel
            {
                Title               = values.GetStringValue(Keys.Title),
                PositionTitle       = values.GetStringValue(Keys.PositionTitle),
                ExternalReferenceId = values.GetStringValue(Keys.ExternalReferenceId),
                BulletPoints        = new[]
                {
                    values.GetStringValue(Keys.BulletPoint1),
                    values.GetStringValue(Keys.BulletPoint2),
                    values.GetStringValue(Keys.BulletPoint3)
                }.Where(b => !string.IsNullOrEmpty(b)).ToArray(),
                Summary            = values.GetStringValue(Keys.Summary),
                Content            = values.GetStringValue(Keys.Content),
                CompanyName        = values.GetStringValue(Keys.CompanyName),
                HideCompany        = values.GetBooleanValue(Keys.HideCompany) ?? true,
                Package            = values.GetStringValue(Keys.Package),
                ResidencyRequired  = values.GetBooleanValue(Keys.ResidencyRequired) ?? true,
                ExpiryTime         = values.GetDateTimeValue(Keys.ExpiryTime),
                HideContactDetails = values.GetBooleanValue(Keys.HideContactDetails) ?? true,
                ContactDetails     = new ContactDetails
                {
                    FirstName               = values.GetStringValue(Keys.FirstName),
                    LastName                = values.GetStringValue(Keys.LastName),
                    EmailAddress            = values.GetStringValue(Keys.EmailAddress),
                    SecondaryEmailAddresses = values.GetStringValue(Keys.SecondaryEmailAddresses),
                    FaxNumber               = values.GetStringValue(Keys.FaxNumber),
                    PhoneNumber             = values.GetStringValue(Keys.PhoneNumber),
                },
                IndustryIds = values.GetGuidArrayValue(Keys.IndustryIds)
            };

            DeconvertLocation(jobAd, values);
            DeconvertSalary(jobAd, values);

            var jobTypes = values.GetFlagsValue <JobTypes>();

            if (jobTypes != null)
            {
                jobAd.JobTypes = jobTypes.Value;
            }

            return(jobAd);
        }
Beispiel #8
0
 public override EmploymentHistoryUpdateModel Deconvert(IGetValues values, IDeconverterErrors errors)
 {
     return(new EmploymentHistoryUpdateModel
     {
         RecentProfession = values.GetValue <Profession>(EmploymentHistoryKeys.RecentProfession),
         RecentSeniority = values.GetValue <Seniority>(EmploymentHistoryKeys.RecentSeniority),
         IndustryIds = values.GetGuidArrayValue(EmploymentHistoryKeys.IndustryIds),
         Job = new JobModel
         {
             Id = values.GetGuidValue(EmploymentHistoryKeys.Id),
             Company = values.GetStringValue(EmploymentHistoryKeys.Company),
             Title = values.GetStringValue(EmploymentHistoryKeys.Title),
             Description = values.GetStringValue(EmploymentHistoryKeys.Description),
             StartDate = new PartialDateConverter(false).Deconvert(EmploymentHistoryKeys.StartDate, values),
             EndDate = new PartialDateConverter(false).Deconvert(EmploymentHistoryKeys.EndDate, values),
             IsCurrent = values.GetBooleanValue(EmploymentHistoryKeys.IsCurrent),
         },
     });
 }