Ejemplo n.º 1
0
        public override Pagination Deconvert(IGetValues values, IDeconverterErrors errors)
        {
            var page  = values.GetIntValue(PaginationKeys.Page);
            var items = values.GetIntValue(PaginationKeys.Items);

            if (page != null)
            {
                if (page.Value <= 0)
                {
                    page = null;
                }
            }

            if (items != null)
            {
                if (_defaultItems != null && items.Value == _defaultItems.Value)
                {
                    items = null;
                }
            }

            if (page == null && items == null)
            {
                return(null);
            }
            return(new Pagination {
                Page = page, Items = items
            });
        }
        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,
     });
 }
Ejemplo n.º 4
0
        public override VerificationReceipt Deconvert(IGetValues values, IDeconverterErrors errors)
        {
            var quantityString = values.GetStringValue("quantity");
            var quantity       = 0;

            if (quantityString != string.Empty)
            {
                int.TryParse(quantityString, out quantity);
            }

            var productId                   = values.GetStringValue("product_id");
            var transactionId               = values.GetStringValue("transaction_id");
            var purchaseDate                = ParseAppleDate(values.GetStringValue("purchase_date"));
            var originalTransactionId       = values.GetStringValue("original_transaction_id");
            var originalPurchaseDate        = ParseAppleDate(values.GetStringValue("original_purchase_date"));
            var appItemId                   = values.GetStringValue("app_item_id");
            var applicationRevision         = values.GetStringValue("version_external_identifier");
            var applicationBundleIdentifier = values.GetStringValue("bid");
            var applicationVersion          = values.GetStringValue("bvrs");


            return(new VerificationReceipt
            {
                Quantity = quantity,
                ProductId = productId,
                TransactionId = transactionId,
                PurchaseDate = purchaseDate,
                OriginalTransactionId = originalTransactionId,
                OriginalPurchaseDate = originalPurchaseDate,
                AppItemId = appItemId,
                ApplicationRevision = applicationRevision,
                ApplicationBundleIdentifier = applicationBundleIdentifier,
                ApplicationVersion = applicationVersion,
            });
        }
Ejemplo n.º 5
0
        public override JobAdSearchSortCriteria Deconvert(IGetValues values, IDeconverterErrors errors)
        {
            JobAdSortOrder?sortOrder;

            // This used to be the name so look for it first.

            var value = values.GetStringValue(JobAdSearchCriteriaKeys.SortOrder);

            if (value == "CreatedTimeDescending")
            {
                sortOrder = JobAdSortOrder.CreatedTime;
            }
            else
            {
                sortOrder = values.GetValue <JobAdSortOrder>(JobAdSearchCriteriaKeys.SortOrder);
                if (sortOrder == null)
                {
                    return(null);
                }
            }

            var direction  = values.GetStringValue(JobAdSearchCriteriaKeys.SortOrderDirection);
            var isReversed = false;

            switch (direction)
            {
            case JobAdSearchCriteriaKeys.SortOrderIsAscending:
                isReversed = true;
                break;
            }

            return(new JobAdSearchSortCriteria {
                SortOrder = sortOrder.Value, ReverseSortOrder = isReversed
            });
        }
Ejemplo n.º 6
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);
        }
 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.º 8
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 DisqusThreadJsonModel Deconvert(IGetValues values, IDeconverterErrors errors)
 {
     return(new DisqusThreadJsonModel
     {
         Code = values.GetIntValue("code").Value,
         Response = values.GetChildValue <DisqusThreadResponse>("response"),
     });
 }
Ejemplo n.º 10
0
 public override SearchModel Deconvert(IGetValues values, IDeconverterErrors errors)
 {
     return(new SearchModel
     {
         Keywords = values.GetStringValue("ctl00$Body$ucJobSearch$txtKeywords") ?? values.GetStringValue("LinkMeKeywords"),
         Location = values.GetStringValue("ctl00$Body$ucJobSearch$txtLocation") ?? values.GetStringValue("LinkMeLocation"),
     });
 }
Ejemplo n.º 11
0
 public override CareerObjectivesMemberModel Deconvert(IGetValues values, IDeconverterErrors errors)
 {
     return(new CareerObjectivesMemberModel
     {
         Objective = values.GetStringValue(CareerObjectivesKeys.Objective),
         Summary = values.GetStringValue(CareerObjectivesKeys.Summary),
         Skills = values.GetStringValue(CareerObjectivesKeys.Skills),
     });
 }
Ejemplo n.º 12
0
 public override MemberSearchRequestModel Deconvert(IGetValues values, IDeconverterErrors errors)
 {
     return(new MemberSearchRequestModel
     {
         Name = values.GetStringValue("Name"),
         IsAlert = values.GetBooleanValue("IsAlert").Value,
         Criteria = values.GetChildValue <MemberSearchCriteria>("Criteria"),
         DeviceToken = values.GetStringValue("DeviceToken"),
     });
 }
Ejemplo n.º 13
0
 public override VisibilityModel Deconvert(IGetValues values, IDeconverterErrors errors)
 {
     return(new VisibilityModel
     {
         ShowResume = values.GetBooleanValue(VisibilityKeys.ShowResume) ?? false,
         ShowRecentEmployers = values.GetBooleanValue(VisibilityKeys.ShowRecentEmployers) ?? false,
         ShowName = values.GetBooleanValue(VisibilityKeys.ShowName) ?? false,
         ShowPhoneNumbers = values.GetBooleanValue(VisibilityKeys.ShowPhoneNumbers) ?? false,
         ShowProfilePhoto = values.GetBooleanValue(VisibilityKeys.ShowProfilePhoto) ?? false,
     });
 }
Ejemplo n.º 14
0
 public override JobModel Deconvert(IGetValues values, IDeconverterErrors errors)
 {
     return(new JobModel
     {
         Title = values.GetStringValue("Title"),
         IsCurrent = values.GetBooleanValue("IsCurrent") ?? false,
         StartDate = values.GetPartialDateValue("StartDate"),
         EndDate = values.GetPartialDateValue("EndDate"),
         Company = values.GetStringValue("Company"),
     });
 }
Ejemplo n.º 15
0
        public override ResourceSearchCriteria Deconvert(IGetValues values, IDeconverterErrors errors)
        {
            var criteria = new ResourceSearchCriteria();

            DeconvertSortOrder(criteria, values, errors);

            criteria.Keywords      = values.GetStringValue(ResourceSearchCriteriaKeys.Keywords);
            criteria.CategoryId    = values.GetGuidValue(ResourceSearchCriteriaKeys.CategoryId);
            criteria.SubcategoryId = values.GetGuidValue(ResourceSearchCriteriaKeys.SubcategoryId);
            criteria.ResourceType  = values.GetValue <ResourceType>(ResourceSearchCriteriaKeys.ResourceType) ?? ResourceSearchCriteria.DefaultResourceType;

            return(criteria);
        }
Ejemplo n.º 16
0
        public override JsonVerificationResponse Deconvert(IGetValues values, IDeconverterErrors errors)
        {
            var status    = values.GetIntValue("status").Value;
            var exception = values.GetStringValue("exception");
            var receipt   = values.GetChildValue <VerificationReceipt>("receipt");

            return(new JsonVerificationResponse
            {
                Status = status,
                Exception = exception,
                Receipt = receipt,
            });
        }
Ejemplo n.º 17
0
        public override SalaryModel Deconvert(IGetValues values, IDeconverterErrors errors)
        {
            var lowerBound = values.GetDecimalValue("LowerBound");
            var upperBound = values.GetDecimalValue("UpperBound");

            if (lowerBound == null && upperBound == null)
            {
                return(null);
            }
            return(new SalaryModel {
                LowerBound = lowerBound, UpperBound = upperBound
            });
        }
Ejemplo n.º 18
0
 public override OtherMemberModel Deconvert(IGetValues values, IDeconverterErrors errors)
 {
     return(new OtherMemberModel
     {
         Affiliations = values.GetStringValue(OtherKeys.Affiliations),
         Awards = values.GetStringValue(OtherKeys.Awards),
         Professional = values.GetStringValue(OtherKeys.Professional),
         Courses = values.GetStringValue(OtherKeys.Courses),
         Interests = values.GetStringValue(OtherKeys.Interests),
         Other = values.GetStringValue(OtherKeys.Other),
         Referees = values.GetStringValue(OtherKeys.Referees),
     });
 }
Ejemplo n.º 19
0
        public override TPresentationModel Deconvert(IGetValues values, IDeconverterErrors errors)
        {
            var pagination = new PaginationConverter(null).Deconvert(values, errors);

            if (pagination == null)
            {
                return(null);
            }

            return(new TPresentationModel
            {
                Pagination = pagination,
            });
        }
Ejemplo n.º 20
0
        public override CandidatesPresentationModel Deconvert(IGetValues values, IDeconverterErrors errors)
        {
            var presentation = base.Deconvert(values, errors);
            var detailLevel  = values.GetValue <DetailLevel>(PresentationKeys.DetailLevel);

            if (presentation == null && detailLevel == null)
            {
                return(null);
            }

            presentation             = presentation ?? new CandidatesPresentationModel();
            presentation.DetailLevel = detailLevel ?? DefaultDetailLevel;
            return(presentation);
        }
Ejemplo n.º 21
0
 public override EmployerJoinModel Deconvert(IGetValues values, IDeconverterErrors errors)
 {
     return(new EmployerJoinModel
     {
         LoginId = values.GetStringValue("LoginId"),
         Password = values.GetStringValue("Password"),
         FirstName = values.GetStringValue("FirstName"),
         LastName = values.GetStringValue("LastName"),
         EmailAddress = values.GetStringValue("EmailAddress"),
         PhoneNumber = values.GetStringValue("PhoneNumber"),
         OrganisationName = values.GetStringValue("OrganisationName"),
         Location = values.GetStringValue("Location"),
         SubRole = values.GetValue <EmployerSubRole>("SubRole") ?? Defaults.SubRole,
     });
 }
 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,
     });
 }
 public override PersonalDetailsMemberModel Deconvert(IGetValues values, IDeconverterErrors errors)
 {
     return(new PersonalDetailsMemberModel
     {
         FirstName = values.GetStringValue("FirstName"),
         LastName = values.GetStringValue("LastName"),
         EmailAddress = values.GetStringValue("EmailAddress"),
         CountryId = values.GetIntValue("CountryId") ?? 0,
         Location = values.GetStringValue("Location"),
         PhoneNumber = values.GetStringValue("PhoneNumber"),
         PhoneNumberType = values.GetValue <PhoneNumberType>("PhoneNumberType") ?? Defaults.PrimaryPhoneNumberType,
         Status = values.GetValue <CandidateStatus>("Status"),
         SalaryLowerBound = values.GetDecimalValue("SalaryLowerBound"),
         SalaryRate = values.GetValue <SalaryRate>("SalaryRate") ?? Defaults.DesiredSalaryRate,
         Visibility = BindVisibility(values),
     });
 }
Ejemplo n.º 24
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);
        }
Ejemplo n.º 25
0
 public override EducationUpdateModel Deconvert(IGetValues values, IDeconverterErrors errors)
 {
     return(new EducationUpdateModel
     {
         HighestEducationLevel = values.GetValue <EducationLevel>(EducationKeys.HighestEducationLevel),
         School = new SchoolModel
         {
             Id = values.GetGuidValue(EducationKeys.Id),
             City = values.GetStringValue(EducationKeys.City),
             EndDate = new PartialDateConverter(false).Deconvert(EducationKeys.EndDate, values),
             IsCurrent = values.GetBooleanValue(EducationKeys.IsCurrent),
             Description = values.GetStringValue(EducationKeys.Description),
             Institution = values.GetStringValue(EducationKeys.Institution),
             Major = values.GetStringValue(EducationKeys.Major),
             Degree = values.GetStringValue(EducationKeys.Degree),
         }
     });
 }
Ejemplo n.º 26
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),
         },
     });
 }
 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.º 28
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"),
     });
 }
        public override MemberSearchSortCriteria Deconvert(IGetValues values, IDeconverterErrors errors)
        {
            var sortOrder = values.GetValue <MemberSortOrder>(MemberSearchCriteriaKeys.SortOrder);

            if (sortOrder == null)
            {
                return(null);
            }

            var direction  = values.GetStringValue(MemberSearchCriteriaKeys.SortOrderDirection);
            var isReversed = false;

            switch (direction)
            {
            case MemberSearchCriteriaKeys.SortOrderIsAscending:
                isReversed = true;
                break;
            }

            return(new MemberSearchSortCriteria {
                SortOrder = sortOrder.Value, ReverseSortOrder = isReversed
            });
        }
Ejemplo n.º 30
0
 private static void DeconvertSortOrder(JobAdSearchCriteria criteria, IGetValues values, IDeconverterErrors errors)
 {
     criteria.SortCriteria = new JobAdSearchSortCriteriaConverter().Deconvert(values, errors);
 }