Ejemplo n.º 1
0
        /// <summary>
        /// Returns true if Attribute instances are equal
        /// </summary>
        /// <param name="other">Instance of Attribute to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Attribute other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Validity == other.Validity ||
                     Validity != null &&
                     Validity.Equals(other.Validity)
                     ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     Value == other.Value ||
                     Value != null &&
                     Value.Equals(other.Value)
                 ));
        }
Ejemplo n.º 2
0
        public override void AddCar(Car car)
        {
            bool check = Validity.Equals("Valid");

            if (Cars.Count != MaxParticipant)
            {
                if (car.MaxSpeed >= MinimumSpeed)
                {
                    if (car.Validity == check)
                    {
                        Cars.Add(car);
                    }
                    else
                    {
                        throw new InvalidCar("This car doesn't meet with the requirments! - The car's validity is Invalid!");
                    }
                }
                else
                {
                    throw new InvalidCar($"This car doesn't meet with the requirments! - Too slow ('{car.MaxSpeed}km/h / {MinimumSpeed}km/h')");
                }
            }
            else
            {
                throw new InvalidCar("You can't add this car to the race because it's full!");
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Returns true if Specialty instances are equal
        /// </summary>
        /// <param name="other">Instance of Specialty to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Specialty other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     TempStaffSpeciality == other.TempStaffSpeciality ||
                     TempStaffSpeciality != null &&
                     TempStaffSpeciality.Equals(other.TempStaffSpeciality)
                     ) &&
                 (
                     Validity == other.Validity ||
                     Validity != null &&
                     Validity.Equals(other.Validity)
                 ) &&
                 (
                     Notes == other.Notes ||
                     Notes != null &&
                     Notes.Equals(other.Notes)
                 ));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Returns true if Skill instances are equal
        /// </summary>
        /// <param name="other">Instance of Skill to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Skill other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     SkillGroup == other.SkillGroup ||
                     SkillGroup != null &&
                     SkillGroup.Equals(other.SkillGroup)
                     ) &&
                 (
                     Cluster == other.Cluster ||
                     Cluster != null &&
                     Cluster.Equals(other.Cluster)
                 ) &&
                 (
                     _Skill == other._Skill ||
                     _Skill != null &&
                     _Skill.Equals(other._Skill)
                 ) &&
                 (
                     Validity == other.Validity ||
                     Validity != null &&
                     Validity.Equals(other.Validity)
                 ) &&
                 (
                     DateGained == other.DateGained ||
                     DateGained != null &&
                     DateGained.Equals(other.DateGained)
                 ) &&
                 (
                     ObtainedFromReason == other.ObtainedFromReason ||
                     ObtainedFromReason != null &&
                     ObtainedFromReason.Equals(other.ObtainedFromReason)
                 ) &&
                 (
                     CertificateNumber == other.CertificateNumber ||
                     CertificateNumber != null &&
                     CertificateNumber.Equals(other.CertificateNumber)
                 ) &&
                 (
                     Notes == other.Notes ||
                     Notes != null &&
                     Notes.Equals(other.Notes)
                 ));
        }
Ejemplo n.º 5
0
 protected bool Equals(Coupon other)
 {
     return(CouponId == other.CouponId &&
            Description == other.Description &&
            FriendlyDescription == other.FriendlyDescription &&
            Remark == other.Remark &&
            Code == other.Code &&
            Discount == other.Discount &&
            Equals(Store, other.Store) &&
            Equals(Category, other.Category) &&
            Validity.Equals(other.Validity) &&
            Equals(CouponLink, other.CouponLink) &&
            New == other.New &&
            IsPercentage == other.IsPercentage &&
            Shipping == other.Shipping);
 }
Ejemplo n.º 6
0
        /// <summary>
        /// Returns true if WorkingRestriction instances are equal
        /// </summary>
        /// <param name="other">Instance of WorkingRestriction to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(WorkingRestriction other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Title == other.Title ||
                     Title != null &&
                     Title.Equals(other.Title)
                     ) &&
                 (
                     Validity == other.Validity ||
                     Validity != null &&
                     Validity.Equals(other.Validity)
                 ) &&
                 (
                     HoursOfWork == other.HoursOfWork ||
                     HoursOfWork != null &&
                     HoursOfWork.Equals(other.HoursOfWork)
                 ) &&
                 (
                     DefaultLeaveHours == other.DefaultLeaveHours ||
                     DefaultLeaveHours != null &&
                     DefaultLeaveHours.Equals(other.DefaultLeaveHours)
                 ) &&
                 (
                     Restrictions == other.Restrictions ||
                     Restrictions != null &&
                     Restrictions.Equals(other.Restrictions)
                 ));
        }