Ejemplo n.º 1
0
        /// <summary>
        /// Determines if the values are equal.
        /// </summary>
        /// <param name="other">
        /// The other object.
        /// </param>
        /// <returns>
        /// A boolean denoting equality of the values.
        /// </returns>
        public virtual bool ValuesEqual(AgencyContact other)
        {
            if (other == null)
            {
                return(false);
            }

            var valuesEqual = Equals(_agencyContactType, other.AgencyContactType) && Equals(_contactStaff, other.ContactStaff) &&
                              Equals(_effectiveStartDate, other.EffectiveStartDate) && Equals(_statusIndicator, other.StatusIndicator) &&
                              Equals(_alternativeContactIndicator, other.AlternativeContactIndicator);

            return(valuesEqual);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Adds the contact.
        /// </summary>
        /// <param name="agencyContact">
        /// The agency contact.
        /// </param>
        public virtual void AddContact(AgencyContact agencyContact)
        {
            Check.IsNotNull(agencyContact, "agencyContact is required.");

            DomainRuleEngine.CreateRuleEngine <Agency, AgencyContact> (this, () => AddContact)
            .WithContext(agencyContact)
            .Execute(() =>
            {
                agencyContact.Agency = this;
                _agencyContacts.Add(agencyContact);
                NotifyItemAdded(() => AgencyContacts, agencyContact);
            });
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Determines if the values are equal.
        /// </summary>
        /// <param name="other">
        /// The other object.
        /// </param>
        /// <returns>
        /// A boolean denoting equality of the values.
        /// </returns>
        public virtual bool ValuesEqual(AgencyContact other)
        {
            if (other == null)
            {
                return false;
            }

            var valuesEqual = Equals(_agencyContactType, other.AgencyContactType) && Equals(_contactStaff, other.ContactStaff)
                              && Equals(_effectiveStartDate, other.EffectiveStartDate) && Equals(_statusIndicator, other.StatusIndicator)
                              && Equals(_alternativeContactIndicator, other.AlternativeContactIndicator);

            return valuesEqual;
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Removes the contacts.
 /// </summary>
 /// <param name="agencyContact">
 /// The agency contact.
 /// </param>
 public virtual void RemoveContacts( AgencyContact agencyContact )
 {
     _agencyContacts.Delete(agencyContact);
     NotifyItemRemoved ( () => AgencyContacts, agencyContact );
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Adds the contact.
        /// </summary>
        /// <param name="agencyContact">
        /// The agency contact.
        /// </param>
        public virtual void AddContact( AgencyContact agencyContact )
        {
            Check.IsNotNull ( agencyContact, "agencyContact is required." );

            DomainRuleEngine.CreateRuleEngine<Agency, AgencyContact> ( this, () => AddContact )
                .WithContext ( agencyContact )
                .Execute(() =>
                {
                    agencyContact.Agency = this;
                    _agencyContacts.Add(agencyContact);
                    NotifyItemAdded(() => AgencyContacts, agencyContact);
                });
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Removes the contacts.
 /// </summary>
 /// <param name="agencyContact">
 /// The agency contact.
 /// </param>
 public virtual void RemoveContacts(AgencyContact agencyContact)
 {
     _agencyContacts.Delete(agencyContact);
     NotifyItemRemoved(() => AgencyContacts, agencyContact);
 }