예제 #1
0
        private CardInfo SendingMoney(ICard sendingBank)
        {
            Console.Clear();
            CardInfo targetInfo = new CardInfo();

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

            foreach (ICard card in cardList)
            {
                if (card.MatchIBAN(targetInfo.IBAN) != null)
                {
                    targetInfo = card.MatchIBAN(targetInfo.IBAN);
                    return(sendingBank.ExecuteTransaction(targetInfo, amount));
                }
            }
            return(null);
        }