Пример #1
0
        /// <summary>
        /// Returns true if Duty instances are equal
        /// </summary>
        /// <param name="other">Instance of Duty to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Duty other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     DutyId == other.DutyId ||
                     DutyId != null &&
                     DutyId.Equals(other.DutyId)
                     ) &&
                 (
                     SlaveDutyId == other.SlaveDutyId ||
                     SlaveDutyId != null &&
                     SlaveDutyId.Equals(other.SlaveDutyId)
                 ) &&
                 (
                     BlockId == other.BlockId ||
                     BlockId != null &&
                     BlockId.Equals(other.BlockId)
                 ) &&
                 (
                     ClientDeptId == other.ClientDeptId ||
                     ClientDeptId != null &&
                     ClientDeptId.Equals(other.ClientDeptId)
                 ) &&
                 (
                     SubDiscipline == other.SubDiscipline ||
                     SubDiscipline != null &&
                     SubDiscipline.Equals(other.SubDiscipline)
                 ) &&
                 (
                     RequestGender == other.RequestGender ||

                     RequestGender.Equals(other.RequestGender)
                 ) &&
                 (
                     Grade == other.Grade ||
                     Grade != null &&
                     Grade.Equals(other.Grade)
                 ) &&
                 (
                     FallbackGrade == other.FallbackGrade ||
                     FallbackGrade != null &&
                     FallbackGrade.Equals(other.FallbackGrade)
                 ) &&
                 (
                     VacancyReason == other.VacancyReason ||
                     VacancyReason != null &&
                     VacancyReason.Equals(other.VacancyReason)
                 ) &&
                 (
                     Date == other.Date ||
                     Date != null &&
                     Date.Equals(other.Date)
                 ) &&
                 (
                     StartTime == other.StartTime ||
                     StartTime != null &&
                     StartTime.Equals(other.StartTime)
                 ) &&
                 (
                     EndTime == other.EndTime ||
                     EndTime != null &&
                     EndTime.Equals(other.EndTime)
                 ) &&
                 (
                     BreakDuration == other.BreakDuration ||

                     BreakDuration.Equals(other.BreakDuration)
                 ) &&
                 (
                     PoNumber == other.PoNumber ||

                     PoNumber.Equals(other.PoNumber)
                 ) &&
                 (
                     UniqueNumber == other.UniqueNumber ||

                     UniqueNumber.Equals(other.UniqueNumber)
                 ) &&
                 (
                     Agency == other.Agency ||
                     Agency != null &&
                     Agency.Equals(other.Agency)
                 ) &&
                 (
                     Skill == other.Skill ||
                     Skill != null &&
                     Skill.Equals(other.Skill)
                 ) &&
                 (
                     Specialty == other.Specialty ||
                     Specialty != null &&
                     Specialty.Equals(other.Specialty)
                 ) &&
                 (
                     FallbackSkill == other.FallbackSkill ||
                     FallbackSkill != null &&
                     FallbackSkill.Equals(other.FallbackSkill)
                 ) &&
                 (
                     FallbackSpeciality == other.FallbackSpeciality ||
                     FallbackSpeciality != null &&
                     FallbackSpeciality.Equals(other.FallbackSpeciality)
                 ) &&
                 (
                     Status == other.Status ||

                     Status.Equals(other.Status)
                 ) &&
                 (
                     Rates == other.Rates ||
                     Rates != null &&
                     other.Rates != null &&
                     Rates.SequenceEqual(other.Rates)
                 ) &&
                 (
                     TimeIntervalRates == other.TimeIntervalRates ||
                     TimeIntervalRates != null &&
                     other.TimeIntervalRates != null &&
                     TimeIntervalRates.SequenceEqual(other.TimeIntervalRates)
                 ) &&
                 (
                     Person == other.Person ||
                     Person != null &&
                     Person.Equals(other.Person)
                 ));
        }
Пример #2
0
        /// <summary>
        /// Returns true if Duty instances are equal
        /// </summary>
        /// <param name="other">Instance of Duty to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Duty other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                     ) &&
                 (
                     When == other.When ||
                     When != null &&
                     When.Equals(other.When)
                 ) &&
                 (
                     Where == other.Where ||
                     Where != null &&
                     Where.Equals(other.Where)
                 ) &&
                 (
                     Requirements == other.Requirements ||
                     Requirements != null &&
                     Requirements.Equals(other.Requirements)
                 ) &&
                 (
                     ClientDeptId == other.ClientDeptId ||
                     ClientDeptId != null &&
                     ClientDeptId.Equals(other.ClientDeptId)
                 ) &&
                 (
                     SubDiscipline == other.SubDiscipline ||
                     SubDiscipline != null &&
                     SubDiscipline.Equals(other.SubDiscipline)
                 ) &&
                 (
                     Grade == other.Grade ||
                     Grade != null &&
                     Grade.Equals(other.Grade)
                 ) &&
                 (
                     FallbackGrade == other.FallbackGrade ||
                     FallbackGrade != null &&
                     FallbackGrade.Equals(other.FallbackGrade)
                 ) &&
                 (
                     VacancyReason == other.VacancyReason ||
                     VacancyReason != null &&
                     VacancyReason.Equals(other.VacancyReason)
                 ) &&
                 (
                     PoNumber == other.PoNumber ||

                     PoNumber.Equals(other.PoNumber)
                 ) &&
                 (
                     UniqueNumber == other.UniqueNumber ||

                     UniqueNumber.Equals(other.UniqueNumber)
                 ) &&
                 (
                     Agency == other.Agency ||
                     Agency != null &&
                     Agency.Equals(other.Agency)
                 ));
        }