Пример #1
0
        private static string MakeTransaction(BankManager manager)
        {
            int input  = (int)GetValidInput("Sender Account number");
            var acc    = manager.GetAccount(input);
            int input2 = (int)GetValidInput("Receiver Account number");
            var acc2   = manager.GetAccount(input2);

            double amount = GetValidInput("Amount");

            manager.Transaction(input, input2, amount);

            return(amount.ToString() + " was transferred from account " + input + " to " + input2 + ".");
        }
Пример #2
0
        public static string ShowDetailsForAccount(BankManager manager)
        {
            int input = (int)GetValidInput("Account number");

            var acc = manager.GetAccount(input);

            return("Account Number: " + acc.AccountNumber
                   + "Balance: " + acc.Balance);
            // And whatever other stuff may be in a bank account
        }
Пример #3
0
        private static string MakeAWithdrawal(BankManager manager)
        {
            int input = (int)GetValidInput("Account number");
            var acc   = manager.GetAccount(input);

            double amount = GetValidInput("Amount");

            manager.WithdrawFromAccount(input, amount);

            return(amount.ToString() + " was withdrawed from the account: " + input.ToString());
        }
Пример #4
0
        private static string MakeADeposit(BankManager manager)
        {
            int input = (int)GetValidInput("Account number");
            var acc   = manager.GetAccount(input);

            double amount = GetValidInput("Amount");

            manager.InsertToAccount(input, amount);

            return(amount.ToString() + " was desposited into the account: " + input.ToString());
        }