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

            var valuesEqual = Equals(_staffPhoneType.Key, staffPhone._staffPhoneType.Key) && Equals(_phone, staffPhone._phone) &&
                              Equals(_confidentialIndicator, staffPhone._confidentialIndicator);

            return(valuesEqual);
        }
Example #2
0
        /// <summary>
        /// Add phone.
        /// </summary>
        /// <param name="phone">
        /// The phone.
        /// </param>
        public virtual void AddPhone(StaffPhone phone)
        {
            Check.IsNotNull(phone, "Phone is required.");

            DomainRuleEngine.CreateRuleEngine <Staff, StaffPhone> (this, () => AddPhone)
            .WithContext(phone)
            .Execute(() =>
            {
                phone.Staff = this;
                _phoneNumbers.Add(phone);
                NotifyItemAdded(() => PhoneNumbers, phone);
            });
        }
Example #3
0
 /// <summary>
 /// Remove phone.
 /// </summary>
 /// <param name="phone">
 /// The phone.
 /// </param>
 public virtual void RemovePhone( StaffPhone phone )
 {
     Check.IsNotNull ( phone, "Phone is required." );
     _phoneNumbers.Remove ( phone );
     NotifyItemRemoved ( () => PhoneNumbers, phone );
 }
Example #4
0
        /// <summary>
        /// Add phone.
        /// </summary>
        /// <param name="phone">
        /// The phone.
        /// </param>
        public virtual void AddPhone( StaffPhone phone )
        {
            Check.IsNotNull ( phone, "Phone is required." );

            DomainRuleEngine.CreateRuleEngine<Staff, StaffPhone> ( this, () => AddPhone )
                .WithContext ( phone )
                .Execute(() =>
                {
                    phone.Staff = this;
                    _phoneNumbers.Add(phone);
                    NotifyItemAdded(() => PhoneNumbers, phone);
                });
        }
Example #5
0
 /// <summary>
 /// Remove phone.
 /// </summary>
 /// <param name="phone">
 /// The phone.
 /// </param>
 public virtual void RemovePhone(StaffPhone phone)
 {
     Check.IsNotNull(phone, "Phone is required.");
     _phoneNumbers.Remove(phone);
     NotifyItemRemoved(() => PhoneNumbers, phone);
 }
Example #6
0
        /// <summary>
        /// Determines if the values are equal.
        /// </summary>
        /// <param name="staffPhone">
        /// The other object.
        /// </param>
        /// <returns>
        /// A boolean denoting equality of the values.
        /// </returns>
        public virtual bool ValuesEqual( StaffPhone staffPhone )
        {
            if ( staffPhone == null )
            {
                return false;
            }

            var valuesEqual = Equals ( _staffPhoneType.Key, staffPhone._staffPhoneType.Key ) && Equals ( _phone, staffPhone._phone )
                              && Equals ( _confidentialIndicator, staffPhone._confidentialIndicator );
            return valuesEqual;
        }