Example #1
0
        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                var hashCode = 41;
                // Suitable nullity checks etc, of course :)
                if (StaffGroup != null)
                {
                    hashCode = hashCode * 59 + StaffGroup.GetHashCode();
                }
                if (Grade != null)
                {
                    hashCode = hashCode * 59 + Grade.GetHashCode();
                }
                if (_Contract != null)
                {
                    hashCode = hashCode * 59 + _Contract.GetHashCode();
                }
                if (Payscale != null)
                {
                    hashCode = hashCode * 59 + Payscale.GetHashCode();
                }
                if (ContractType != null)
                {
                    hashCode = hashCode * 59 + ContractType.GetHashCode();
                }
                if (ContractedTime != null)
                {
                    hashCode = hashCode * 59 + ContractedTime.GetHashCode();
                }
                if (DefaultUnavailabilityHours != null)
                {
                    hashCode = hashCode * 59 + DefaultUnavailabilityHours.GetHashCode();
                }

                hashCode = hashCode * 59 + WtdOptOut.GetHashCode();
                if (SalaryFrequency != null)
                {
                    hashCode = hashCode * 59 + SalaryFrequency.GetHashCode();
                }

                hashCode = hashCode * 59 + SalaryAmount.GetHashCode();
                return(hashCode);
            }
        }
        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                var hashCode = 41;
                // Suitable nullity checks etc, of course :)

                hashCode = hashCode * 59 + Id.GetHashCode();
                if (When != null)
                {
                    hashCode = hashCode * 59 + When.GetHashCode();
                }
                if (Actual != null)
                {
                    hashCode = hashCode * 59 + Actual.GetHashCode();
                }

                hashCode = hashCode * 59 + WorkTime.GetHashCode();

                hashCode = hashCode * 59 + ContractedTime.GetHashCode();

                hashCode = hashCode * 59 + PayState.GetHashCode();
                if (EmployeeType != null)
                {
                    hashCode = hashCode * 59 + EmployeeType.GetHashCode();
                }
                if (Person != null)
                {
                    hashCode = hashCode * 59 + Person.GetHashCode();
                }
                if (Assignment != null)
                {
                    hashCode = hashCode * 59 + Assignment.GetHashCode();
                }
                if (Post != null)
                {
                    hashCode = hashCode * 59 + Post.GetHashCode();
                }
                if (Posting != null)
                {
                    hashCode = hashCode * 59 + Posting.GetHashCode();
                }
                if (Cancellation != null)
                {
                    hashCode = hashCode * 59 + Cancellation.GetHashCode();
                }

                hashCode = hashCode * 59 + InCharge.GetHashCode();
                if (Shift != null)
                {
                    hashCode = hashCode * 59 + Shift.GetHashCode();
                }
                if (Duty != null)
                {
                    hashCode = hashCode * 59 + Duty.GetHashCode();
                }
                if (Fulfillment != null)
                {
                    hashCode = hashCode * 59 + Fulfillment.GetHashCode();
                }
                if (CostCentre != null)
                {
                    hashCode = hashCode * 59 + CostCentre.GetHashCode();
                }
                if (OwningUnit != null)
                {
                    hashCode = hashCode * 59 + OwningUnit.GetHashCode();
                }
                if (ResourcingUnit != null)
                {
                    hashCode = hashCode * 59 + ResourcingUnit.GetHashCode();
                }
                if (Requirement != null)
                {
                    hashCode = hashCode * 59 + Requirement.GetHashCode();
                }
                if (Location != null)
                {
                    hashCode = hashCode * 59 + Location.GetHashCode();
                }
                if (AdditionalDutyReason != null)
                {
                    hashCode = hashCode * 59 + AdditionalDutyReason.GetHashCode();
                }

                hashCode = hashCode * 59 + DutyHasWarnings.GetHashCode();
                return(hashCode);
            }
        }
        /// <summary>
        /// Returns true if HoursAssignment instances are equal
        /// </summary>
        /// <param name="other">Instance of HoursAssignment to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(HoursAssignment other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Id == other.Id ||

                     Id.Equals(other.Id)
                     ) &&
                 (
                     When == other.When ||
                     When != null &&
                     When.Equals(other.When)
                 ) &&
                 (
                     Actual == other.Actual ||
                     Actual != null &&
                     Actual.Equals(other.Actual)
                 ) &&
                 (
                     WorkTime == other.WorkTime ||

                     WorkTime.Equals(other.WorkTime)
                 ) &&
                 (
                     ContractedTime == other.ContractedTime ||

                     ContractedTime.Equals(other.ContractedTime)
                 ) &&
                 (
                     PayState == other.PayState ||

                     PayState.Equals(other.PayState)
                 ) &&
                 (
                     EmployeeType == other.EmployeeType ||
                     EmployeeType != null &&
                     EmployeeType.Equals(other.EmployeeType)
                 ) &&
                 (
                     Person == other.Person ||
                     Person != null &&
                     Person.Equals(other.Person)
                 ) &&
                 (
                     Assignment == other.Assignment ||
                     Assignment != null &&
                     Assignment.Equals(other.Assignment)
                 ) &&
                 (
                     Post == other.Post ||
                     Post != null &&
                     Post.Equals(other.Post)
                 ) &&
                 (
                     Posting == other.Posting ||
                     Posting != null &&
                     Posting.Equals(other.Posting)
                 ) &&
                 (
                     Cancellation == other.Cancellation ||
                     Cancellation != null &&
                     Cancellation.Equals(other.Cancellation)
                 ) &&
                 (
                     InCharge == other.InCharge ||

                     InCharge.Equals(other.InCharge)
                 ) &&
                 (
                     Shift == other.Shift ||
                     Shift != null &&
                     Shift.Equals(other.Shift)
                 ) &&
                 (
                     Duty == other.Duty ||
                     Duty != null &&
                     Duty.Equals(other.Duty)
                 ) &&
                 (
                     Fulfillment == other.Fulfillment ||
                     Fulfillment != null &&
                     Fulfillment.Equals(other.Fulfillment)
                 ) &&
                 (
                     CostCentre == other.CostCentre ||
                     CostCentre != null &&
                     CostCentre.Equals(other.CostCentre)
                 ) &&
                 (
                     OwningUnit == other.OwningUnit ||
                     OwningUnit != null &&
                     OwningUnit.Equals(other.OwningUnit)
                 ) &&
                 (
                     ResourcingUnit == other.ResourcingUnit ||
                     ResourcingUnit != null &&
                     ResourcingUnit.Equals(other.ResourcingUnit)
                 ) &&
                 (
                     Requirement == other.Requirement ||
                     Requirement != null &&
                     Requirement.Equals(other.Requirement)
                 ) &&
                 (
                     Location == other.Location ||
                     Location != null &&
                     Location.Equals(other.Location)
                 ) &&
                 (
                     AdditionalDutyReason == other.AdditionalDutyReason ||
                     AdditionalDutyReason != null &&
                     AdditionalDutyReason.Equals(other.AdditionalDutyReason)
                 ) &&
                 (
                     DutyHasWarnings == other.DutyHasWarnings ||

                     DutyHasWarnings.Equals(other.DutyHasWarnings)
                 ));
        }
Example #4
0
        /// <summary>
        /// Returns true if Contract instances are equal
        /// </summary>
        /// <param name="other">Instance of Contract to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Contract other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     StaffGroup == other.StaffGroup ||
                     StaffGroup != null &&
                     StaffGroup.Equals(other.StaffGroup)
                     ) &&
                 (
                     Grade == other.Grade ||
                     Grade != null &&
                     Grade.Equals(other.Grade)
                 ) &&
                 (
                     _Contract == other._Contract ||
                     _Contract != null &&
                     _Contract.Equals(other._Contract)
                 ) &&
                 (
                     Payscale == other.Payscale ||
                     Payscale != null &&
                     Payscale.Equals(other.Payscale)
                 ) &&
                 (
                     ContractType == other.ContractType ||
                     ContractType != null &&
                     ContractType.Equals(other.ContractType)
                 ) &&
                 (
                     ContractedTime == other.ContractedTime ||
                     ContractedTime != null &&
                     ContractedTime.Equals(other.ContractedTime)
                 ) &&
                 (
                     DefaultUnavailabilityHours == other.DefaultUnavailabilityHours ||
                     DefaultUnavailabilityHours != null &&
                     DefaultUnavailabilityHours.Equals(other.DefaultUnavailabilityHours)
                 ) &&
                 (
                     WtdOptOut == other.WtdOptOut ||

                     WtdOptOut.Equals(other.WtdOptOut)
                 ) &&
                 (
                     SalaryFrequency == other.SalaryFrequency ||
                     SalaryFrequency != null &&
                     SalaryFrequency.Equals(other.SalaryFrequency)
                 ) &&
                 (
                     SalaryAmount == other.SalaryAmount ||

                     SalaryAmount.Equals(other.SalaryAmount)
                 ));
        }