Example #1
0
        private static ContactType GetContact(Model.ContactType contactSource)
        {
            if (contactSource == null)
            {
                return(null);
            }
            if (string.IsNullOrEmpty(contactSource.Name))
            {
                return(null);
            }
            ContactType contact = new ContactType
            {
                Email      = contactSource.Email?.ToArray(),
                Name       = contactSource.Name,
                Phone      = contactSource.Phone?.ToArray(),
                Salutation = contactSource.Salutation
            };

            return(contact);
        }
Example #2
0
        private static AddressType GetAddress(Model.AddressType address, Model.ContactType contact)
        {
            if (address == null)
            {
                return(null);
            }
            AddressType addrNew = new AddressType
            {
                Name              = address.Name,
                POBox             = address.POBox,
                Street            = address.Street,
                Country           = GetCountry(address.Country),
                ZIP               = address.ZIP,
                Town              = address.Town,
                AddressIdentifier = GetAddressIdentifier(address.AddressIdentifier),
                Email             = new string[] { address.Email },
                Phone             = new string[] { address.Phone },
            };

            return(addrNew);
        }
Example #3
0
        private static AddressType GetAddress(Model.AddressType address, Model.ContactType contact)
        {
            if (address == null)
            {
                return(null);
            }
            AddressType addrNew = new AddressType
            {
                Name              = address.Name,
                Contact           = contact?.Name,
                Phone             = address.Phone,
                POBox             = address.POBox,
                Email             = address.Email,
                Salutation        = contact?.Salutation,
                Street            = address.Street,
                Country           = GetCountry(address.Country),
                ZIP               = address.ZIP,
                Town              = address.Town,
                AddressIdentifier = GetAddressIdentifier(address.AddressIdentifier)
            };

            return(addrNew);
        }