예제 #1
0
 public string GetPersonalInfo()
 {
     if (Age() < 18)
     {
         return($"\nName: {FullName()} < IT`S CHILD >  \nBirthDate: {BirthDate.ToShortDateString()} \nAge: {Age()} \nRate: {HourRate = 0} $ \nSalary: {OverallEarnings} $ \n...................\n");
     }
     return($"\nName: {FullName()}  \nBirthDate: {BirthDate.ToShortDateString()} \nAge: {Age()} \nRate: {HourRate} $ \nSalary: {OverallEarnings} $ \n...................\n");
 }
예제 #2
0
 ////////
 public bool Equals(Employee other)
 {
     if (other == null)
     {
         throw new Exception("employee can not be null");
     }
     return(Surname.Equals(other.Surname) &&
            Name.Equals(other.Name) &&
            MiddleName.Equals(other.MiddleName) &&
            BirthDate.Equals(other.BirthDate) &&
            WorkExperience.Equals(other.WorkExperience) &&
            Position.Equals(other.Position));
 }
            public override string ToString()
            {
                string str = Surname + " " + Name + " " + Patronymic + ". Дата рождения: " + BirthDate.ToString("d");

                str += ". Работает уже " + Experience.ToString() + " лет. " + Dolzh + ".";
                return(str);
            }
예제 #4
0
 public override string ToString()
 {
     return($"Surname: {Surname}, name: {Name}, middle name: {MiddleName}, birth date: {BirthDate.ToString("d")}, age: {Age}");
 }