Exemple #1
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
        }
Exemple #2
0
        public static int CreateNewBankAccount(BankManager manager)
        {
            var acc = new BankAccount()
            {
                OwnerID = UserId
            };

            manager.CreateBankAccount(acc);

            return(acc.AccountNumber);
        }
Exemple #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());
        }
Exemple #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());
        }
Exemple #5
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 + ".");
        }
Exemple #6
0
 public static IEnumerable <BankAccount> GetAllAccountsForUser(BankManager manager)
 {
     return(manager.GetAllAccounts(UserId));
 }
Exemple #7
0
 public static double GetTotalBalanceForUser(BankManager manager)
 {
     return(manager.GetTotalBalance(UserId));
 }