Exemple #1
0
 /// <summary>
 ///     Removes the phone.
 /// </summary>
 /// <param name="organizationPhone">The organization phone.</param>
 public void RemovePhone(OrganizationPhone organizationPhone)
 {
     if (_organizationPhones.Contains(organizationPhone))
     {
         RaiseEvent(new OrganizationPhoneRemovedEvent(Key, Version, organizationPhone));
     }
 }
Exemple #2
0
 /// <summary>
 ///     Adds the phone.
 /// </summary>
 /// <param name="organizationPhone">The organization phone.</param>
 public void AddPhone(OrganizationPhone organizationPhone)
 {
     RaiseEvent(new OrganizationPhoneAddedEvent(Key, Version, organizationPhone));
     if (organizationPhone.IsPrimary)
     {
         MakePrimary(organizationPhone);
     }
 }
Exemple #3
0
        /// <summary>Makes the phone primary.</summary>
        /// <param name="organizationPhone">The organization phone.</param>
        public void MakePrimary(OrganizationPhone organizationPhone)
        {
            Check.IsNotNull(organizationPhone, "organizationPhone is required.");
            var currentPrimary = OrganizationPhones.FirstOrDefault(oa => oa.IsPrimary);

            if (currentPrimary != organizationPhone)
            {
                RaiseEvent(new OrganizaionPrimaryPhoneChangedEvent(Key, Version, organizationPhone.GetHashCode()));
            }
        }