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 }
public static int CreateNewBankAccount(BankManager manager) { var acc = new BankAccount() { OwnerID = UserId }; manager.CreateBankAccount(acc); return(acc.AccountNumber); }
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()); }
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()); }
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 + "."); }
public static IEnumerable <BankAccount> GetAllAccountsForUser(BankManager manager) { return(manager.GetAllAccounts(UserId)); }
public static double GetTotalBalanceForUser(BankManager manager) { return(manager.GetTotalBalance(UserId)); }