Esempio n. 1
0
        private BankInfo SendingMoney(IBank sendingBank)
        {
            Console.Clear();
            BankInfo targetInfo = new BankInfo();

            Console.WriteLine("Sending money to:");
            Console.WriteLine("IBAN");
            targetInfo.IBAN = Console.ReadLine();
            Console.WriteLine("Sending amount");
            decimal amount = Decimal.Parse(Console.ReadLine());

            foreach (IBank bank in bankList)
            {
                if (bank.MatchIBAN(targetInfo.IBAN) != null)
                {
                    targetInfo = bank.MatchIBAN(targetInfo.IBAN);
                }
            }

            return(sendingBank.ExecuteTransaction(targetInfo, amount));
        }