Example #1
0
        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj))
            {
                return(false);
            }
            if (ReferenceEquals(this, obj))
            {
                return(true);
            }
            if (obj.GetType() != this.GetType())
            {
                return(false);
            }

            Holiday other = (Holiday)obj;

            return(HolidayId == other.HolidayId &&
                   EmployeeId == other.EmployeeId &&
                   StartDate.Equals(other.StartDate) &&
                   FinalDate.Equals(other.FinalDate) &&
                   string.Equals(Type, other.Type) &&
                   Salary.Equals(other.Salary) &&
                   Deleted == other.Deleted);
        }
Example #2
0
        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj))
            {
                return(false);
            }
            if (ReferenceEquals(this, obj))
            {
                return(true);
            }
            if (obj.GetType() != this.GetType())
            {
                return(false);
            }

            Position other = (Position)obj;

            return(PositionId == other.PositionId &&
                   DepartmentId == other.DepartmentId &&
                   string.Equals(Name, other.Name) &&
                   Salary.Equals(other.Salary) &&
                   string.Equals(Duties, other.Duties) &&
                   string.Equals(Requirements, other.Requirements) &&
                   Deleted == other.Deleted);
        }
Example #3
0
 public bool Equals(Employee objB)
 {
     return(((Id == null && objB.Id == null) || Id.Equals(objB.Id)) &&
            ((Salary == null && objB.Salary == null) || Salary.Equals(objB.Salary)) &&
            ((Experience == null && objB.Experience == null) || Experience.Equals(objB.Experience)) &&
            ((string.IsNullOrEmpty(Specialization) && string.IsNullOrEmpty(objB.Specialization)) || Specialization.Equals(objB.Specialization)) &&
            ((string.IsNullOrEmpty(Position) && string.IsNullOrEmpty(objB.Position)) || Position.Equals(objB.Position)) &&
            ((string.IsNullOrEmpty(Name) && string.IsNullOrEmpty(objB.Name)) || Name.Equals(objB.Name)));
 }
Example #4
0
 public bool Equals(Employee other)
 {
     if (other == null)
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(Id.Equals(other.Id) && Name.Equals(other.Name) &&
            Surname.Equals(other.Surname) && Patronymic.Equals(other.Patronymic) &&
            DepartmentId.Equals(other.DepartmentId) && IsFired.Equals(other.IsFired) &&
            Salary.Equals(other.Salary) && DateHired.Equals(other.DateHired) &&
            DateFired.Equals(other.DateFired));
 }
Example #5
0
 public override bool Equals(object obj)
 {
     return(Id.Equals(((Person)obj).Id) && Name.Equals(((Person)obj).Name) && Gender.Equals(((Person)obj).Gender) && DepartmentId.Equals(((Person)obj).DepartmentId) && Salary.Equals(((Person)obj).Salary));
 }
Example #6
0
        /// <summary>
        /// Returns true if Employee instances are equal
        /// </summary>
        /// <param name="other">Instance of Employee to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Employee other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     EmployeeId == other.EmployeeId ||
                     EmployeeId != null &&
                     EmployeeId.Equals(other.EmployeeId)
                     ) &&
                 (
                     EmployeeCode == other.EmployeeCode ||
                     EmployeeCode != null &&
                     EmployeeCode.Equals(other.EmployeeCode)
                 ) &&
                 (
                     EmployeeName == other.EmployeeName ||
                     EmployeeName != null &&
                     EmployeeName.Equals(other.EmployeeName)
                 ) &&
                 (
                     Gender == other.Gender ||

                     Gender.Equals(other.Gender)
                 ) &&
                 (
                     DateOfBirth == other.DateOfBirth ||
                     DateOfBirth != null &&
                     DateOfBirth.Equals(other.DateOfBirth)
                 ) &&
                 (
                     PhoneNumber == other.PhoneNumber ||
                     PhoneNumber != null &&
                     PhoneNumber.Equals(other.PhoneNumber)
                 ) &&
                 (
                     DepartmentId == other.DepartmentId ||
                     DepartmentId != null &&
                     DepartmentId.Equals(other.DepartmentId)
                 ) &&
                 (
                     DepartmentName == other.DepartmentName ||
                     DepartmentName != null &&
                     DepartmentName.Equals(other.DepartmentName)
                 ) &&
                 (
                     Email == other.Email ||
                     Email != null &&
                     Email.Equals(other.Email)
                 ) &&
                 (
                     Salary == other.Salary ||

                     Salary.Equals(other.Salary)
                 ) &&
                 (
                     WorkStatus == other.WorkStatus ||

                     WorkStatus.Equals(other.WorkStatus)
                 ) &&
                 (
                     PositionId == other.PositionId ||
                     PositionId != null &&
                     PositionId.Equals(other.PositionId)
                 ) &&
                 (
                     PositionName == other.PositionName ||
                     PositionName != null &&
                     PositionName.Equals(other.PositionName)
                 ) &&
                 (
                     TaxCode == other.TaxCode ||
                     TaxCode != null &&
                     TaxCode.Equals(other.TaxCode)
                 ) &&
                 (
                     JoinDate == other.JoinDate ||
                     JoinDate != null &&
                     JoinDate.Equals(other.JoinDate)
                 ) &&
                 (
                     IdentityNumber == other.IdentityNumber ||
                     IdentityNumber != null &&
                     IdentityNumber.Equals(other.IdentityNumber)
                 ) &&
                 (
                     IdentityDate == other.IdentityDate ||
                     IdentityDate != null &&
                     IdentityDate.Equals(other.IdentityDate)
                 ) &&
                 (
                     IdentityPlace == other.IdentityPlace ||
                     IdentityPlace != null &&
                     IdentityPlace.Equals(other.IdentityPlace)
                 ));
        }