Пример #1
0
 public PhoneNumbers(PhoneNumbers numbers)
 {
     if (numbers == null)
     {
         return;
     }
     PhoneNumber = new List <PhoneNumber>();
     foreach (PhoneNumber pn in numbers.PhoneNumber)
     {
         PhoneNumber.Add(new PhoneNumber(pn));
     }
 }
 public PhoneNumbers(PhoneNumbers numbers)
 {
     if (numbers == null)
     {
         return;
     }
     PhoneNumber = new List<PhoneNumber>();
     foreach (PhoneNumber pn in numbers.PhoneNumber)
     {
         PhoneNumber.Add(new PhoneNumber(pn));
     }
 }
Пример #3
0
        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 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);
     }
 }
 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 PhoneNumbers getPhoneNumbers(SqlDataReader reader, int count, List<string> mappings)
 {
     PhoneNumbers numbers = new PhoneNumbers();
     for (int i = 0; i < count; i++)
     {
         try {
             PhoneNumber phone = new PhoneNumber();
             phone.Number = reader[mappings[i]].ToString();
             phone.PhoneType = i + 1;
             numbers.PhoneNumber.Add(phone);
         }
         catch(Exception ex)
         {
             throw new WebFaultException<string>(String.Format("Column <{0}> not found in query results: {1}", mappings[i], ex.Message), HttpStatusCode.InternalServerError);
         }
     }
     return numbers;
 }