public EmailAddresses(EmailAddresses addrs) { if (addrs == null) { return; } EmailAddress = new List<EmailAddressModel>(); foreach (EmailAddressModel eam in addrs.EmailAddress) { EmailAddress.Add(new EmailAddressModel(eam)); } }
public EmailAddresses(EmailAddresses addrs) { if (addrs == null) { return; } EmailAddress = new List <EmailAddressModel>(); foreach (EmailAddressModel eam in addrs.EmailAddress) { EmailAddress.Add(new EmailAddressModel(eam)); } }
public Contact(Contact clonedContact) { FirstName = clonedContact.FirstName; LastName = clonedContact.LastName; FullName = clonedContact.FullName; Id = clonedContact.Id; CustomAttribute = clonedContact.CustomAttribute; if (clonedContact.Address != null) { Address = new Address(clonedContact.Address); } if (clonedContact.EmailAddresses != null) { EmailAddresses = new EmailAddresses(clonedContact.EmailAddresses); } if (clonedContact.PhoneNumbers != null) { PhoneNumbers = new PhoneNumbers(clonedContact.PhoneNumbers); } }
public Account(Account clonedAccount) { if (clonedAccount == null) { return; } CustomAttribute = clonedAccount.CustomAttribute; Id = clonedAccount.Id; Name = clonedAccount.Name; Number = clonedAccount.Number; if (clonedAccount.Addresses != null) { Addresses = new Addresses(clonedAccount.Addresses); } if (clonedAccount.PhoneNumbers != null) { PhoneNumbers = new PhoneNumbers(clonedAccount.PhoneNumbers); } if (clonedAccount.EmailAddresses != null) { EmailAddresses = new EmailAddresses(clonedAccount.EmailAddresses); } }
private EmailAddresses getEmails(SqlDataReader reader, int count, List<string> mappings) { EmailAddresses addresses = new EmailAddresses(); for (int i = 0; i < count; i++) { try { EmailAddressModel email = new EmailAddressModel(); email.EmailAddress = reader[mappings[i]].ToString(); email.EmailType = i + 1; addresses.EmailAddress.Add(email); } catch (Exception ex) { throw new WebFaultException<string>(string.Format("Column <{0}> not found in query results: {1}", mappings[i], ex.Message), HttpStatusCode.InternalServerError); } } return addresses; }