Пример #1
0
        public int CompareTo(ContactData other)
        {
            if (Object.ReferenceEquals(other, null))
            {
                return(1);
            }
            int ret = Lname.CompareTo(other.Lname);

            if (ret == 0)
            {
                return(Fname.CompareTo(other.Fname));
            }
            else
            {
                return(ret);
            }
        }
Пример #2
0
        public int CompareTo(object obj)
        {
            int        Result = 0;
            ClubMember Other  = (ClubMember)obj;

            Result = Nr.CompareTo(Other.Nr);

            if (Result == 0)
            {
                Result = Fname.CompareTo(Other.Fname);
            }

            if (Result == 0)
            {
                Result = Lname.CompareTo(Other.Lname);
            }

            if (Result == 0)
            {
                Result = Age.CompareTo(Other.Age);
            }

            return(Result);
        }