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);
        }
Ejemplo n.º 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 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,
     });
 }
Ejemplo n.º 4
0
        private static void DeconvertJobTypes(JobAdSearchCriteria criteria, IGetValues values)
        {
            //support old format (JobTypes=29) and new format (FullTime=true&PartTime=true)

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

            if (jobTypes != null)
            {
                criteria.JobTypes = jobTypes.Value;
            }
            else
            {
                var jobTypesCodes = values.GetIntValue(JobAdSearchCriteriaKeys.JobTypes);

                try
                {
                    jobTypes          = (JobTypes)jobTypesCodes;
                    criteria.JobTypes = jobTypes.Value;
                }
                catch (Exception)
                {
                    //never fail for parse
                }
            }
        }
 public override DesiredJobMemberModel Deconvert(IGetValues values, IDeconverterErrors errors)
 {
     return(new DesiredJobMemberModel
     {
         DesiredJobTitle = values.GetStringValue(DesiredJobKeys.DesiredJobTitle),
         DesiredJobTypes = values.GetFlagsValue <JobTypes>() ?? Defaults.DesiredJobTypes,
         Status = values.GetValue <CandidateStatus>(DesiredJobKeys.Status) ?? Defaults.CandidateStatus,
         DesiredSalaryLowerBound = values.GetDecimalValue(DesiredJobKeys.DesiredSalaryLowerBound),
         DesiredSalaryRate = values.GetValue <SalaryRate>(DesiredJobKeys.DesiredSalaryRate) ?? Defaults.DesiredSalaryRate,
         IsSalaryNotVisible = values.GetBooleanValue(DesiredJobKeys.IsSalaryNotVisible) ?? !Defaults.SalaryVisibility,
         RelocationPreference = values.GetValue <RelocationPreference>(DesiredJobKeys.RelocationPreference) ?? Defaults.RelocationPreference,
         RelocationCountryIds = values.GetIntArrayValue(DesiredJobKeys.RelocationCountryIds),
         RelocationCountryLocationIds = values.GetIntArrayValue(DesiredJobKeys.RelocationCountryLocationIds),
         SendSuggestedJobs = values.GetBooleanValue(DesiredJobKeys.SendSuggestedJobs) ?? Defaults.SendSuggestedJobs,
     });
 }
Ejemplo n.º 6
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);
        }
 public override ContactDetailsMemberModel Deconvert(IGetValues values, IDeconverterErrors errors)
 {
     return(new ContactDetailsMemberModel
     {
         Citizenship = values.GetStringValue(ContactDetailsKeys.Citizenship),
         CountryId = values.GetIntValue(ContactDetailsKeys.CountryId),
         DateOfBirth = new PartialDateConverter(true).Deconvert(ContactDetailsKeys.DateOfBirth, values),
         EmailAddress = values.GetStringValue(ContactDetailsKeys.EmailAddress),
         SecondaryEmailAddress = values.GetStringValue(ContactDetailsKeys.SecondaryEmailAddress),
         EthnicStatus = values.GetFlagsValue <EthnicStatus>() ?? Defaults.EthnicStatus,
         FirstName = values.GetStringValue(ContactDetailsKeys.FirstName),
         Gender = values.GetValue <Gender>(ContactDetailsKeys.Gender) ?? Defaults.Gender,
         LastName = values.GetStringValue(ContactDetailsKeys.LastName),
         Location = values.GetStringValue(ContactDetailsKeys.Location),
         PhoneNumber = values.GetStringValue(ContactDetailsKeys.PhoneNumber),
         PhoneNumberType = values.GetValue <PhoneNumberType>(ContactDetailsKeys.PhoneNumberType) ?? Defaults.PrimaryPhoneNumberType,
         SecondaryPhoneNumber = values.GetStringValue(ContactDetailsKeys.SecondaryPhoneNumber),
         SecondaryPhoneNumberType = values.GetValue <PhoneNumberType>(ContactDetailsKeys.SecondaryPhoneNumberType) ?? Defaults.SecondaryPhoneNumberType,
         VisaStatus = values.GetValue <VisaStatus>(ContactDetailsKeys.VisaStatus),
     });
 }
Ejemplo n.º 8
0
 public override CandidateModel Deconvert(IGetValues values, IDeconverterErrors errors)
 {
     return(new CandidateModel
     {
         Id = values.GetGuidValue("Id").Value,
         CanContact = values.GetValue <CanContactStatus>("CanContact").Value,
         CanContactByPhone = values.GetValue <CanContactStatus>("CanContactByPhone").Value,
         HasBeenViewed = values.GetBooleanValue("HasBeenViewed").Value,
         HasBeenAccessed = values.GetBooleanValue("HasBeenAccessed").Value,
         IsInMobileFolder = values.GetBooleanValue("IsInMobileFolder").Value,
         FullName = values.GetStringValue("FullName"),
         PhoneNumbers = values.GetStringArrayValue("PhoneNumbers"),
         Status = values.GetValue <CandidateStatus>("Status").Value,
         LastUpdatedTime = values.GetDateTimeValue("LastUpdatedTime"),
         Location = values.GetStringValue("Location"),
         DesiredJobTitle = values.GetStringValue("DesiredJobTitle"),
         DesiredJobTypes = values.GetFlagsValue <JobTypes>() ?? JobTypes.None,
         Summary = values.GetStringValue("Summary"),
         DesiredSalary = values.GetChildValue <SalaryModel>("DesiredSalary"),
         Jobs = values.GetArrayValue <JobModel>("Jobs"),
     });
 }