Пример #1
0
 public void CopyTo(Telephone telephone)
 {
     telephone.Id = Id;
     telephone.PersonId = PersonId;
     telephone.Description = Description;
     telephone.Number = Number;
     telephone.Person = Person;
 }
Пример #2
0
        public void AddTelephone(Telephone telephone)
        {
            if (Telephones == null)
            {
                Telephones = new List<Telephone>();
            }

            if (telephone.PersonId == Guid.Empty)
            {
                telephone.PersonId = Id;
                telephone.Person = this;
            }

            Telephone oldTelephone = Telephones.SingleOrDefault(tele => tele.Id == telephone.Id);
            if (oldTelephone != null)
            {
                telephone.CopyTo(oldTelephone);
                return;
            }

            Telephones.Add(telephone);
        }