Exemplo n.º 1
0
        private bool Equals(IInvoice other)
        {
            if (!(InvoiceId == other.InvoiceId && InvoiceNumber == other.InvoiceNumber && InvoiceNumberAsString == other.InvoiceNumberAsString && Total.Equals(other.Total) &&
                  Subtotal.Equals(other.Subtotal) && Nullable.Equals(Tax, other.Tax) && Nullable.Equals(TaxPercentage, other.TaxPercentage) && InvoiceDate.Equals(other.InvoiceDate) &&
                  ContractName == other.ContractName && PeriodStartDate.Equals(other.PeriodStartDate) && PeriodEndDate.Equals(other.PeriodEndDate) && Currency == other.Currency &&
                  Equals(From, other.From) && Equals(To, other.To)))
            {
                return(false);
            }

            if (LineItems is null && other.LineItems is null)
            {
                return(true);
            }
            if (LineItems is null || other.LineItems is null)
            {
                return(false);
            }
            return(LineItems.OrderBy(x => x.LineIdx).SequenceEqual(other.LineItems.OrderBy(x => x.LineIdx)));
        }
Exemplo n.º 2
0
 private bool Equals(IInvoiceLineItem other)
 {
     return(Product == other.Product && Description == other.Description && Quantity.Equals(other.Quantity) && Rate.Equals(other.Rate) && TaxPercentage.Equals(other.TaxPercentage) &&
            DiscountPercentage.Equals(other.DiscountPercentage) && Total.Equals(other.Total) && Subtotal.Equals(other.Subtotal) && Tax.Equals(other.Tax) && LineIdx == other.LineIdx);
 }
Exemplo n.º 3
0
        /// <summary>
        /// Returns true if Order instances are equal
        /// </summary>
        /// <param name="input">Instance of Order to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Order input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     Id == input.Id ||
                     Id != null &&
                     Id.Equals(input.Id)
                     ) &&
                 (
                     Consumer == input.Consumer ||
                     Consumer != null &&
                     Consumer.Equals(input.Consumer)
                 ) &&
                 (
                     Store == input.Store ||
                     Store != null &&
                     Store.Equals(input.Store)
                 ) &&
                 (
                     Subtotal == input.Subtotal ||
                     Subtotal != null &&
                     Subtotal.Equals(input.Subtotal)
                 ) &&
                 (
                     Tax == input.Tax ||
                     Tax != null &&
                     Tax.Equals(input.Tax)
                 ) &&
                 (
                     EstimatedPickupTime == input.EstimatedPickupTime ||
                     EstimatedPickupTime != null &&
                     EstimatedPickupTime.Equals(input.EstimatedPickupTime)
                 ) &&
                 (
                     IsPickup == input.IsPickup ||
                     IsPickup != null &&
                     IsPickup.Equals(input.IsPickup)
                 ) &&
                 (
                     Categories == input.Categories ||
                     Categories != null &&
                     Categories.SequenceEqual(input.Categories)
                 ) &&
                 (
                     IsTaxRemittedByDoordash == input.IsTaxRemittedByDoordash ||
                     IsTaxRemittedByDoordash != null &&
                     IsTaxRemittedByDoordash.Equals(input.IsTaxRemittedByDoordash)
                 ) &&
                 (
                     TaxAmountRemittedByDoordash == input.TaxAmountRemittedByDoordash ||
                     TaxAmountRemittedByDoordash != null &&
                     TaxAmountRemittedByDoordash.Equals(input.TaxAmountRemittedByDoordash)
                 ) &&
                 (
                     CommissionType == input.CommissionType ||
                     CommissionType != null &&
                     CommissionType.Equals(input.CommissionType)
                 ) &&
                 (
                     DeliveryShortCode == input.DeliveryShortCode ||
                     DeliveryShortCode != null &&
                     DeliveryShortCode.Equals(input.DeliveryShortCode)
                 ));
        }