public int CompareTo(ControlDebts other) { const StringComparison comparisonIgnoreCase = StringComparison.OrdinalIgnoreCase; if (ReferenceEquals(this, other)) { return(0); } if (ReferenceEquals(null, other)) { return(1); } 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 ttnComparison = Ttn.CompareTo(other.Ttn); if (ttnComparison != 0) { return(ttnComparison); } var costComparison = Cost.CompareTo(other.Cost); if (costComparison != 0) { return(costComparison); } var numberContractComparison = string.Compare(NumberContract, other.NumberContract, comparisonIgnoreCase); if (numberContractComparison != 0) { return(numberContractComparison); } var formPaymentComparison = string.Compare(FormPayment, other.FormPayment, comparisonIgnoreCase); if (formPaymentComparison != 0) { return(formPaymentComparison); } var shipmentDateComparison = ShipmentDate.CompareTo(other.ShipmentDate); if (shipmentDateComparison != 0) { return(shipmentDateComparison); } return(PaymentDate.CompareTo(other.PaymentDate)); }
protected bool Equals(AtTheExpenseOfWages other) { const StringComparison comparisonIgnoreCase = StringComparison.OrdinalIgnoreCase; return(Ttn == other.Ttn && ShipmentDate.Equals(other.ShipmentDate) && string.Equals(Name, other.Name, comparisonIgnoreCase) && Count == other.Count && Cost == other.Cost); }
public override int GetHashCode() { unchecked { var hashCode = Ttn.GetHashCode(); hashCode = (hashCode * 397) ^ ShipmentDate.GetHashCode(); hashCode = (hashCode * 397) ^ (Name != null ? StringComparer.OrdinalIgnoreCase.GetHashCode(Name) : 0); hashCode = (hashCode * 397) ^ Count.GetHashCode(); hashCode = (hashCode * 397) ^ Cost.GetHashCode(); return(hashCode); } }
protected bool Equals(ControlDebts other) { const StringComparison comparisonIgnoreCase = StringComparison.OrdinalIgnoreCase; return(string.Equals(Company, other.Company, comparisonIgnoreCase) && string.Equals(Name, other.Name, comparisonIgnoreCase) && Ttn == other.Ttn && Cost == other.Cost && string.Equals(NumberContract, other.NumberContract, comparisonIgnoreCase) && string.Equals(FormPayment, other.FormPayment, comparisonIgnoreCase) && ShipmentDate.Equals(other.ShipmentDate) && PaymentDate.Equals(other.PaymentDate)); }
private void Cancel_Click(object sender, RoutedEventArgs e) { CustName.Clear(); SalesOrderNo.Clear(); ReferenceNo.Clear(); SalesOrderDate.Clear(); ShipmentDate.Clear(); SubTotal.Clear(); Adjustment.Clear(); Total.Clear(); CustNotes.Clear(); TermAndCondns.Clear(); }
public override int GetHashCode() { unchecked { var hashCode = (Company != null ? StringComparer.OrdinalIgnoreCase.GetHashCode(Company) : 0); hashCode = (hashCode * 397) ^ (Name != null ? StringComparer.OrdinalIgnoreCase.GetHashCode(Name) : 0); hashCode = (hashCode * 397) ^ Ttn.GetHashCode(); hashCode = (hashCode * 397) ^ Cost.GetHashCode(); hashCode = (hashCode * 397) ^ (NumberContract != null ? StringComparer.OrdinalIgnoreCase.GetHashCode(NumberContract) : 0); hashCode = (hashCode * 397) ^ (FormPayment != null ? StringComparer.OrdinalIgnoreCase.GetHashCode(FormPayment) : 0); hashCode = (hashCode * 397) ^ ShipmentDate.GetHashCode(); hashCode = (hashCode * 397) ^ PaymentDate.GetHashCode(); return(hashCode); } }
protected bool Equals(ForReportOnAccountingSuppliesMonth other) { const StringComparison comparisonIgnoreCase = StringComparison.OrdinalIgnoreCase; return(string.Equals(TypeGroup, other.TypeGroup, comparisonIgnoreCase) && string.Equals(Type, other.Type, comparisonIgnoreCase) && string.Equals(Category, other.Category, comparisonIgnoreCase) && string.Equals(Territory, other.Territory, comparisonIgnoreCase) && string.Equals(Name, other.Name, comparisonIgnoreCase) && Count == other.Count && Cost == other.Cost && SummNds == other.SummNds && string.Equals(NameCompany, other.NameCompany, comparisonIgnoreCase) && Ttn == other.Ttn && ShipmentDate.Equals(other.ShipmentDate) && string.Equals(ContractNumber, other.ContractNumber, comparisonIgnoreCase) && ContractDate.Equals(other.ContractDate) && string.Equals(IntentionBay, other.IntentionBay, comparisonIgnoreCase) && string.Equals(PaymentForm, other.PaymentForm, comparisonIgnoreCase) && string.Equals(WorkGuild, other.WorkGuild, comparisonIgnoreCase)); }
protected bool Equals(ExpenditureOfProductsByTerritory other) { const StringComparison comparisonIgnoreCase = StringComparison.OrdinalIgnoreCase; return(string.Equals(TerritoryName, other.TerritoryName, comparisonIgnoreCase) && Ceh == other.Ceh && NumberTtn == other.NumberTtn && NumberAkt == other.NumberAkt && ShipmentDate.Equals(other.ShipmentDate) && string.Equals(ProductName, other.ProductName, comparisonIgnoreCase) && string.Equals(CompanyName, other.CompanyName, comparisonIgnoreCase) && ProductCount == other.ProductCount && CostWithoutNds == other.CostWithoutNds && SummaWithoutNds == other.SummaWithoutNds && SummaNds == other.SummaNds && SummaWithNds == other.SummaWithNds && SummaWithoutNdsAndTaxes == other.SummaWithoutNdsAndTaxes && SummaUsd == other.SummaUsd && UsdRate == other.UsdRate && RusRate == other.RusRate); }
public int CompareTo(AtTheExpenseOfWages other) { const StringComparison comparisonIgnoreCase = StringComparison.OrdinalIgnoreCase; if (ReferenceEquals(this, other)) { return(0); } if (ReferenceEquals(null, other)) { return(1); } var ttnComparison = Ttn.CompareTo(other.Ttn); if (ttnComparison != 0) { return(ttnComparison); } var shipmentDateComparison = ShipmentDate.CompareTo(other.ShipmentDate); if (shipmentDateComparison != 0) { return(shipmentDateComparison); } var nameComparison = string.Compare(Name, other.Name, comparisonIgnoreCase); if (nameComparison != 0) { return(nameComparison); } var countComparison = Count.CompareTo(other.Count); if (countComparison != 0) { return(countComparison); } return(Cost.CompareTo(other.Cost)); }
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 override int GetHashCode() { unchecked { var hashCode = (TerritoryName != null ? StringComparer.OrdinalIgnoreCase.GetHashCode(TerritoryName) : 0); hashCode = (hashCode * 397) ^ Ceh.GetHashCode(); hashCode = (hashCode * 397) ^ NumberTtn.GetHashCode(); hashCode = (hashCode * 397) ^ NumberAkt.GetHashCode(); hashCode = (hashCode * 397) ^ ShipmentDate.GetHashCode(); hashCode = (hashCode * 397) ^ (ProductName != null ? StringComparer.OrdinalIgnoreCase.GetHashCode(ProductName) : 0); hashCode = (hashCode * 397) ^ (CompanyName != null ? StringComparer.OrdinalIgnoreCase.GetHashCode(CompanyName) : 0); hashCode = (hashCode * 397) ^ ProductCount.GetHashCode(); hashCode = (hashCode * 397) ^ CostWithoutNds.GetHashCode(); hashCode = (hashCode * 397) ^ SummaWithoutNds.GetHashCode(); hashCode = (hashCode * 397) ^ SummaNds.GetHashCode(); hashCode = (hashCode * 397) ^ SummaWithNds.GetHashCode(); hashCode = (hashCode * 397) ^ SummaWithoutNdsAndTaxes.GetHashCode(); hashCode = (hashCode * 397) ^ SummaUsd.GetHashCode(); hashCode = (hashCode * 397) ^ UsdRate.GetHashCode(); hashCode = (hashCode * 397) ^ RusRate.GetHashCode(); return(hashCode); } }
public IEnumerable <ValidationResult> Validate(ValidationContext validationContext) { PurchasingDbContext dbContext = validationContext == null ? null : (PurchasingDbContext)validationContext.GetService(typeof(PurchasingDbContext)); if (String.IsNullOrWhiteSpace(RONo)) { yield return(new ValidationResult("RONo tidak boleh kosong", new List <string> { "RONo" })); } else { var duplicateRONo = dbContext.GarmentPurchaseRequests.Where(m => m.RONo.Equals(RONo) && m.Id != Id).Count(); if (duplicateRONo > 0) { yield return(new ValidationResult("RONo sudah ada", new List <string> { "RONo" })); } } if (Buyer == null) { yield return(new ValidationResult("Buyer tidak boleh kosong", new List <string> { "Buyer" })); } else if (String.IsNullOrWhiteSpace(Buyer.Id) || Buyer.Id.Equals("0") || String.IsNullOrWhiteSpace(Buyer.Code) || String.IsNullOrWhiteSpace(Buyer.Name)) { yield return(new ValidationResult("Data Buyer tidak benar", new List <string> { "Buyer" })); } if (String.IsNullOrWhiteSpace(Article)) { yield return(new ValidationResult("Article tidak boleh kosong", new List <string> { "Article" })); } if (Date.Equals(DateTimeOffset.MinValue) || Date == null) { yield return(new ValidationResult("Date tidak boleh kosong", new List <string> { "Date" })); } if (ShipmentDate.Equals(DateTimeOffset.MinValue) || ShipmentDate == null) { yield return(new ValidationResult("ShipmentDate tidak boleh kosong", new List <string> { "ShipmentDate" })); } if (Unit == null) { yield return(new ValidationResult("Unit tidak boleh kosong", new List <string> { "Unit" })); } else if (String.IsNullOrWhiteSpace(Unit.Id) || Unit.Id.Equals("0") || String.IsNullOrWhiteSpace(Unit.Code) || String.IsNullOrWhiteSpace(Unit.Name)) { yield return(new ValidationResult("Data Unit tidak benar", new List <string> { "Unit" })); } if (Items == null || Items.Count <= 0) { yield return(new ValidationResult("Items tidak boleh kosong", new List <string> { "ItemsCount" })); } else { string itemError = "["; int itemErrorCount = 0; foreach (var item in Items) { itemError += "{"; if (String.IsNullOrWhiteSpace(item.PO_SerialNumber)) { itemErrorCount++; itemError += "PO_SerialNumber: 'PO_SerialNumber tidak boleh kosong', "; } else if (Id != 0) { var duplicatePO_SerialNumber = dbContext.GarmentPurchaseRequests .SingleOrDefault(m => m.Id == Id && m.Items.Any(i => i.PO_SerialNumber.Equals(item.PO_SerialNumber) && i.Id != item.Id)); if (duplicatePO_SerialNumber != null) { itemErrorCount++; itemError += "PO_SerialNumber: 'PO_SerialNumber sudah ada', "; } } if (item.Product == null) { itemErrorCount++; itemError += "Product: 'Product tidak boleh kosong', "; } else if (String.IsNullOrWhiteSpace(item.Product.Id) || item.Product.Id.Equals("0") || String.IsNullOrWhiteSpace(item.Product.Code) || String.IsNullOrWhiteSpace(item.Product.Name)) { itemErrorCount++; itemError += "Product: 'Data Product tidak benar', "; } if (item.Quantity <= 0) { itemErrorCount++; itemError += "Quantity: 'Quantity harus lebih dari 0', "; } //if (item.BudgetPrice <= 0) //{ // itemErrorCount++; // itemError += "BudgetPrice: 'BudgetPrice harus lebih dari 0', "; //} if (item.Uom == null) { itemErrorCount++; itemError += "UOM: 'UOM tidak boleh kosong', "; } else if (String.IsNullOrWhiteSpace(item.Uom.Id) || item.Uom.Id.Equals("0") || String.IsNullOrWhiteSpace(item.Uom.Unit)) { itemErrorCount++; itemError += "UOM: 'Data UOM tidak benar', "; } if (item.Category == null) { itemErrorCount++; itemError += "Category: 'Category tidak boleh kosong', "; } else if (String.IsNullOrWhiteSpace(item.Category.Id) || item.Category.Id.Equals("0") || String.IsNullOrWhiteSpace(item.Category.Name)) { itemErrorCount++; itemError += "Category: 'Data Category tidak benar', "; } itemError += "}, "; } itemError += "]"; if (itemErrorCount > 0) { yield return(new ValidationResult(itemError, new List <string> { "Items" })); } } }
public IEnumerable <ValidationResult> Validate(ValidationContext validationContext) { PurchasingDbContext dbContext = validationContext == null ? null : (PurchasingDbContext)validationContext.GetService(typeof(PurchasingDbContext)); if (Buyer == null) { yield return(new ValidationResult("Buyer tidak boleh kosong", new List <string> { "Buyer" })); } else if (String.IsNullOrWhiteSpace(Buyer.Id) || Buyer.Id.Equals("0") || String.IsNullOrWhiteSpace(Buyer.Code) || String.IsNullOrWhiteSpace(Buyer.Name)) { yield return(new ValidationResult("Data Buyer tidak benar", new List <string> { "Buyer" })); } if (String.IsNullOrWhiteSpace(Article)) { yield return(new ValidationResult("Artikel tidak boleh kosong", new List <string> { "Article" })); } if (Date.Equals(DateTimeOffset.MinValue) || Date == null) { yield return(new ValidationResult("Tanggal tidak boleh kosong", new List <string> { "Date" })); } if (SCId < 1 || string.IsNullOrWhiteSpace(SCNo)) { yield return(new ValidationResult("Sales Contract tidak boleh kosong", new List <string> { "SalesContract" })); } if (new string[] { "MASTER", "SAMPLE" }.Contains(PRType)) { if (ExpectedDeliveryDate.Equals(DateTimeOffset.MinValue) || ExpectedDeliveryDate == null) { yield return(new ValidationResult("Tanggal Diminta Datang tidak boleh kosong", new List <string> { "ExpectedDeliveryDate" })); } } else { if (String.IsNullOrWhiteSpace(RONo)) { yield return(new ValidationResult("RONo tidak boleh kosong", new List <string> { "RONo" })); } else { var duplicateRONo = dbContext.GarmentPurchaseRequests.Where(m => m.RONo.Equals(RONo) && m.Id != Id).Count(); if (duplicateRONo > 0) { yield return(new ValidationResult("RONo sudah ada", new List <string> { "RONo" })); } } if (ShipmentDate.Equals(DateTimeOffset.MinValue) || ShipmentDate == null) { yield return(new ValidationResult("Tanggal Shipment tidak boleh kosong", new List <string> { "ShipmentDate" })); } } if (PRType != "MASTER") { if (Unit == null) { yield return(new ValidationResult("Unit tidak boleh kosong", new List <string> { "Unit" })); } else if (String.IsNullOrWhiteSpace(Unit.Id) || Unit.Id.Equals("0") || String.IsNullOrWhiteSpace(Unit.Code) || String.IsNullOrWhiteSpace(Unit.Name)) { yield return(new ValidationResult("Data Unit tidak benar", new List <string> { "Unit" })); } } if (Items == null || Items.Count <= 0) { yield return(new ValidationResult("Items tidak boleh kosong", new List <string> { "ItemsCount" })); } else { string itemError = "["; int itemErrorCount = 0; foreach (var item in Items) { itemError += "{"; if (item.Product == null) { itemErrorCount++; itemError += "Product: 'Barang tidak boleh kosong', "; } else if (String.IsNullOrWhiteSpace(item.Product.Id) || item.Product.Id.Equals("0") || String.IsNullOrWhiteSpace(item.Product.Code) || String.IsNullOrWhiteSpace(item.Product.Name)) { itemErrorCount++; itemError += "Product: 'Data Barang tidak benar', "; } if (item.Quantity <= 0) { itemErrorCount++; itemError += "Quantity: 'Jumlah harus lebih dari 0', "; } if (item.BudgetPrice < 0) { itemErrorCount++; itemError += "BudgetPrice: 'Price harus lebih dari atau sama dengan 0', "; } if (item.Uom == null) { itemErrorCount++; itemError += "UOM: 'Satuan tidak boleh kosong', "; } else if (String.IsNullOrWhiteSpace(item.Uom.Id) || item.Uom.Id.Equals("0") || String.IsNullOrWhiteSpace(item.Uom.Unit)) { itemErrorCount++; itemError += "UOM: 'Data Satuan tidak benar', "; } if (item.Category == null) { itemErrorCount++; itemError += "Category: 'Kategori tidak boleh kosong', "; } else if (String.IsNullOrWhiteSpace(item.Category.Id) || item.Category.Id.Equals("0") || String.IsNullOrWhiteSpace(item.Category.Name)) { itemErrorCount++; itemError += "Category: 'Data Kategori tidak benar', "; } if (new string[] { "MASTER", "SAMPLE" }.Contains(PRType)) { if (item.Category != null && item.Category.Name == "FABRIC") { if (item.Composition == null || string.IsNullOrWhiteSpace(item.Composition.Composition)) { itemErrorCount++; itemError += "Composition: 'Komposisi tidak boleh kosong', "; } else { if (item.Const == null || string.IsNullOrWhiteSpace(item.Const.Const)) { itemErrorCount++; itemError += "Const: 'Konstruksi tidak boleh kosong', "; } else { if (item.Yarn == null || string.IsNullOrWhiteSpace(item.Yarn.Yarn)) { itemErrorCount++; itemError += "Yarn: 'Yarn tidak boleh kosong', "; } else { if (item.Width == null || string.IsNullOrWhiteSpace(item.Width.Width)) { itemErrorCount++; itemError += "Width: 'Width tidak boleh kosong', "; } } } } } if (item.PriceUom == null) { itemErrorCount++; itemError += "PriceUom: 'Satuan Harga tidak boleh kosong', "; } else if (string.IsNullOrWhiteSpace(item.PriceUom.Id) || item.PriceUom.Id.Equals("0") || string.IsNullOrWhiteSpace(item.PriceUom.Unit)) { itemErrorCount++; itemError += "PriceUom: 'Data Satuan Harga tidak benar', "; } if (item.PriceConversion <= 0) { itemErrorCount++; itemError += "PriceConversion: 'Konversi harus lebih dari 0', "; } } else { if (string.IsNullOrWhiteSpace(item.PO_SerialNumber)) { itemErrorCount++; itemError += "PO_SerialNumber: 'PO SerialNumber tidak boleh kosong', "; } else if (Id != 0) { var duplicatePO_SerialNumber = dbContext.GarmentPurchaseRequests .SingleOrDefault(m => m.Id == Id && m.Items.Any(i => i.PO_SerialNumber.Equals(item.PO_SerialNumber) && i.Id != item.Id)); if (duplicatePO_SerialNumber != null) { itemErrorCount++; itemError += "PO_SerialNumber: 'PO SerialNumber sudah ada', "; } } } itemError += "}, "; } itemError += "]"; if (itemErrorCount > 0) { yield return(new ValidationResult(itemError, new List <string> { "Items" })); } } }
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)); }
public int CompareTo(ExpenditureOfProductsByTerritory other) { const StringComparison comparisonIgnoreCase = StringComparison.OrdinalIgnoreCase; if (ReferenceEquals(this, other)) { return(0); } if (ReferenceEquals(null, other)) { return(1); } var cehComparison = Ceh.CompareTo((other.Ceh)); if (cehComparison != 0) { return(cehComparison); } var territoryNameComparison = string.Compare(TerritoryName, other.TerritoryName, comparisonIgnoreCase); if (territoryNameComparison != 0) { return(-territoryNameComparison); } var numberTtnComparison = NumberTtn.CompareTo(other.NumberTtn); if (numberTtnComparison != 0) { return(-numberTtnComparison); } var numberAktComparison = NumberAkt.CompareTo(other.NumberAkt); if (numberAktComparison != 0) { return(-numberAktComparison); } var shipmentDateComparison = ShipmentDate.CompareTo(other.ShipmentDate); if (shipmentDateComparison != 0) { return(shipmentDateComparison); } var productNameComparison = string.Compare(ProductName, other.ProductName, comparisonIgnoreCase); if (productNameComparison != 0) { return(productNameComparison); } var companyNameComparison = string.Compare(CompanyName, other.CompanyName, comparisonIgnoreCase); if (companyNameComparison != 0) { return(companyNameComparison); } var productCountComparison = ProductCount.CompareTo(other.ProductCount); if (productCountComparison != 0) { return(productCountComparison); } var costWithoutNdsComparison = CostWithoutNds.CompareTo(other.CostWithoutNds); if (costWithoutNdsComparison != 0) { return(costWithoutNdsComparison); } var summaWithoutNdsComparison = SummaWithoutNds.CompareTo(other.SummaWithoutNds); if (summaWithoutNdsComparison != 0) { return(summaWithoutNdsComparison); } var summaNdsComparison = SummaNds.CompareTo(other.SummaNds); if (summaNdsComparison != 0) { return(summaNdsComparison); } var summaWithNdsComparison = SummaWithNds.CompareTo(other.SummaWithNds); if (summaWithNdsComparison != 0) { return(summaWithNdsComparison); } var summaWithoutNdsAndTaxesComparison = SummaWithoutNdsAndTaxes.CompareTo(other.SummaWithoutNdsAndTaxes); if (summaWithoutNdsAndTaxesComparison != 0) { return(summaWithoutNdsAndTaxesComparison); } var summaUsdComparison = SummaUsd.CompareTo(other.SummaUsd); if (summaUsdComparison != 0) { return(summaUsdComparison); } var usdRateComparison = UsdRate.CompareTo(other.UsdRate); if (usdRateComparison != 0) { return(usdRateComparison); } return(RusRate.CompareTo(other.RusRate)); }