Exemplo 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(AgencyIdentifier other)
        {
            if (other == null)
            {
                return(false);
            }

            var valuesEqual = Equals(_agencyIdentifierType, other.AgencyIdentifierType) && Equals(_identifierNumber, other.IdentifierNumber) &&
                              Equals(_effectiveDateRange, other.EffectiveDateRange);

            return(valuesEqual);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Adds the identifier.
        /// </summary>
        /// <param name="agencyIdentifier">
        /// The agency identifier.
        /// </param>
        public virtual void AddIdentifier(AgencyIdentifier agencyIdentifier)
        {
            Check.IsNotNull(agencyIdentifier, "agencyIdentifier is required.");

            DomainRuleEngine.CreateRuleEngine <Agency, AgencyIdentifier> (this, () => AddIdentifier)
            .WithContext(agencyIdentifier)
            .Execute(() =>
            {
                agencyIdentifier.Agency = this;
                _agencyIdentifiers.Add(agencyIdentifier);
                NotifyItemAdded(() => AgencyIdentifiers, agencyIdentifier);
            });
        }
Exemplo n.º 3
0
 /// <summary>
 /// Removes the identifier.
 /// </summary>
 /// <param name="identifier">
 /// The identifier.
 /// </param>
 public virtual void RemoveIdentifier( AgencyIdentifier identifier )
 {
     _agencyIdentifiers.Delete(identifier);
     NotifyItemRemoved ( () => AgencyIdentifiers, identifier );
 }
Exemplo n.º 4
0
        /// <summary>
        /// Adds the identifier.
        /// </summary>
        /// <param name="agencyIdentifier">
        /// The agency identifier.
        /// </param>
        public virtual void AddIdentifier(AgencyIdentifier agencyIdentifier)
        {
            Check.IsNotNull ( agencyIdentifier, "agencyIdentifier is required." );

            DomainRuleEngine.CreateRuleEngine<Agency, AgencyIdentifier> ( this, () => AddIdentifier )
                .WithContext ( agencyIdentifier )
                .Execute(() =>
                {
                    agencyIdentifier.Agency = this;
                    _agencyIdentifiers.Add(agencyIdentifier);
                    NotifyItemAdded(() => AgencyIdentifiers, agencyIdentifier);
                });
        }
Exemplo n.º 5
0
 /// <summary>
 /// Removes the identifier.
 /// </summary>
 /// <param name="identifier">
 /// The identifier.
 /// </param>
 public virtual void RemoveIdentifier(AgencyIdentifier identifier)
 {
     _agencyIdentifiers.Delete(identifier);
     NotifyItemRemoved(() => AgencyIdentifiers, identifier);
 }
Exemplo n.º 6
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(AgencyIdentifier other)
        {
            if (other == null)
            {
                return false;
            }

            var valuesEqual = Equals(_agencyIdentifierType, other.AgencyIdentifierType) && Equals(_identifierNumber, other.IdentifierNumber)
                              && Equals(_effectiveDateRange, other.EffectiveDateRange);

            return valuesEqual;
        }