public IEnumerable<EmergencyContactDetailParameters> Map(SaveEmployeeRequest request)
        {
            var result = new List<EmergencyContactDetailParameters>();
            foreach (var emergencyContactRequest in request.EmergencyContactDetails)
            {
                var emergencyContactDetailParameters = new EmergencyContactDetailParameters
                                                           {

                                                               Title = emergencyContactRequest.Title,
                                                               Forename = emergencyContactRequest.Forename,
                                                               Surname = emergencyContactRequest.Surname,
                                                               Relationship = emergencyContactRequest.Relationship,
                                                               Telephone1 = emergencyContactRequest.WorkTelephone,
                                                               Telephone2 = emergencyContactRequest.HomeTelephone,
                                                               Telephone3 = emergencyContactRequest.MobileTelephone,
                                                               PreferedTelephone = emergencyContactRequest.PreferredContactNumber,
                                                               Address1 = emergencyContactRequest.Address1,
                                                               Address2 = emergencyContactRequest.Address2,
                                                               Address3 = emergencyContactRequest.Address3,
                                                               County = emergencyContactRequest.County,
                                                               PostCode = emergencyContactRequest.PostCode
                                                           };

                if (emergencyContactRequest.CountryId != 0)
                {
                    emergencyContactDetailParameters.Country = _countriesRepository.GetById(emergencyContactRequest.CountryId);
                }

                result.Add(emergencyContactDetailParameters);
            }
            return result;
        }
 private AddUpdateEmployeeParameters CreateEmployeeParameters(SaveEmployeeRequest request)
 {
     var result = new AddUpdateEmployeeParameters()
                                                 {
                                                     EmployeeReference = request.EmployeeReference,
                                                     Title = request.Title,
                                                     Forename = request.Forename,
                                                     Surname = request.Surname,
                                                     MiddleName = request.MiddleName,
                                                     PreviousSurname = request.PreviousSurname,
                                                     Sex = request.Sex,
                                                     HasDisability = request.HasDisability,
                                                     DisabilityDescription = request.DisabilityDescription,
                                                     SiteId = request.SiteId,
                                                     JobTitle = request.JobTitle,
                                                     NINumber = request.NINumber,
                                                     PassportNumber = request.PassportNumber,
                                                     PPSNumber = request.PPSNumber,
                                                     WorkVisaNumber = request.WorkVisaNumber,
                                                     DrivingLicenseNumber = request.DrivingLicenseNumber,
                                                     HasCompanyVehicle = request.HasCompanyVehicle,
                                                     CompanyVehicleRegistration = request.CompanyVehicleRegistration,
                                                     ClientId = request.CompanyId,
                                                     NotificationType = MapNotificationType(request.NotificationType),
                                                     NotificationFrequency =  request.NotificiationFrequency
                                                 };
     if (request.DateOfBirth.HasValue && request.DateOfBirth.Value != DateTime.MinValue)
     {
         result.DateOfBirth = request.DateOfBirth.Value;
     }
     if (request.WorkVisaExpirationDate.HasValue && request.WorkVisaExpirationDate.Value != DateTime.MinValue)
     {
         result.WorkVisaExpirationDate = request.WorkVisaExpirationDate.Value;
     }
     if (request.DrivingLicenseExpirationDate.HasValue && request.DrivingLicenseExpirationDate.Value != DateTime.MinValue)
     {
         result.DrivingLicenseExpirationDate = request.DrivingLicenseExpirationDate.Value;
     }
     if (request.NationalityId.HasValue)
     {
         result.Nationality = _nationalityRepository.LoadById(request.NationalityId.Value);
     }
     if (request.CompanyVehicleTypeId.HasValue && request.CompanyVehicleTypeId.Value > 0)
     {
         result.CompanyVehicleType = _companyVehicleTypeRepository.LoadById(request.CompanyVehicleTypeId.Value);
     }
     if (request.EmploymentStatusId.HasValue)
     {
         result.EmploymentStatus = _employmentStatusRepository.LoadById(request.EmploymentStatusId.Value);
     }
     if (request.SiteId.HasValue)
     {
         result.Site = _siteRepository.GetById(request.SiteId.Value);
     }
     return result;
 }
        public AddUpdateEmployeeContactDetailsParameters Map(SaveEmployeeRequest request)
        {
            var result = new AddUpdateEmployeeContactDetailsParameters
                                                       {
                                                           Id = request.ContactDetailId,
                                                           Address1 = request.Address1,
                                                           Address2 = request.Address2,
                                                           Address3 = request.Address3,
                                                           Town = request.Town,
                                                           County = request.County,
                                                           PostCode = request.Postcode,
                                                           Telephone1 = request.Telephone,
                                                           Telephone2 = request.Mobile,
                                                           Email = request.Email
                                                       };

            if (request.CountryId != default(int))
            {
                result.Country = _countriesRepository.LoadById(request.CountryId);
            }
            return result;
        }
 private AddUpdateEmployeeContactDetailsParameters GetEmployeeContactDetailParameters(SaveEmployeeRequest saveEmployeeRequest)
 {
     return _contactDetailsParametersMapper.Map(saveEmployeeRequest);
 }