Example #1
0
        /// <summary>
        /// Provides the IComparable interface definitions
        /// </summary>
        public int CompareTo(Animal other)
        {
            if (other == null)
            {
                throw new ArgumentNullException("other");
            }

            return(ChipRegistrationNumber.CompareTo(other.ChipRegistrationNumber));
        }
Example #2
0
 /// <summary>
 ///     Retrieves information about this animal
 /// </summary>
 /// <returns>
 ///     A string containing the information of this animal.
 /// </returns>
 public override string ToString()
 {
     return(string.Format("{0}, {1}, {2}, {3}, {4}, {5}",
                          ChipRegistrationNumber.ToString("D5"),
                          DateOfBirth == null ? "00-00-0000" : DateOfBirth.ToString(),
                          string.IsNullOrEmpty(Name) ? "noname" : Name,
                          Reserved ? "reserved" : "not reserved",
                          Price.ToString("C"),
                          Gender));
 }
Example #3
0
 public int CompareTo(Animal otherAnimal)
 {
     return(ChipRegistrationNumber.CompareTo(otherAnimal.ChipRegistrationNumber));
 }