Пример #1
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 (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>
 /// 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);
     }
 }
Пример #3
0
        /// <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)
                 ));
        }
Пример #5
0
        private List <TransactionRate> GetTransactionRates(string input)
        {
            var  rateName = input.GetFirstHtmlTagValue("label").GetHtmlTagContent();
            bool?isFront  = null;

            if (rateName.Contains("前端"))
            {
                isFront = true;
            }
            if (rateName.Contains("后端"))
            {
                isFront = false;
            }

            var sgyh = input.GetHtmlTagValueByAttri("div", "class", "sgyh").FirstOrDefault();

            string[] columns;
            if (sgyh == null)
            {
                columns = new string[]
                {
                    input.GetHtmlTagValue("th", 2).GetHtmlTagContent(),
                };
            }
            else
            {
                List <string> list = new List <string>()
                {
                    input.GetFirstHtmlTagValue("span").GetHtmlTagContent(),
                };
                var temp = sgyh.GetHtmlTagContent();
                if (temp.Contains("|"))
                {
                    temp = temp.Substring(temp.IndexOf("<br/>") + 5);
                    list.AddRange(Regex.Replace(temp, "<.*>", "|").Split('|'));
                }
                else
                {
                    list.Add(temp);
                }

                columns = list.ToArray();
            }

            var result = new List <TransactionRate>();
            var rows   = input.GetFirstHtmlTagValue("tbody").GetHtmlTagValue("tr");

            foreach (var row in rows)
            {
                var rate = new TransactionRate()
                {
                    IsFront = isFront
                };

                var tds = row.GetHtmlTagValue("td").ToList();
                rate.ApplicableAmount = tds[0].GetHtmlTagContent();
                rate.ApplicablePeriod = tds[1].GetHtmlTagContent();

                rate.Rate = new Dictionary <string, string>();
                var temp  = tds[2].GetHtmlTagContent().Replace("&nbsp;", "").Replace("</strike>", "");
                var index = temp.IndexOf(">");
                if (index > -1)
                {
                    temp = temp.Substring(index + 1);
                    var rates = temp.Split('|');
                    for (int i = 0; i < columns.Length; i++)
                    {
                        rate.Rate.Add(columns[i], rates[i]);
                    }
                }
                else
                {
                    for (int i = 0; i < columns.Length; i++)
                    {
                        rate.Rate.Add(columns[i], temp);
                    }
                }

                result.Add(rate);
            }

            return(result);
        }