Exemplo n.º 1
0
 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();
     }
   }
 }
Exemplo n.º 2
0
 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();
   }
 }
Exemplo n.º 3
0
 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);
   }
 }
Exemplo n.º 4
0
 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);
   }
 }
Exemplo n.º 5
0
 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);
   }
 }
Exemplo n.º 6
0
 public void callStartPage() {
   customer = null;
   pin = null;
   if (ajf != null) {
     ajf.dispose();
   }
   if (jf != null) {
     jf.dispose();
   }
   jf = new RunningFrame(this);
   jf.startPage();
 }
Exemplo n.º 7
0
 public void model_create_account() {
   jf.dispose();
   jf = new RunningFrame(this);
   jf.createAccountScreen();
 }