예제 #1
0
        static void Main(string[] args)
        {
            TextFileInputOutput.CreateStorage();
            programStart();

            #region variables

            bool    programLoop = true;
            Account account     = new Account();

            Console.WriteLine("Added two test accounts to the database:");
            Console.WriteLine("Account Number: 100000, PIN: 1234 & Account Number: 100000, PIN: 1234");

            Dictionary <int, Account> accountList = new Dictionary <int, Account>();

            TextFileInputOutput.ReadAccountsFromFile(accountList);

            Console.ReadLine();

            #endregion

            while (programLoop)
            {
                string userInput = initialMessage();

                switch (userInput)
                {
                case "CREATE":
                case "C":
                    account.userLogin = false;
                    account           = AccountCreation.CreateNewAccount(accountList);
                    break;

                case "L":
                    LoginLogout.ShortCutAdvice();
                    break;

                case "LOGIN":
                case "LI":
                    account = LoginLogout.Login(account, accountList);
                    break;

                case "LOGOUT":
                case "LO":
                    LoginLogout.Logout(account, accountList);
                    break;

                case "BALANCE":
                case "B":
                    Balance.CheckBalance(accountList, account);
                    break;

                case "WITHDRAW":
                case "W":
                    Withdraw.WithdrawFunds(accountList, account);
                    break;

                case "DEPOSIT":
                case "D":
                    Deposit.DepositFunds(accountList, account);
                    break;

                case "TRANSFER":
                case "T":
                    Transfer.TransferFunds(accountList, account);
                    break;

                case "QUIT":
                case "Q":
                    programLoop = exitProgram();
                    break;

                default:
                    Console.WriteLine("Input not understood, please re-enter");
                    Console.ReadLine();
                    break;
                }
            }
        }
예제 #2
0
 private void Deposit_Click(object sender, EventArgs e)
 {
     Deposit deposit = new Deposit(this);
     deposit.ShowDialog(); 
 }
예제 #3
0
 private Transaction createTransaction(int type)
 {
     Transaction tempPtr = null;
     switch (type)
     {
         case 1:
             tempPtr = new Balancelnquiry(currentPIN, screen, bankDatabase);
             break;
         case 2:
             tempPtr = new Withdrawal(currentPIN, screen, bankDatabase, cashDispenser);
             break;
         case 3:
             tempPtr = new Deposit(currentPIN, screen, bankDatabase, depositSlot, cashDispenser);
             break;
         case 4:
             tempPtr = new Transfer(currentPIN, screen, bankDatabase);
             break;
     }
     return tempPtr;
 }