/// <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(AgencyPhone other) { if (other == null) { return(false); } var valuesEqual = Equals(_phone, other.Phone) && Equals(_agencyPhoneType, other.AgencyPhoneType); return(valuesEqual); }
/// <summary> /// Adds the phone. /// </summary> /// <param name="agencyPhone"> /// The agency phone. /// </param> public virtual void AddPhone(AgencyPhone agencyPhone) { Check.IsNotNull(agencyPhone, "agencyPhone is required."); DomainRuleEngine.CreateRuleEngine <Agency, AgencyPhone> (Agency, () => AddPhone) .WithContext(agencyPhone) .WithContext(this) .Execute(() => { agencyPhone.AgencyAddressAndPhone = this; _phoneNumbers.Add(agencyPhone); NotifyItemAdded(() => PhoneNumbers, agencyPhone); }); }
/// <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(AgencyPhone other) { if (other == null) { return false; } var valuesEqual = Equals(_phone, other.Phone) && Equals(_agencyPhoneType, other.AgencyPhoneType); return valuesEqual; }
/// <summary> /// Removes the phone. /// </summary> /// <param name="agencyPhone"> /// The agency phone. /// </param> public virtual void RemovePhone(AgencyPhone agencyPhone) { _phoneNumbers.Delete(agencyPhone); NotifyItemRemoved(() => PhoneNumbers, agencyPhone); }
/// <summary> /// Adds the phone. /// </summary> /// <param name="agencyPhone"> /// The agency phone. /// </param> public virtual void AddPhone(AgencyPhone agencyPhone) { Check.IsNotNull(agencyPhone, "agencyPhone is required."); DomainRuleEngine.CreateRuleEngine<Agency, AgencyPhone> ( Agency, () => AddPhone ) .WithContext ( agencyPhone ) .WithContext ( this ) .Execute(() => { agencyPhone.AgencyAddressAndPhone = this; _phoneNumbers.Add(agencyPhone); NotifyItemAdded(() => PhoneNumbers, agencyPhone); }); }