public int CompareTo(ForReportOnAccountingSupplies other)
        {
            const StringComparison comparisonIgnoreCase = StringComparison.OrdinalIgnoreCase;

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

            if (ReferenceEquals(null, other))
            {
                return(1);
            }
            var typeGroupComparison = string.Compare(TypeGroup, other.TypeGroup, comparisonIgnoreCase);

            if (typeGroupComparison != 0)
            {
                return(typeGroupComparison);
            }
            var typeComparison = string.Compare(Type, other.Type, comparisonIgnoreCase);

            if (typeComparison != 0)
            {
                return(typeComparison);
            }
            var categoryComparison = string.Compare(Category, other.Category, comparisonIgnoreCase);

            if (categoryComparison != 0)
            {
                return(categoryComparison);
            }
            var territoryComparison = string.Compare(Territory, other.Territory, comparisonIgnoreCase);

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

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

            if (costComparison != 0)
            {
                return(costComparison);
            }
            var summNdsComparison = SummNds.CompareTo(other.SummNds);

            if (summNdsComparison != 0)
            {
                return(summNdsComparison);
            }
            return(CostUsd.CompareTo(other.CostUsd));
        }
Пример #2
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (TypeGroup != null ? StringComparer.OrdinalIgnoreCase.GetHashCode(TypeGroup) : 0);
         hashCode = (hashCode * 397) ^ (Type != null ? StringComparer.OrdinalIgnoreCase.GetHashCode(Type) : 0);
         hashCode = (hashCode * 397) ^ (Territory != null ? StringComparer.OrdinalIgnoreCase.GetHashCode(Territory) : 0);
         hashCode = (hashCode * 397) ^ Count.GetHashCode();
         hashCode = (hashCode * 397) ^ Cost.GetHashCode();
         hashCode = (hashCode * 397) ^ SummNds.GetHashCode();
         hashCode = (hashCode * 397) ^ CostUsd.GetHashCode();
         return(hashCode);
     }
 }
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (TypeGroup != null ? StringComparer.OrdinalIgnoreCase.GetHashCode(TypeGroup) : 0);
         hashCode = (hashCode * 397) ^ (Type != null ? StringComparer.OrdinalIgnoreCase.GetHashCode(Type) : 0);
         hashCode = (hashCode * 397) ^ (Category != null ? StringComparer.OrdinalIgnoreCase.GetHashCode(Category) : 0);
         hashCode = (hashCode * 397) ^ (Territory != null ? StringComparer.OrdinalIgnoreCase.GetHashCode(Territory) : 0);
         hashCode = (hashCode * 397) ^ (Name != null ? StringComparer.OrdinalIgnoreCase.GetHashCode(Name) : 0);
         hashCode = (hashCode * 397) ^ Count.GetHashCode();
         hashCode = (hashCode * 397) ^ Cost.GetHashCode();
         hashCode = (hashCode * 397) ^ SummNds.GetHashCode();
         hashCode = (hashCode * 397) ^ (NameCompany != null ? StringComparer.OrdinalIgnoreCase.GetHashCode(NameCompany) : 0);
         hashCode = (hashCode * 397) ^ Ttn.GetHashCode();
         hashCode = (hashCode * 397) ^ ShipmentDate.GetHashCode();
         hashCode = (hashCode * 397) ^ (ContractNumber != null ? StringComparer.OrdinalIgnoreCase.GetHashCode(ContractNumber) : 0);
         hashCode = (hashCode * 397) ^ ContractDate.GetHashCode();
         hashCode = (hashCode * 397) ^ (IntentionBay != null ? StringComparer.OrdinalIgnoreCase.GetHashCode(IntentionBay) : 0);
         hashCode = (hashCode * 397) ^ (PaymentForm != null ? StringComparer.OrdinalIgnoreCase.GetHashCode(PaymentForm) : 0);
         hashCode = (hashCode * 397) ^ (WorkGuild != null ? StringComparer.OrdinalIgnoreCase.GetHashCode(WorkGuild) : 0);
         return(hashCode);
     }
 }
        public int CompareTo(ForReportOnAccountingSuppliesMonth other)
        {
            const StringComparison comparisonIgnoreCase = StringComparison.OrdinalIgnoreCase;

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

            if (ReferenceEquals(null, other))
            {
                return(1);
            }
            var typeGroupComparison = string.Compare(TypeGroup, other.TypeGroup, comparisonIgnoreCase);

            if (typeGroupComparison != 0)
            {
                return(typeGroupComparison);
            }
            var typeComparison = string.Compare(Type, other.Type, comparisonIgnoreCase);

            if (typeComparison != 0)
            {
                return(typeComparison);
            }
            var categoryComparison = string.Compare(Category, other.Category, comparisonIgnoreCase);

            if (categoryComparison != 0)
            {
                return(categoryComparison);
            }
            var territoryComparison = string.Compare(Territory, other.Territory, comparisonIgnoreCase);

            if (territoryComparison != 0)
            {
                return(territoryComparison);
            }
            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 summNdsComparison = SummNds.CompareTo(other.SummNds);

            if (summNdsComparison != 0)
            {
                return(summNdsComparison);
            }
            var nameCompanyComparison = string.Compare(NameCompany, other.NameCompany, comparisonIgnoreCase);

            if (nameCompanyComparison != 0)
            {
                return(nameCompanyComparison);
            }
            var ttnComparison = Ttn.CompareTo(other.Ttn);

            if (ttnComparison != 0)
            {
                return(ttnComparison);
            }
            var shipmentDateComparison = ShipmentDate.CompareTo(other.ShipmentDate);

            if (shipmentDateComparison != 0)
            {
                return(shipmentDateComparison);
            }
            var contractNumberComparison = string.Compare(ContractNumber, other.ContractNumber, comparisonIgnoreCase);

            if (contractNumberComparison != 0)
            {
                return(contractNumberComparison);
            }
            var contractDateComparison = ContractDate.CompareTo(other.ContractDate);

            if (contractDateComparison != 0)
            {
                return(contractDateComparison);
            }
            var intentionBayComparison = string.Compare(IntentionBay, other.IntentionBay, comparisonIgnoreCase);

            if (intentionBayComparison != 0)
            {
                return(intentionBayComparison);
            }
            var paymentFormComparison = string.Compare(PaymentForm, other.PaymentForm, comparisonIgnoreCase);

            if (paymentFormComparison != 0)
            {
                return(paymentFormComparison);
            }
            return(string.Compare(WorkGuild, other.WorkGuild, comparisonIgnoreCase));
        }