Exemplo n.º 1
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = NumberTtn.GetHashCode();
         hashCode = (hashCode * 397) ^ Date.GetHashCode();
         hashCode = (hashCode * 397) ^ (Company != null ? StringComparer.OrdinalIgnoreCase.GetHashCode(Company) : 0);
         hashCode = (hashCode * 397) ^ (Name != null ? StringComparer.OrdinalIgnoreCase.GetHashCode(Name) : 0);
         hashCode = (hashCode * 397) ^ Count.GetHashCode();
         hashCode = (hashCode * 397) ^ Cost.GetHashCode();
         hashCode = (hashCode * 397) ^ CostUsd.GetHashCode();
         hashCode = (hashCode * 397) ^ YearSumma.GetHashCode();
         hashCode = (hashCode * 397) ^ YearSummaUsd.GetHashCode();
         return(hashCode);
     }
 }
Exemplo n.º 2
0
        public int CompareTo(ShipmentInRussia other)
        {
            const StringComparison comparisonIgnoreCase = StringComparison.OrdinalIgnoreCase;

            if (ReferenceEquals(this, other))
            {
                return(0);
            }

            if (ReferenceEquals(null, other))
            {
                return(1);
            }
            var numberTtnComparison = NumberTtn.CompareTo(other.NumberTtn);

            if (numberTtnComparison != 0)
            {
                return(numberTtnComparison);
            }
            var dateComparison = Date.CompareTo(other.Date);

            if (dateComparison != 0)
            {
                return(dateComparison);
            }
            var companyComparison = string.Compare(Company, other.Company, comparisonIgnoreCase);

            if (companyComparison != 0)
            {
                return(companyComparison);
            }
            var nameComparison = string.Compare(Name, other.Name, comparisonIgnoreCase);

            if (nameComparison != 0)
            {
                return(nameComparison);
            }
            var countComparison = Count.CompareTo(other.Count);

            if (countComparison != 0)
            {
                return(countComparison);
            }
            var costComparison = Cost.CompareTo(other.Cost);

            if (costComparison != 0)
            {
                return(costComparison);
            }
            var costUsdComparison = CostUsd.CompareTo(other.CostUsd);

            if (costUsdComparison != 0)
            {
                return(costUsdComparison);
            }
            var yearSummaComparison = YearSumma.CompareTo(other.YearSumma);

            if (yearSummaComparison != 0)
            {
                return(yearSummaComparison);
            }
            return(YearSummaUsd.CompareTo(other.YearSummaUsd));
        }