Exemple #1
0
 public BankAccount(int id, string holderName, decimal balance, int bonusPoints,
                    ICalculatorBonusPoints computeToWithdraw, ICalculatorBonusPoints computeToDeposit)
     : this(id, holderName, balance, bonusPoints)
 {
     this.ComputeBonusPointsToDeposit  = computeToDeposit;
     this.ComputeBonusPointsToWithdraw = computeToWithdraw;
 }
Exemple #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GoldAccount"/> class.
 /// </summary>
 /// <param name="id">The identifier of bank account.</param>
 /// <param name="name">The name of a holder.</param>
 /// <param name="balance">The balance.</param>
 /// <param name="bonusPoint">Bonus points.</param>
 /// <param name="computeToWithdraw">Strategy to compute bonus points to withdraw.</param>
 /// <param name="computeToDeposit">Strategy to compute bonus points to deposit.</param>
 public GoldAccount(int id, string name, decimal balance, int bonusPoints,
                    ICalculatorBonusPoints computeToWithdraw, ICalculatorBonusPoints computeToDeposit)
     : base(id, name, balance, bonusPoints, computeToWithdraw, computeToDeposit)
 {
 }
        public BankAccount GetInstance(int id, string name, decimal balance, int bonusPoints, TypeBankAccount type, ICalculatorBonusPoints toDeposit, ICalculatorBonusPoints toWithdraw)
        {
            switch (type)
            {
            case TypeBankAccount.Base:
                return(new BaseAccount(id, name, balance, bonusPoints, toWithdraw, toDeposit));

            case TypeBankAccount.Golden:
                return(new GoldAccount(id, name, balance, bonusPoints, toWithdraw, toDeposit));

            case TypeBankAccount.Platinum:
                return(new PlatinumAccount(id, name, balance, bonusPoints, toWithdraw, toDeposit));

            default:
                return(new BaseAccount(id, name, balance, bonusPoints, toWithdraw, toDeposit));
            }
        }