コード例 #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 (Bsb != null)
         {
             hashCode = hashCode * 59 + Bsb.GetHashCode();
         }
         if (AccountNumber != null)
         {
             hashCode = hashCode * 59 + AccountNumber.GetHashCode();
         }
         if (BundleName != null)
         {
             hashCode = hashCode * 59 + BundleName.GetHashCode();
         }
         if (SpecificAccountUType != null)
         {
             hashCode = hashCode * 59 + SpecificAccountUType.GetHashCode();
         }
         if (TermDeposit != null)
         {
             hashCode = hashCode * 59 + TermDeposit.GetHashCode();
         }
         if (CreditCard != null)
         {
             hashCode = hashCode * 59 + CreditCard.GetHashCode();
         }
         if (Loan != null)
         {
             hashCode = hashCode * 59 + Loan.GetHashCode();
         }
         if (Features != null)
         {
             hashCode = hashCode * 59 + Features.GetHashCode();
         }
         if (Fees != null)
         {
             hashCode = hashCode * 59 + Fees.GetHashCode();
         }
         if (DepositRates != null)
         {
             hashCode = hashCode * 59 + DepositRates.GetHashCode();
         }
         if (LendingRates != null)
         {
             hashCode = hashCode * 59 + LendingRates.GetHashCode();
         }
         if (Address != null)
         {
             hashCode = hashCode * 59 + Address.GetHashCode();
         }
         return(hashCode);
     }
 }
コード例 #2
0
        /// <summary>
        /// Returns true if BankingProductDetail instances are equal
        /// </summary>
        /// <param name="other">Instance of BankingProductDetail to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(BankingProductDetail other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Bundles == other.Bundles ||
                     Bundles != null &&
                     Bundles.SequenceEqual(other.Bundles)
                     ) &&
                 (
                     Features == other.Features ||
                     Features != null &&
                     Features.SequenceEqual(other.Features)
                 ) &&
                 (
                     Constraints == other.Constraints ||
                     Constraints != null &&
                     Constraints.SequenceEqual(other.Constraints)
                 ) &&
                 (
                     Eligibility == other.Eligibility ||
                     Eligibility != null &&
                     Eligibility.SequenceEqual(other.Eligibility)
                 ) &&
                 (
                     Fees == other.Fees ||
                     Fees != null &&
                     Fees.SequenceEqual(other.Fees)
                 ) &&
                 (
                     DepositRates == other.DepositRates ||
                     DepositRates != null &&
                     DepositRates.SequenceEqual(other.DepositRates)
                 ) &&
                 (
                     LendingRates == other.LendingRates ||
                     LendingRates != null &&
                     LendingRates.SequenceEqual(other.LendingRates)
                 ));
        }
コード例 #3
0
        /// <summary>
        /// Конструктор модели представления
        /// </summary>
        /// <param name="openDepsitWindow">окно пополнение лиц. счета карты</param>
        /// <param name="messageService">сервис работы с сообщениями</param>
        /// <param name="selectedClient">выбранный клиент</param>
        public OpenDeposiViewModel(Window openDepsitWindow, IMessageService messageService, Client selectedClient)
        {
            this.openDepositWindow = openDepsitWindow;
            this.messageService    = messageService;

            SelectedClient = selectedClient;

            errors = new Dictionary <string, string>
            {
                [nameof(Amount)] = null
            };

            CardBalance    = selectedClient.Account.Card.CardBalance;
            Capitalization = selectedClient.Account.Deposit.DepositCapitalization;
            DepositRate    = DepositRates.GetDepositRate(ClientType);

            CheckFields();
        }
コード例 #4
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 (Bundles != null)
         {
             hashCode = hashCode * 59 + Bundles.GetHashCode();
         }
         if (Features != null)
         {
             hashCode = hashCode * 59 + Features.GetHashCode();
         }
         if (Constraints != null)
         {
             hashCode = hashCode * 59 + Constraints.GetHashCode();
         }
         if (Eligibility != null)
         {
             hashCode = hashCode * 59 + Eligibility.GetHashCode();
         }
         if (Fees != null)
         {
             hashCode = hashCode * 59 + Fees.GetHashCode();
         }
         if (DepositRates != null)
         {
             hashCode = hashCode * 59 + DepositRates.GetHashCode();
         }
         if (LendingRates != null)
         {
             hashCode = hashCode * 59 + LendingRates.GetHashCode();
         }
         return(hashCode);
     }
 }
コード例 #5
0
 /// <summary>
 /// Метод создания депозита
 /// </summary>
 /// <param name="depositBalance">баланс</param>
 /// <param name="depositCapitalization">капитализация</param>
 /// <param name="clientType">тип клиента</param>
 /// <returns>депозит</returns>
 public override Deposit CreateDeposit(decimal depositBalance, bool depositCapitalization, ClientType clientType) =>
 new DefaultDeposit(depositBalance, depositCapitalization, DepositRates.GetDepositRate(clientType));
コード例 #6
0
        /// <summary>
        /// Returns true if BankingAccountDetail instances are equal
        /// </summary>
        /// <param name="other">Instance of BankingAccountDetail to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(BankingAccountDetail other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Bsb == other.Bsb ||
                     Bsb != null &&
                     Bsb.Equals(other.Bsb)
                     ) &&
                 (
                     AccountNumber == other.AccountNumber ||
                     AccountNumber != null &&
                     AccountNumber.Equals(other.AccountNumber)
                 ) &&
                 (
                     BundleName == other.BundleName ||
                     BundleName != null &&
                     BundleName.Equals(other.BundleName)
                 ) &&
                 (
                     SpecificAccountUType == other.SpecificAccountUType ||
                     SpecificAccountUType != null &&
                     SpecificAccountUType.Equals(other.SpecificAccountUType)
                 ) &&
                 (
                     TermDeposit == other.TermDeposit ||
                     TermDeposit != null &&
                     TermDeposit.Equals(other.TermDeposit)
                 ) &&
                 (
                     CreditCard == other.CreditCard ||
                     CreditCard != null &&
                     CreditCard.Equals(other.CreditCard)
                 ) &&
                 (
                     Loan == other.Loan ||
                     Loan != null &&
                     Loan.Equals(other.Loan)
                 ) &&
                 (
                     Features == other.Features ||
                     Features != null &&
                     Features.SequenceEqual(other.Features)
                 ) &&
                 (
                     Fees == other.Fees ||
                     Fees != null &&
                     Fees.SequenceEqual(other.Fees)
                 ) &&
                 (
                     DepositRates == other.DepositRates ||
                     DepositRates != null &&
                     DepositRates.SequenceEqual(other.DepositRates)
                 ) &&
                 (
                     LendingRates == other.LendingRates ||
                     LendingRates != null &&
                     LendingRates.SequenceEqual(other.LendingRates)
                 ) &&
                 (
                     Address == other.Address ||
                     Address != null &&
                     Address.Equals(other.Address)
                 ));
        }