예제 #1
0
        private static Model.AddressType GetAddress(SRC.AddressType address, SRC.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             = address.Email?[0],
                Phone             = address.Phone?[0],
            };

            return(addrNew);
        }
예제 #2
0
        /// <summary>
        /// Mappping for Contact
        /// </summary>
        /// <param name="contactSource"></param>
        /// <returns></returns>
        private static Model.ContactType GetContact(SRC.ContactType contactSource)
        {
            if (contactSource == null)
            {
                return(new ContactType()
                {
                    Email = new List <string>(),
                    Name = "",
                    Phone = new List <string>(),
                    Salutation = ""
                });
            }
            ;

            ContactType contact = new ContactType
            {
                Email      = contactSource.Email?.ToList(),
                Name       = contactSource.Name,
                Phone      = contactSource.Phone?.ToList(),
                Salutation = contactSource.Salutation
            };

            return(contact);
        }