예제 #1
0
파일: Car.cs 프로젝트: gj-arrow/4-task
 protected bool Equals(Car car)
 {
     return(Make.Equals(car.Make) &&
            Model.Equals(car.Model) &&
            Year.Equals(car.Year) &&
            CharacteristicsCar.Equals(car.CharacteristicsCar));
 }
예제 #2
0
        public bool Equals(BikeModel other)
        {
            if (other == null)
            {
                return(false);
            }

            bool makeEqual  = Make.Equals(other.Make);
            bool modelEqual = Model.Equals(other.Model);
            bool typeEqual  = Type.Equals(other.Type);

            return(makeEqual && modelEqual && typeEqual);
        }
예제 #3
0
        public void Accelerate()
        {
            if (Make == null)
            {
                Make = "";
            }

            if (Make.Equals("Ferrari"))
            {
                Speed = Speed + 20;
            }

            else
            {
                Speed = Speed + 10;
            }

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

            return
                ((
                     Id == other.Id ||
                     Id.Equals(other.Id)
                     ) &&
                 (
                     EquipmentType == other.EquipmentType ||
                     EquipmentType != null &&
                     EquipmentType.Equals(other.EquipmentType)
                 ) &&
                 (
                     OwnerName == other.OwnerName ||
                     OwnerName != null &&
                     OwnerName.Equals(other.OwnerName)
                 ) &&
                 (
                     OwnerId == other.OwnerId ||
                     OwnerId != null &&
                     OwnerId.Equals(other.OwnerId)
                 ) &&
                 (
                     IsHired == other.IsHired ||
                     IsHired.Equals(other.IsHired)
                 ) &&
                 (
                     SeniorityString == other.SeniorityString ||
                     SeniorityString != null &&
                     SeniorityString.Equals(other.SeniorityString)
                 ) &&
                 (
                     Make == other.Make ||
                     Make != null &&
                     Make.Equals(other.Make)
                 ) &&
                 (
                     Model == other.Model ||
                     Model != null &&
                     Model.Equals(other.Model)
                 ) &&
                 (
                     Size == other.Size ||
                     Size != null &&
                     Size.Equals(other.Size)
                 ) &&
                 (
                     EquipmentCode == other.EquipmentCode ||
                     EquipmentCode != null &&
                     EquipmentCode.Equals(other.EquipmentCode)
                 ) &&
                 (
                     AttachmentCount == other.AttachmentCount ||
                     AttachmentCount.Equals(other.AttachmentCount)
                 ) &&
                 (
                     LastVerifiedDate == other.LastVerifiedDate ||
                     LastVerifiedDate != null &&
                     LastVerifiedDate.Equals(other.LastVerifiedDate)
                 ) &&
                 (
                     SenioritySortOrder == other.SenioritySortOrder ||
                     SenioritySortOrder.Equals(other.SenioritySortOrder)
                 ));
        }
예제 #5
0
        /// <summary>
        /// Returns true if SeniorityViewModel instances are equal
        /// </summary>
        /// <param name="other">Instance of SeniorityViewModel to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(SeniorityViewModel other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Id == other.Id ||
                     Id.Equals(other.Id)
                     ) &&
                 (
                     EquipmentType == other.EquipmentType ||
                     EquipmentType != null &&
                     EquipmentType.Equals(other.EquipmentType)
                 ) &&
                 (
                     OwnerName == other.OwnerName ||
                     OwnerName != null &&
                     OwnerName.Equals(other.OwnerName)
                 ) &&
                 (
                     OwnerId == other.OwnerId ||
                     OwnerId != null &&
                     OwnerId.Equals(other.OwnerId)
                 ) &&
                 (
                     SeniorityString == other.SeniorityString ||
                     SeniorityString != null &&
                     SeniorityString.Equals(other.SeniorityString)
                 ) &&
                 (
                     Seniority == other.Seniority ||
                     Seniority != null &&
                     Seniority.Equals(other.Seniority)
                 ) &&
                 (
                     Make == other.Make ||
                     Make != null &&
                     Make.Equals(other.Make)
                 ) &&
                 (
                     Model == other.Model ||
                     Model != null &&
                     Model.Equals(other.Model)
                 ) &&
                 (
                     Size == other.Size ||
                     Size != null &&
                     Size.Equals(other.Size)
                 ) &&
                 (
                     EquipmentCode == other.EquipmentCode ||
                     EquipmentCode != null &&
                     EquipmentCode.Equals(other.EquipmentCode)
                 ) &&
                 (
                     LastCalled == other.LastCalled ||
                     LastCalled != null &&
                     LastCalled.Equals(other.LastCalled)
                 ) &&
                 (
                     YearsRegistered == other.YearsRegistered ||
                     YearsRegistered != null &&
                     YearsRegistered.Equals(other.YearsRegistered)
                 ) &&
                 (
                     YtdHours == other.YtdHours ||
                     YtdHours != null &&
                     YtdHours.Equals(other.YtdHours)
                 ) &&
                 (
                     HoursYearMinus1 == other.HoursYearMinus1 ||
                     HoursYearMinus1 != null &&
                     HoursYearMinus1.Equals(other.HoursYearMinus1)
                 ) &&
                 (
                     HoursYearMinus2 == other.HoursYearMinus2 ||
                     HoursYearMinus2 != null &&
                     HoursYearMinus2.Equals(other.HoursYearMinus2)
                 ) &&
                 (
                     HoursYearMinus3 == other.HoursYearMinus3 ||
                     HoursYearMinus3 != null &&
                     HoursYearMinus3.Equals(other.HoursYearMinus3)
                 ) &&
                 (
                     SenioritySortOrder == other.SenioritySortOrder ||
                     SenioritySortOrder.Equals(other.SenioritySortOrder)
                 ));
        }