예제 #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);
            }

            Employee other = (Employee)obj;

            return(EmployeeId == other.EmployeeId &&
                   PositionId == other.PositionId &&
                   string.Equals(FirstName, other.FirstName) &&
                   string.Equals(LastName, other.LastName) &&
                   string.Equals(Patronymic, other.Patronymic) &&
                   BirthDate.Equals(other.BirthDate) &&
                   string.Equals(Address, other.Address) &&
                   string.Equals(Phone, other.Phone) &&
                   string.Equals(Education, other.Education) &&
                   EmploymentDate.Equals(other.EmploymentDate) &&
                   Deleted == other.Deleted);
        }
예제 #2
0
파일: Employee.cs 프로젝트: h3yTr0uble/epam
        public override int GetHashCode()
        {
            var hashCode = 1502939027;

            hashCode = hashCode * -1521134295 + FirstName.GetHashCode();
            hashCode = hashCode * -1521134295 + LastName.GetHashCode();
            if (MiddleName != null)
            {
                hashCode = hashCode * -1521134295 + MiddleName.GetHashCode();
            }
            hashCode = hashCode * -1521134295 + Birthday.GetHashCode();
            hashCode = hashCode * -1521134295 + Post.GetHashCode();
            hashCode = hashCode * -1521134295 + EmploymentDate.GetHashCode();
            return(hashCode);
        }
예제 #3
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = EmployeeId;
         hashCode = (hashCode * 397) ^ PositionId;
         hashCode = (hashCode * 397) ^ (FirstName != null ? FirstName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (LastName != null ? LastName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Patronymic != null ? Patronymic.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ BirthDate.GetHashCode();
         hashCode = (hashCode * 397) ^ (Address != null ? Address.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Phone != null ? Phone.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Education != null ? Education.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ EmploymentDate.GetHashCode();
         hashCode = (hashCode * 397) ^ Deleted.GetHashCode();
         return(hashCode);
     }
 }
예제 #4
0
 public override string ToString()
 {
     return(String.Format(ID + "; " + Surname + "; " + Name + "; " + SecondName + "; " + BirthDay.ToShortDateString() + "; " + EmploymentDate.ToShortDateString() + "; " + Position + "; " + Division + "; " + Room + "; " + Phone + "; " + Email + "; " + Salary + "; " + Notes));
 }
예제 #5
0
 public override string ToString()
 {
     return($"Должность: {Post}, Имя: {Name}, Фамилия: {Surname}, Отчество: {Patronymic}, Дата трудоустройства: {EmploymentDate.ToString()}");
 }
예제 #6
0
 public override string ToString()
 {
     return(base.ToString() + ($" EmploymentDate: {EmploymentDate.ToString("dd/MM/yyyy")}, Salary: {Salary}"));
 }
예제 #7
0
 public override string ToString()
 {
     return(string.Format("{0} (трудоустроен {1})", FIO, EmploymentDate.ToString()));
 }