Ejemplo n.º 1
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (obj == this)
            {
                return(true);
            }

            return(obj is OrderReturnLineItem other &&
                   ((Uid == null && other.Uid == null) || (Uid?.Equals(other.Uid) == true)) &&
                   ((SourceLineItemUid == null && other.SourceLineItemUid == null) || (SourceLineItemUid?.Equals(other.SourceLineItemUid) == true)) &&
                   ((Name == null && other.Name == null) || (Name?.Equals(other.Name) == true)) &&
                   ((Quantity == null && other.Quantity == null) || (Quantity?.Equals(other.Quantity) == true)) &&
                   ((QuantityUnit == null && other.QuantityUnit == null) || (QuantityUnit?.Equals(other.QuantityUnit) == true)) &&
                   ((Note == null && other.Note == null) || (Note?.Equals(other.Note) == true)) &&
                   ((CatalogObjectId == null && other.CatalogObjectId == null) || (CatalogObjectId?.Equals(other.CatalogObjectId) == true)) &&
                   ((VariationName == null && other.VariationName == null) || (VariationName?.Equals(other.VariationName) == true)) &&
                   ((ReturnModifiers == null && other.ReturnModifiers == null) || (ReturnModifiers?.Equals(other.ReturnModifiers) == true)) &&
                   ((AppliedTaxes == null && other.AppliedTaxes == null) || (AppliedTaxes?.Equals(other.AppliedTaxes) == true)) &&
                   ((AppliedDiscounts == null && other.AppliedDiscounts == null) || (AppliedDiscounts?.Equals(other.AppliedDiscounts) == true)) &&
                   ((BasePriceMoney == null && other.BasePriceMoney == null) || (BasePriceMoney?.Equals(other.BasePriceMoney) == true)) &&
                   ((VariationTotalPriceMoney == null && other.VariationTotalPriceMoney == null) || (VariationTotalPriceMoney?.Equals(other.VariationTotalPriceMoney) == true)) &&
                   ((GrossReturnMoney == null && other.GrossReturnMoney == null) || (GrossReturnMoney?.Equals(other.GrossReturnMoney) == true)) &&
                   ((TotalTaxMoney == null && other.TotalTaxMoney == null) || (TotalTaxMoney?.Equals(other.TotalTaxMoney) == true)) &&
                   ((TotalDiscountMoney == null && other.TotalDiscountMoney == null) || (TotalDiscountMoney?.Equals(other.TotalDiscountMoney) == true)) &&
                   ((TotalMoney == null && other.TotalMoney == null) || (TotalMoney?.Equals(other.TotalMoney) == true)));
        }
Ejemplo n.º 2
0
 private void CorrectDiscName(string DiscName)
 {
     if (string.IsNullOrEmpty(VariationName) || VariationName.CompareTo(DiscName) > 0)
     {
         VariationName = DiscName;
     }
 }
 public ParameterVariation(Przelewy24.Parameter parameter, VariationName variation)
 {
     this.Parameter      = parameter;
     this.ParameterName  = parameter.Name;
     this.ParameterValue = parameter.Value;
     this.Variation      = variation;
     this.VariationValue = GetSpecifiedVariationValue(variation);
 }
        public string GetSpecifiedVariationValue(VariationName variation)
        {
            string toReturn = "";

            switch (variation)
            {
            case (VariationName.omnited):
            {
                toReturn = null;
                break;
            }

            case (VariationName.plain):
            {
                toReturn = this.ParameterValue;
                break;
            }

            case (VariationName.spaceAfter):
            {
                toReturn = this.ParameterValue + " ";
                break;
            }

            case (VariationName.spaceBefore):
            {
                toReturn = " " + this.ParameterValue;
                break;
            }

            case (VariationName.spaceBoth):
            {
                toReturn = " " + this.ParameterValue + " ";
                break;
            }

            case (VariationName.empty):
            {
                toReturn = "";
                break;
            }

            default:
            {
                throw new ApplicationException("Error during creation Parametar Variation - it was used unsupported enum value: "
                                               + variation.ToString());
            }
            }
            return(toReturn);
        }
 public ParameterVariation(string name, string value, VariationName variation)
     : this(new Przelewy24.Parameter(name, value), variation)
 {
 }
Ejemplo n.º 6
0
        public override int GetHashCode()
        {
            int hashCode = 1299728447;

            if (Uid != null)
            {
                hashCode += Uid.GetHashCode();
            }

            if (SourceLineItemUid != null)
            {
                hashCode += SourceLineItemUid.GetHashCode();
            }

            if (Name != null)
            {
                hashCode += Name.GetHashCode();
            }

            if (Quantity != null)
            {
                hashCode += Quantity.GetHashCode();
            }

            if (QuantityUnit != null)
            {
                hashCode += QuantityUnit.GetHashCode();
            }

            if (Note != null)
            {
                hashCode += Note.GetHashCode();
            }

            if (CatalogObjectId != null)
            {
                hashCode += CatalogObjectId.GetHashCode();
            }

            if (VariationName != null)
            {
                hashCode += VariationName.GetHashCode();
            }

            if (ReturnModifiers != null)
            {
                hashCode += ReturnModifiers.GetHashCode();
            }

            if (AppliedTaxes != null)
            {
                hashCode += AppliedTaxes.GetHashCode();
            }

            if (AppliedDiscounts != null)
            {
                hashCode += AppliedDiscounts.GetHashCode();
            }

            if (BasePriceMoney != null)
            {
                hashCode += BasePriceMoney.GetHashCode();
            }

            if (VariationTotalPriceMoney != null)
            {
                hashCode += VariationTotalPriceMoney.GetHashCode();
            }

            if (GrossReturnMoney != null)
            {
                hashCode += GrossReturnMoney.GetHashCode();
            }

            if (TotalTaxMoney != null)
            {
                hashCode += TotalTaxMoney.GetHashCode();
            }

            if (TotalDiscountMoney != null)
            {
                hashCode += TotalDiscountMoney.GetHashCode();
            }

            if (TotalMoney != null)
            {
                hashCode += TotalMoney.GetHashCode();
            }

            return(hashCode);
        }
Ejemplo n.º 7
0
        public override int GetHashCode()
        {
            int hashCode = 441365892;

            if (Uid != null)
            {
                hashCode += Uid.GetHashCode();
            }

            if (Name != null)
            {
                hashCode += Name.GetHashCode();
            }

            if (Quantity != null)
            {
                hashCode += Quantity.GetHashCode();
            }

            if (QuantityUnit != null)
            {
                hashCode += QuantityUnit.GetHashCode();
            }

            if (Note != null)
            {
                hashCode += Note.GetHashCode();
            }

            if (CatalogObjectId != null)
            {
                hashCode += CatalogObjectId.GetHashCode();
            }

            if (VariationName != null)
            {
                hashCode += VariationName.GetHashCode();
            }

            if (Metadata != null)
            {
                hashCode += Metadata.GetHashCode();
            }

            if (Modifiers != null)
            {
                hashCode += Modifiers.GetHashCode();
            }

            if (AppliedTaxes != null)
            {
                hashCode += AppliedTaxes.GetHashCode();
            }

            if (AppliedDiscounts != null)
            {
                hashCode += AppliedDiscounts.GetHashCode();
            }

            if (BasePriceMoney != null)
            {
                hashCode += BasePriceMoney.GetHashCode();
            }

            if (VariationTotalPriceMoney != null)
            {
                hashCode += VariationTotalPriceMoney.GetHashCode();
            }

            if (GrossSalesMoney != null)
            {
                hashCode += GrossSalesMoney.GetHashCode();
            }

            if (TotalTaxMoney != null)
            {
                hashCode += TotalTaxMoney.GetHashCode();
            }

            if (TotalDiscountMoney != null)
            {
                hashCode += TotalDiscountMoney.GetHashCode();
            }

            if (TotalMoney != null)
            {
                hashCode += TotalMoney.GetHashCode();
            }

            if (PricingBlocklists != null)
            {
                hashCode += PricingBlocklists.GetHashCode();
            }

            return(hashCode);
        }