public void model_admin() { if (ajf != null) { ajf.dispose(); } if (jf != null) { jf.dispose(); } ajf = new AdminRunningFrame(this); ajf.startPage(); if (DBfile.exists()) { try { cust = returnSavedData("p2.dat"); if (cust.isEmpty()) { ajf.errorMessage("There are no customers in this database."); } } catch (ClassNotFoundException | IOException e) { e.printStackTrace(); } } if (logFile.exists()) { try { adminLogs = returnLog("p2.log"); if (adminLogs.isEmpty()) { ajf.errorMessage("No entries have been found!"); } } catch (ClassNotFoundException | IOException e) { e.printStackTrace(); } } }
public void model_open_account(String customerID, String customerPIN) { // calls the openAccountScreen function in RunningFrame class validate_info(customerID, customerPIN); if (customer != null) { jf.dispose(); jf = new RunningFrame(this); jf.openAccountScreen(); } }
public void model_close_account(String customerID, String customerPIN) { // calls the transfer screen from the RunningFrame class validate_info(customerID, customerPIN); if (customer != null) { jf.dispose(); jf = new RunningFrame(this); ArrayList<String> allAccounts = customer.getAllAccounts(); jf.closeAccountScreen(allAccounts); } }
public void model_account_info(String customerID, String customerPIN) { // calls the transfer screen from the RunningFrame class validate_info(customerID, customerPIN); if (customer != null) { jf.dispose(); jf = new RunningFrame(this); String text = customer.printAccountInfo(); jf.accountInfoScreen(text, adminLogs, customerID); } }
public void model_transfer(String customerID, String customerPIN) { // calls the transfer screen from the RunningFrame class validate_info(customerID, customerPIN); if (customer != null) { jf.dispose(); jf = new RunningFrame(this); String result = customer.returnInfo(); ArrayList<String> allAccounts = customer.getAllAccounts(); jf.transferScreen(result, allAccounts); } }
public void callStartPage() { customer = null; pin = null; if (ajf != null) { ajf.dispose(); } if (jf != null) { jf.dispose(); } jf = new RunningFrame(this); jf.startPage(); }
public void model_create_account() { jf.dispose(); jf = new RunningFrame(this); jf.createAccountScreen(); }