public int CompareTo(Employee other) { if (other != null) { return(Salary.CompareTo(other.Salary)); } else { throw new ArgumentException("Object is not a Employee"); } }
public int CompareTo(Developer other) { // int intSeniority = (int)Seniority; int firstIsbetter = 1; if (Seniority.CompareTo(other.Seniority) <= 0) { if (Seniority.CompareTo(other.Seniority) < 0) { firstIsbetter = -1; } else if (Salary.CompareTo(other.Salary) < 0) { firstIsbetter = 1; } } return(firstIsbetter); }
public int CompareTo(WorkerBase other) { return(-Salary.CompareTo(other.Salary)); }