private async Task UpdateEmployerProfile(VacancyEmployerInfoModel employerInfoModel,
                                                 EmployerProfile employerProfile, Address address, VacancyUser user)
        {
            var updateProfile = false;

            if (string.IsNullOrEmpty(employerProfile.AccountLegalEntityPublicHashedId) && !string.IsNullOrEmpty(employerInfoModel?.AccountLegalEntityPublicHashedId))
            {
                updateProfile = true;
                employerProfile.AccountLegalEntityPublicHashedId = employerInfoModel.AccountLegalEntityPublicHashedId;
            }
            if (employerInfoModel != null && employerInfoModel.EmployerIdentityOption == EmployerIdentityOption.NewTradingName)
            {
                updateProfile = true;
                employerProfile.TradingName = employerInfoModel.NewTradingName;
            }
            if (address != null)
            {
                updateProfile = true;
                employerProfile.OtherLocations.Add(address);
            }
            if (updateProfile)
            {
                await _recruitVacancyClient.UpdateEmployerProfileAsync(employerProfile, user);
            }
        }
示例#2
0
 public static ProjectionAddress ToProjection(this Address address)
 {
     return(new ProjectionAddress
     {
         AddressLine1 = address.AddressLine1,
         AddressLine2 = address.AddressLine2,
         AddressLine3 = address.AddressLine3,
         AddressLine4 = address.AddressLine4,
         Postcode = address.Postcode,
         Latitude = address.Latitude.GetValueOrDefault(),
         Longitude = address.Longitude.GetValueOrDefault()
     });
 }
示例#3
0
        private async Task UpdateEmployerProfile(VacancyEmployerInfoModel employerInfoModel,
                                                 EmployerProfile employerProfile, Address address, VacancyUser user)
        {
            var updateProfile = false;

            if (employerInfoModel != null && employerInfoModel.EmployerIdentityOption == EmployerIdentityOption.NewTradingName)
            {
                updateProfile = true;
                employerProfile.TradingName = employerInfoModel.NewTradingName;
            }
            if (address != null)
            {
                updateProfile = true;
                employerProfile.OtherLocations.Add(address);
            }
            if (updateProfile)
            {
                await _recruitVacancyClient.UpdateEmployerProfileAsync(employerProfile, user);
            }
        }
示例#4
0
        public static ProjectionAddress ToProjection(this Address address, bool isAnonymousVacancy)
        {
            if (isAnonymousVacancy)
            {
                return new ProjectionAddress {
                           Postcode  = address.PostcodeAsOutcode(),
                           Latitude  = address.Latitude.GetValueOrDefault(),
                           Longitude = address.Longitude.GetValueOrDefault()
                }
            }
            ;

            return(new ProjectionAddress
            {
                AddressLine1 = address.AddressLine1,
                AddressLine2 = address.AddressLine2,
                AddressLine3 = address.AddressLine3,
                AddressLine4 = address.AddressLine4,
                Postcode = address.Postcode,
                Latitude = address.Latitude.GetValueOrDefault(),
                Longitude = address.Longitude.GetValueOrDefault()
            });
        }