/// <summary> /// Determines if the values are equal. /// </summary> /// <param name="staffLicense"> /// The other object. /// </param> /// <returns> /// A boolean denoting equality of the values. /// </returns> public virtual bool ValuesEqual(StaffLicense staffLicense) { if (staffLicense == null) { return(false); } var valuesEqual = Equals(_license.Key, staffLicense._license.Key) && Equals(_effectiveDateRange, staffLicense._effectiveDateRange); return(valuesEqual); }
/// <summary> /// The add license. /// </summary> /// <param name="license"> /// The license. /// </param> public virtual void AddLicense(StaffLicense license) { Check.IsNotNull(license, "License is required."); DomainRuleEngine.CreateRuleEngine <Staff, StaffLicense> (this, () => AddLicense) .WithContext(license) .Execute(() => { license.Staff = this; _licenses.Add(license); NotifyItemAdded(() => Licenses, license); }); }
/// <summary> /// Removes the license. /// </summary> /// <param name="license"> /// The license. /// </param> public virtual void RemoveLicense( StaffLicense license ) { _licenses.Remove ( license ); NotifyItemRemoved ( () => Licenses, license ); }
/// <summary> /// The add license. /// </summary> /// <param name="license"> /// The license. /// </param> public virtual void AddLicense( StaffLicense license ) { Check.IsNotNull ( license, "License is required." ); DomainRuleEngine.CreateRuleEngine<Staff, StaffLicense> ( this, () => AddLicense ) .WithContext ( license ) .Execute(() => { license.Staff = this; _licenses.Add(license); NotifyItemAdded(() => Licenses, license); }); }
/// <summary> /// Determines if the values are equal. /// </summary> /// <param name="staffLicense"> /// The other object. /// </param> /// <returns> /// A boolean denoting equality of the values. /// </returns> public virtual bool ValuesEqual(StaffLicense staffLicense) { if (staffLicense == null) { return false; } var valuesEqual = Equals(_license.Key, staffLicense._license.Key) && Equals(_effectiveDateRange, staffLicense._effectiveDateRange); return valuesEqual; }
/// <summary> /// Removes the license. /// </summary> /// <param name="license"> /// The license. /// </param> public virtual void RemoveLicense(StaffLicense license) { _licenses.Remove(license); NotifyItemRemoved(() => Licenses, license); }