Пример #1
0
 /// <summary>
 ///     Removes the phone.
 /// </summary>
 /// <param name="organizationPhone">The organization phone.</param>
 public virtual void RemovePhone(OrganizationPhone organizationPhone)
 {
     if (_organizationPhones.Contains(organizationPhone))
     {
         _organizationPhones.Remove(organizationPhone);
     }
 }
Пример #2
0
 /// <summary>
 ///     Adds the phone.
 /// </summary>
 /// <param name="organizationPhone">The organization phone.</param>
 public virtual void AddPhone(OrganizationPhone organizationPhone)
 {
     _organizationPhones.Add(organizationPhone);
     if (organizationPhone.IsPrimary)
     {
         MakePrimary(organizationPhone);
     }
 }
Пример #3
0
        public virtual void MakePrimary(OrganizationPhone organizationPhone)
        {
            Check.IsNotNull(organizationPhone, "organizationPhone is required.");
            var currentPrimary = OrganizationPhones.FirstOrDefault(oa => oa.IsPrimary);

            if (currentPrimary != organizationPhone)
            {
                currentPrimary.IsPrimary    = false;
                organizationPhone.IsPrimary = true;
            }
        }