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

            var valuesEqual = Equals(_certification.Key, staffCertification._certification.Key) &&
                              Equals(_effectiveDateRange, staffCertification._effectiveDateRange);

            return(valuesEqual);
        }
Beispiel #2
0
        /// <summary>
        /// Adds the certification.
        /// </summary>
        /// <param name="certification">
        /// The certification.
        /// </param>
        public virtual void AddCertification(StaffCertification certification)
        {
            Check.IsNotNull(certification, "Certification is required.");

            DomainRuleEngine.CreateRuleEngine <Staff, StaffCertification> (this, () => AddCertification)
            .WithContext(certification)
            .Execute(() =>
            {
                certification.Staff = this;
                _certifications.Add(certification);
                NotifyItemAdded(() => Certifications, certification);
            });
        }
Beispiel #3
0
        /// <summary>
        /// Determines if the values are equal.
        /// </summary>
        /// <param name="staffCertification">
        /// The other object.
        /// </param>
        /// <returns>
        /// A boolean denoting equality of the values.
        /// </returns>
        public virtual bool ValuesEqual( StaffCertification staffCertification )
        {
            if ( staffCertification == null )
            {
                return false;
            }

            var valuesEqual = Equals ( _certification.Key, staffCertification._certification.Key )
                              && Equals ( _effectiveDateRange, staffCertification._effectiveDateRange );
            return valuesEqual;
        }
Beispiel #4
0
 /// <summary>
 /// Removes the certification.
 /// </summary>
 /// <param name="certification">
 /// The certification.
 /// </param>
 public virtual void RemoveCertification( StaffCertification certification )
 {
     _certifications.Remove ( certification );
     NotifyItemRemoved ( () => Certifications, certification );
 }
Beispiel #5
0
        /// <summary>
        /// Adds the certification.
        /// </summary>
        /// <param name="certification">
        /// The certification.
        /// </param>
        public virtual void AddCertification( StaffCertification certification )
        {
            Check.IsNotNull ( certification, "Certification is required." );

            DomainRuleEngine.CreateRuleEngine<Staff, StaffCertification> ( this, () => AddCertification )
                .WithContext ( certification )
                .Execute(() =>
                {
                    certification.Staff = this;
                    _certifications.Add(certification);
                    NotifyItemAdded(() => Certifications, certification);
                });
        }
Beispiel #6
0
 /// <summary>
 /// Removes the certification.
 /// </summary>
 /// <param name="certification">
 /// The certification.
 /// </param>
 public virtual void RemoveCertification(StaffCertification certification)
 {
     _certifications.Remove(certification);
     NotifyItemRemoved(() => Certifications, certification);
 }