/// <summary>
        /// Returns true if BankingAccountDiscountEligibility instances are equal
        /// </summary>
        /// <param name="other">Instance of BankingAccountDiscountEligibility to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(BankingAccountDiscountEligibility other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     DiscountEligibilityType == other.DiscountEligibilityType ||
                     DiscountEligibilityType != null &&
                     DiscountEligibilityType.Equals(other.DiscountEligibilityType)
                     ) &&
                 (
                     AdditionalValue == other.AdditionalValue ||
                     AdditionalValue != null &&
                     AdditionalValue.Equals(other.AdditionalValue)
                 ) &&
                 (
                     AdditionalInfo == other.AdditionalInfo ||
                     AdditionalInfo != null &&
                     AdditionalInfo.Equals(other.AdditionalInfo)
                 ) &&
                 (
                     AdditionalInfoUri == other.AdditionalInfoUri ||
                     AdditionalInfoUri != null &&
                     AdditionalInfoUri.Equals(other.AdditionalInfoUri)
                 ));
        }
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (DiscountEligibilityType != null)
         {
             hashCode = hashCode * 59 + DiscountEligibilityType.GetHashCode();
         }
         if (AdditionalValue != null)
         {
             hashCode = hashCode * 59 + AdditionalValue.GetHashCode();
         }
         if (AdditionalInfo != null)
         {
             hashCode = hashCode * 59 + AdditionalInfo.GetHashCode();
         }
         if (AdditionalInfoUri != null)
         {
             hashCode = hashCode * 59 + AdditionalInfoUri.GetHashCode();
         }
         return(hashCode);
     }
 }
示例#3
0
        /// <summary>
        /// Returns true if BankingProductLendingRate instances are equal
        /// </summary>
        /// <param name="other">Instance of BankingProductLendingRate to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(BankingProductLendingRate other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     LendingRateType == other.LendingRateType ||
                     LendingRateType != null &&
                     LendingRateType.Equals(other.LendingRateType)
                     ) &&
                 (
                     Rate == other.Rate ||
                     Rate != null &&
                     Rate.Equals(other.Rate)
                 ) &&
                 (
                     CalculationFrequency == other.CalculationFrequency ||
                     CalculationFrequency != null &&
                     CalculationFrequency.Equals(other.CalculationFrequency)
                 ) &&
                 (
                     ApplicationFrequency == other.ApplicationFrequency ||
                     ApplicationFrequency != null &&
                     ApplicationFrequency.Equals(other.ApplicationFrequency)
                 ) &&
                 (
                     PaymentStructureType == other.PaymentStructureType ||
                     PaymentStructureType != null &&
                     PaymentStructureType.Equals(other.PaymentStructureType)
                 ) &&
                 (
                     Tier == other.Tier ||
                     Tier != null &&
                     Tier.Equals(other.Tier)
                 ) &&
                 (
                     AdditionalValue == other.AdditionalValue ||
                     AdditionalValue != null &&
                     AdditionalValue.Equals(other.AdditionalValue)
                 ) &&
                 (
                     AdditionalInfo == other.AdditionalInfo ||
                     AdditionalInfo != null &&
                     AdditionalInfo.Equals(other.AdditionalInfo)
                 ) &&
                 (
                     AdditionalInfoUri == other.AdditionalInfoUri ||
                     AdditionalInfoUri != null &&
                     AdditionalInfoUri.Equals(other.AdditionalInfoUri)
                 ));
        }
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (FeeType != null)
         {
             hashCode = hashCode * 59 + FeeType.GetHashCode();
         }
         if (Amount != null)
         {
             hashCode = hashCode * 59 + Amount.GetHashCode();
         }
         if (BalanceRate != null)
         {
             hashCode = hashCode * 59 + BalanceRate.GetHashCode();
         }
         if (TransactionRate != null)
         {
             hashCode = hashCode * 59 + TransactionRate.GetHashCode();
         }
         if (AccruedRate != null)
         {
             hashCode = hashCode * 59 + AccruedRate.GetHashCode();
         }
         if (AccrualFrequency != null)
         {
             hashCode = hashCode * 59 + AccrualFrequency.GetHashCode();
         }
         if (Currency != null)
         {
             hashCode = hashCode * 59 + Currency.GetHashCode();
         }
         if (AdditionalValue != null)
         {
             hashCode = hashCode * 59 + AdditionalValue.GetHashCode();
         }
         if (AdditionalInfo != null)
         {
             hashCode = hashCode * 59 + AdditionalInfo.GetHashCode();
         }
         if (AdditionalInfoUri != null)
         {
             hashCode = hashCode * 59 + AdditionalInfoUri.GetHashCode();
         }
         if (Discounts != null)
         {
             hashCode = hashCode * 59 + Discounts.GetHashCode();
         }
         return(hashCode);
     }
 }
        /// <summary>
        /// Creates the additional value.
        /// </summary>
        /// <param name="currency">The currency.</param>
        /// <param name="value">The value.</param>
        /// <returns><see cref="AdditionalValue"/> instance.</returns>
        protected AdditionalValue CreateAdditionalValue(Currency currency, decimal value)
        {
            AdditionalValue additional = new AdditionalValue();

            additional.Currency = currency;
            additional.Value    = value;

            return(additional);
        }
 /// <summary>
 /// Adds the additional value.
 /// </summary>
 /// <param name="key">The key.</param>
 /// <param name="parameter">The parameter.</param>
 /// <param name="currency">The currency.</param>
 private void AddAdditionalValue(string key, decimal? parameter, Currency currency)
 {
     if (parameter.HasValue)
     {
         AdditionalValue additionalValue = new AdditionalValue();
         additionalValue.Currency = currency;
         additionalValue.Value = parameter.Value;
         this.order.AdditionalValues.Add(key, additionalValue);
     }
 }
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (Description != null)
         {
             hashCode = hashCode * 59 + Description.GetHashCode();
         }
         if (DiscountType != null)
         {
             hashCode = hashCode * 59 + DiscountType.GetHashCode();
         }
         if (Amount != null)
         {
             hashCode = hashCode * 59 + Amount.GetHashCode();
         }
         if (BalanceRate != null)
         {
             hashCode = hashCode * 59 + BalanceRate.GetHashCode();
         }
         if (TransactionRate != null)
         {
             hashCode = hashCode * 59 + TransactionRate.GetHashCode();
         }
         if (AccruedRate != null)
         {
             hashCode = hashCode * 59 + AccruedRate.GetHashCode();
         }
         if (AdditionalValue != null)
         {
             hashCode = hashCode * 59 + AdditionalValue.GetHashCode();
         }
         if (Eligibility != null)
         {
             hashCode = hashCode * 59 + Eligibility.GetHashCode();
         }
         if (AdditionalInfo != null)
         {
             hashCode = hashCode * 59 + AdditionalInfo.GetHashCode();
         }
         if (AdditionalInfoUri != null)
         {
             hashCode = hashCode * 59 + AdditionalInfoUri.GetHashCode();
         }
         return(hashCode);
     }
 }
        /// <summary>
        /// Returns true if BankingAccountDepositRate instances are equal
        /// </summary>
        /// <param name="other">Instance of BankingAccountDepositRate to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(BankingAccountDepositRate other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     DepositRateType == other.DepositRateType ||
                     DepositRateType != null &&
                     DepositRateType.Equals(other.DepositRateType)
                     ) &&
                 (
                     Rate == other.Rate ||
                     Rate != null &&
                     Rate.Equals(other.Rate)
                 ) &&
                 (
                     CalculationFrequency == other.CalculationFrequency ||
                     CalculationFrequency != null &&
                     CalculationFrequency.Equals(other.CalculationFrequency)
                 ) &&
                 (
                     ApplicationFrequency == other.ApplicationFrequency ||
                     ApplicationFrequency != null &&
                     ApplicationFrequency.Equals(other.ApplicationFrequency)
                 ) &&
                 (
                     AdditionalValue == other.AdditionalValue ||
                     AdditionalValue != null &&
                     AdditionalValue.Equals(other.AdditionalValue)
                 ) &&
                 (
                     AdditionalInfo == other.AdditionalInfo ||
                     AdditionalInfo != null &&
                     AdditionalInfo.Equals(other.AdditionalInfo)
                 ) &&
                 (
                     AdditionalInfoUri == other.AdditionalInfoUri ||
                     AdditionalInfoUri != null &&
                     AdditionalInfoUri.Equals(other.AdditionalInfoUri)
                 ));
        }
        static string ConvertStringArrayToString(string[] array, AdditionalValue additionalValue = null)
        {
            StringBuilder noterMessage = new StringBuilder();

            if (additionalValue != null && !string.IsNullOrEmpty(additionalValue.value))
            {
                noterMessage.Append(additionalValue.value);
            }

            foreach (string value in array)
            {
                noterMessage.Append(value);
                noterMessage.Append("@@@");
            }
            //builder.Length -= 1;
            return(noterMessage.ToString());
        }
示例#10
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (LendingRateType != null)
         {
             hashCode = hashCode * 59 + LendingRateType.GetHashCode();
         }
         if (Rate != null)
         {
             hashCode = hashCode * 59 + Rate.GetHashCode();
         }
         if (CalculationFrequency != null)
         {
             hashCode = hashCode * 59 + CalculationFrequency.GetHashCode();
         }
         if (ApplicationFrequency != null)
         {
             hashCode = hashCode * 59 + ApplicationFrequency.GetHashCode();
         }
         if (PaymentStructureType != null)
         {
             hashCode = hashCode * 59 + PaymentStructureType.GetHashCode();
         }
         if (Tier != null)
         {
             hashCode = hashCode * 59 + Tier.GetHashCode();
         }
         if (AdditionalValue != null)
         {
             hashCode = hashCode * 59 + AdditionalValue.GetHashCode();
         }
         if (AdditionalInfo != null)
         {
             hashCode = hashCode * 59 + AdditionalInfo.GetHashCode();
         }
         if (AdditionalInfoUri != null)
         {
             hashCode = hashCode * 59 + AdditionalInfoUri.GetHashCode();
         }
         return(hashCode);
     }
 }
        public static List <AdditionalValue> MapAdditionalValues(List <AdditionalValue> existingAdditionalValue, string[] newAdditionalValue)
        {
            if (newAdditionalValue != null && newAdditionalValue.Length > 0)
            {
                var systemAdditionalValue = existingAdditionalValue.Where(n => n.key == "ActualLidId").FirstOrDefault();
                var noterMessages         = ConvertStringArrayToString(newAdditionalValue, systemAdditionalValue);
                var additionalValue       = new AdditionalValue();

                if (systemAdditionalValue != null)
                {
                    systemAdditionalValue.value = noterMessages;
                }
                else
                {
                    additionalValue.key   = "ActualLidId";
                    additionalValue.value = noterMessages;
                    existingAdditionalValue.Add(additionalValue);
                }
            }
            return(existingAdditionalValue);
        }
        /// <summary>
        /// Returns true if BankingProductFee instances are equal
        /// </summary>
        /// <param name="other">Instance of BankingProductFee to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(BankingProductFee other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                     ) &&
                 (
                     FeeType == other.FeeType ||
                     FeeType != null &&
                     FeeType.Equals(other.FeeType)
                 ) &&
                 (
                     Amount == other.Amount ||
                     Amount != null &&
                     Amount.Equals(other.Amount)
                 ) &&
                 (
                     BalanceRate == other.BalanceRate ||
                     BalanceRate != null &&
                     BalanceRate.Equals(other.BalanceRate)
                 ) &&
                 (
                     TransactionRate == other.TransactionRate ||
                     TransactionRate != null &&
                     TransactionRate.Equals(other.TransactionRate)
                 ) &&
                 (
                     AccruedRate == other.AccruedRate ||
                     AccruedRate != null &&
                     AccruedRate.Equals(other.AccruedRate)
                 ) &&
                 (
                     AccrualFrequency == other.AccrualFrequency ||
                     AccrualFrequency != null &&
                     AccrualFrequency.Equals(other.AccrualFrequency)
                 ) &&
                 (
                     Currency == other.Currency ||
                     Currency != null &&
                     Currency.Equals(other.Currency)
                 ) &&
                 (
                     AdditionalValue == other.AdditionalValue ||
                     AdditionalValue != null &&
                     AdditionalValue.Equals(other.AdditionalValue)
                 ) &&
                 (
                     AdditionalInfo == other.AdditionalInfo ||
                     AdditionalInfo != null &&
                     AdditionalInfo.Equals(other.AdditionalInfo)
                 ) &&
                 (
                     AdditionalInfoUri == other.AdditionalInfoUri ||
                     AdditionalInfoUri != null &&
                     AdditionalInfoUri.Equals(other.AdditionalInfoUri)
                 ) &&
                 (
                     Discounts == other.Discounts ||
                     Discounts != null &&
                     Discounts.SequenceEqual(other.Discounts)
                 ));
        }
        /// <summary>
        /// Returns true if BankingAccountDiscount instances are equal
        /// </summary>
        /// <param name="other">Instance of BankingAccountDiscount to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(BankingAccountDiscount other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Description == other.Description ||
                     Description != null &&
                     Description.Equals(other.Description)
                     ) &&
                 (
                     DiscountType == other.DiscountType ||
                     DiscountType != null &&
                     DiscountType.Equals(other.DiscountType)
                 ) &&
                 (
                     Amount == other.Amount ||
                     Amount != null &&
                     Amount.Equals(other.Amount)
                 ) &&
                 (
                     BalanceRate == other.BalanceRate ||
                     BalanceRate != null &&
                     BalanceRate.Equals(other.BalanceRate)
                 ) &&
                 (
                     TransactionRate == other.TransactionRate ||
                     TransactionRate != null &&
                     TransactionRate.Equals(other.TransactionRate)
                 ) &&
                 (
                     AccruedRate == other.AccruedRate ||
                     AccruedRate != null &&
                     AccruedRate.Equals(other.AccruedRate)
                 ) &&
                 (
                     AdditionalValue == other.AdditionalValue ||
                     AdditionalValue != null &&
                     AdditionalValue.Equals(other.AdditionalValue)
                 ) &&
                 (
                     Eligibility == other.Eligibility ||
                     Eligibility != null &&
                     Eligibility.SequenceEqual(other.Eligibility)
                 ) &&
                 (
                     AdditionalInfo == other.AdditionalInfo ||
                     AdditionalInfo != null &&
                     AdditionalInfo.Equals(other.AdditionalInfo)
                 ) &&
                 (
                     AdditionalInfoUri == other.AdditionalInfoUri ||
                     AdditionalInfoUri != null &&
                     AdditionalInfoUri.Equals(other.AdditionalInfoUri)
                 ));
        }
        /// <summary>
        /// Genera un objeto a partir de su representación XML.
        /// </summary>
        /// <param name="reader">Secuencia de <see cref="T:System.Xml.XmlReader" /> desde la que se deserializa el objeto.</param>
        public void ReadXml(XmlReader reader)
        {
            Boolean wasEmpty = reader.IsEmptyElement;

            reader.Read();

            if (wasEmpty)
            {
                return;
            }

            while (reader.NodeType != XmlNodeType.EndElement)
            {
                KT key;
                if (reader.Name == "entry")
                {
                    reader.Read();
                    Type   keytype = reader.ValueType;
                    object obj     = null;
                    if (keytype != null)
                    {
                        key = (KT) new XmlSerializer(keytype).Deserialize(reader);
                        Type valuetype = reader.ValueType;

                        if (valuetype != null)
                        {
                            if ("additionalvalue".ToLower().Equals(reader.Name.ToLower()))
                            {
                                obj = new AdditionalValue();

                                reader.Read();
                                reader.Read();
                                ((AdditionalValue)obj).Value = reader.ReadContentAsDecimal();
                                reader.Read();
                                reader.Read();
                                ((AdditionalValue)obj).Currency = (Currency)Enum.Parse(typeof(Currency), reader.Value);
                                reader.Read();
                                reader.ReadEndElement();
                            }
                            else
                            {
                                reader.Read();
                                obj = reader.ReadContentAsObject();
                            }

                            VT value = (VT)obj;
                            Add(key, value);
                            reader.ReadEndElement();
                        }
                        else
                        {
                            Add(key, default(VT));
                            reader.Skip();
                        }
                    }

                    /*if (obj.GetType() != typeof(AdditionalValue))
                     * {
                     *
                     *
                     * }*/
                    reader.ReadEndElement();
                    reader.MoveToContent();
                }
            }

            reader.ReadEndElement();
        }