├── .classpath ├── .project ├── .settings ├── org.eclipse.core.resources.prefs ├── org.eclipse.jdt.core.prefs └── org.eclipse.m2e.core.prefs ├── README.md ├── database.sql ├── pom.xml ├── src ├── main │ └── java │ │ └── com │ │ └── demo │ │ └── OOPD_Project │ │ ├── App.java │ │ ├── Bean │ │ ├── AccountBean.java │ │ ├── AccountHolderBean.java │ │ └── AdminBean.java │ │ ├── DBUtil │ │ └── Database.java │ │ ├── GUI │ │ ├── AddNewUser.java │ │ ├── AdminWelcomeScreen.java │ │ ├── Admin_Login.java │ │ ├── Deposit.java │ │ ├── Home_Screen.java │ │ ├── Login_Screen_Client.java │ │ ├── ShowReportGUI.java │ │ ├── SignUp.java │ │ ├── Welcome_user.java │ │ ├── WithdrawForm.java │ │ ├── report.java │ │ ├── setInterestGUI.java │ │ └── setTaxGUI.java │ │ ├── dao │ │ ├── AccountDAO.java │ │ ├── AccountHolderDAO.java │ │ ├── AdminDAO.java │ │ ├── DepositDAO.java │ │ ├── IAccountDAO.java │ │ ├── IAccountHolderDAO.java │ │ ├── IAdminDAO.java │ │ ├── IQuerryMapper.java │ │ └── Withdraw.java │ │ └── exception │ │ └── OOPDException.java └── test │ └── java │ └── com │ └── demo │ └── OOPD_Project │ └── AppTest.java └── target ├── classes └── com │ └── demo │ └── OOPD_Project │ ├── App.class │ ├── Bean │ ├── AccountBean.class │ ├── AccountHolderBean.class │ └── AdminBean.class │ ├── DBUtil │ └── Database.class │ ├── GUI │ ├── AddNewUser$1.class │ ├── AddNewUser.class │ ├── AdminWelcomeScreen$1.class │ ├── AdminWelcomeScreen$2.class │ ├── AdminWelcomeScreen$3.class │ ├── AdminWelcomeScreen$4.class │ ├── AdminWelcomeScreen$5.class │ ├── AdminWelcomeScreen$6.class │ ├── AdminWelcomeScreen.class │ ├── Admin_Login$1.class │ ├── Admin_Login$2.class │ ├── Admin_Login$3.class │ ├── Admin_Login$4.class │ ├── Admin_Login$5.class │ ├── Admin_Login.class │ ├── Deposit$1.class │ ├── Deposit$2.class │ ├── Deposit$3.class │ ├── Deposit$4.class │ ├── Deposit$5.class │ ├── Deposit.class │ ├── Home_Screen$1.class │ ├── Home_Screen$2.class │ ├── Home_Screen$3.class │ ├── Home_Screen$4.class │ ├── Home_Screen$5.class │ ├── Home_Screen.class │ ├── Login_Screen_Client$1.class │ ├── Login_Screen_Client$2.class │ ├── Login_Screen_Client$3.class │ ├── Login_Screen_Client$4.class │ ├── Login_Screen_Client$5.class │ ├── Login_Screen_Client$6.class │ ├── Login_Screen_Client.class │ ├── ShowReportGUI$1.class │ ├── ShowReportGUI$2.class │ ├── ShowReportGUI$3.class │ ├── ShowReportGUI$4.class │ ├── ShowReportGUI.class │ ├── SignUp$1.class │ ├── SignUp$2.class │ ├── SignUp$3.class │ ├── SignUp$4.class │ ├── SignUp$5.class │ ├── SignUp$6.class │ ├── SignUp$7.class │ ├── SignUp.class │ ├── Welcome_user$1.class │ ├── Welcome_user$2.class │ ├── Welcome_user$3.class │ ├── Welcome_user$4.class │ ├── Welcome_user$5.class │ ├── Welcome_user.class │ ├── WithdrawForm$1.class │ ├── WithdrawForm$2.class │ ├── WithdrawForm$3.class │ ├── WithdrawForm$4.class │ ├── WithdrawForm$5.class │ ├── WithdrawForm$6.class │ ├── WithdrawForm.class │ ├── report$1.class │ ├── report$2.class │ ├── report.class │ ├── setInterestGUI$1.class │ ├── setInterestGUI$2.class │ ├── setInterestGUI$3.class │ ├── setInterestGUI$4.class │ ├── setInterestGUI$5.class │ ├── setInterestGUI.class │ ├── setTaxGUI$1.class │ ├── setTaxGUI$2.class │ ├── setTaxGUI$3.class │ ├── setTaxGUI$4.class │ ├── setTaxGUI$5.class │ └── setTaxGUI.class │ ├── dao │ ├── AccountDAO.class │ ├── AccountHolderDAO.class │ ├── AdminDAO$YourTask.class │ ├── AdminDAO.class │ ├── DepositDAO.class │ ├── IAccountDAO.class │ ├── IAccountHolderDAO.class │ ├── IAdminDAO.class │ ├── IQuerryMapper.class │ └── Withdraw.class │ └── exception │ └── OOPDException.class └── test-classes └── com └── demo └── OOPD_Project └── AppTest.class /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | OOPD_Project 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.m2e.core.maven2Builder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.jdt.core.javanature 21 | org.eclipse.m2e.core.maven2Nature 22 | 23 | 24 | -------------------------------------------------------------------------------- /.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//src/main/java=UTF-8 3 | encoding//src/test/java=UTF-8 4 | encoding/=UTF-8 5 | -------------------------------------------------------------------------------- /.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 3 | org.eclipse.jdt.core.compiler.compliance=1.5 4 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 5 | org.eclipse.jdt.core.compiler.release=disabled 6 | org.eclipse.jdt.core.compiler.source=1.5 7 | -------------------------------------------------------------------------------- /.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Java-Bank-Application 2 | This is a java based project on banking. In this project we are creating a retail bank which collects money from customers and in return gives them an interest in predetermined interest rate. We are trying to automate this process of interest calculation. This system will automatically calculate amount daily for each account having balance more than 0. At the end of every month total interest accumlated by each user will get added to their account balance. 3 | The developed retail banking system for the project calculates interest daily for a user, this interest is stored separately in a table. At the end of the month the sum of all interests in the table is calculated , tax is deducted from the interests earned and the value after deducting the tax is inserted into the table which stores the interest earned for each month (the question says to display report of earning on a periodic basis we consider here that period to be as a month). 4 | 5 | # Technology stack 6 | Java, JDBC, AWT Swing, MYSQL 7 | 8 | The below three outputs are controlled by the admin: 9 | 1. Calculation of interest: What we have understood from this is that this requires the depiction of formula for calculation of interest. 10 | 2. Interest rate structure: The present rate of interest for the bank 11 | 3. Show report: The earnings of the client from the time he/she has become a customer of the bank. These services are exclusive to the admin and can ony be accessed when the admin is logged in. 12 | 13 | ## Calculation of Interest: 14 | For the calculation of interest we have made an assumption regarding the fact that the interest needs to be computed daily. Since this is a local system based application it is implicit that we need to keep the system on all the time if we want a specific action to be performed everday without any help from an external source. Since this is not a server based or cloud based application we have made an assumption that the admin should login at 23:58-00:00 everyday to trigger the calculation of interest for that day, this needs to be done due to the issue discussed above. In this period we are not allowing any client to login between 23:58-00:00. 15 | 16 | ## Requirement of database: 17 | The project requires an active connection to the database whenever it is opened on the system. 18 | 19 | ## Admin: 20 | There is only one admin which simulated a real life bank by performing the following activities: 21 | 1. Calculation of interest 22 | 2. Showing report to users for their earnings 23 | 3. Display of interest rate structure 24 | 4. Can set rate of interest 25 | 5. Can set rate of tax 26 | 6. Structure followed for calculation of interest 27 | 28 | ## Client: 29 | The client is allowed to signup as a new user into the bank and perform operations such as deposit/ withdraw. Necessary validations have been put in place for entering amount so that invalid transactions are prevented. 30 | 31 | ## Sign Up: 32 | At the time of signup the user is provided with an account number that the user has to remember or note down somewhere as it is important for the user for some services the user might require. 33 | 34 | ## Log in: 35 | On an application running on a system the following scenarios can occur with regard to logging in: 36 | 1. Two clients cannot be logged in at the same time 37 | 2. Admin and a client can be logged in at the same time 38 | ## Log out: 39 | When the window for the application is closed the client/admin whoever closed the window is automatically logged out. 40 | 41 | ## Storing passwords of user: 42 | Passwords have been stored in an encrypted form(using SHA-1 encryption) in the database 43 | 44 | ## Not giving setInterest or setTax to user: 45 | Due to obvious reasons we are not providing the functionality of setInterest or setTax with the user as the user can change them for other users as well. 46 | 47 | ## Showreport with admin: 48 | By entering the account number of the user, he/she can view their earnings until now from the day they joined the bank, in between the interest might have been changed by the bank, we haven’t shown that explicitly as this change is reflected in the calculated balance for the user. 49 | The showreport option with the admin requires the admin to enter an account number for the user he/she wants to send/dispay the report to. If you are getting a blank screen after clicking on showreport option with the admin then it either implies that you have an entered an invalid account number or the account holder’s monthly transactions are null i.e. no monthly transaction registered.The application is pretty easy of use if the user is clear about his/her role to be played in the application. The buttons have labels which are self explanatory and can be used to easily manuover in the system. 50 | 51 | # Installation: 52 | 1. Clone or download the repo 53 | 2. Import as a maven project in eclipse. 54 | 3. Run all queries under database.sql 55 | 4. If you are using any database other than mysql download and configure its jdbc driver from maven repository using pom.xml 56 | 5. Configure the database connection string in database.java under src>main>DBUtil folder. 57 | 6. Run the application from eclipse. 58 | 59 | # Contributing 60 | 1. Fork it! 61 | 2. Create your feature branch: git checkout -b my-new-feature 62 | 3. Commit your changes: git commit -m 'new change' 63 | 4. Push to the branch : git push origin my-new-feature 64 | 5. Submit a pull request. 65 | -------------------------------------------------------------------------------- /database.sql: -------------------------------------------------------------------------------- 1 | create database OOPD; 2 | use OOPD; 3 | show tables; 4 | 5 | /* users Table */ 6 | CREATE TABLE account_holders(account_number VARCHAR(30) primary key, fname VARCHAR(30), lname VARCHAR(30), dateOfJoining date, password VARCHAR(40),active_session boolean); 7 | /**/ 8 | 9 | /* Admin Login status */ 10 | CREATE TABLE admin(username VARCHAR(30) primary key,password VARCHAR(40),active_status boolean); 11 | DROP TABLE admin; 12 | INSERT INTO admin values('admin',SHA1('qwerty'),false); /*You can change admin credential here if you want*/ 13 | /**/ 14 | 15 | /*CREATE SEQUENCE FOR account_number generation*/ 16 | CREATE TABLE current_account_number(account_number numeric primary key); 17 | INSERT INTO current_account_number values (12); /*Choose from where your sequence starts*/ 18 | /**/ 19 | 20 | 21 | /*Account Table*/ 22 | CREATE TABLE accounts(account_number VARCHAR(30) primary key, balance NUMERIC(10,2), foreign key(account_number) references account_holders(account_number) ON DELETE CASCADE); 23 | /**/ 24 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | com.demo 6 | OOPD_Project 7 | 0.0.1-SNAPSHOT 8 | jar 9 | 10 | OOPD_Project 11 | http://maven.apache.org 12 | 13 | 14 | UTF-8 15 | 16 | 17 | 18 | 19 | junit 20 | junit 21 | 4.13.1 22 | test 23 | 24 | 25 | 26 | 27 | mysql 28 | mysql-connector-java 29 | 8.0.18 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/main/java/com/demo/OOPD_Project/App.java: -------------------------------------------------------------------------------- 1 | package com.demo.OOPD_Project; 2 | 3 | /** 4 | * Hello world! 5 | * 6 | */ 7 | public class App 8 | { 9 | public static void main( String[] args ) 10 | { 11 | 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/demo/OOPD_Project/Bean/AccountBean.java: -------------------------------------------------------------------------------- 1 | package com.demo.OOPD_Project.Bean; 2 | 3 | public class AccountBean { 4 | private double balance; 5 | private AccountHolderBean customer; 6 | public double getBalance() { 7 | return balance; 8 | } 9 | public void setBalance(double balance) { 10 | this.balance = balance; 11 | } 12 | public AccountHolderBean getCustomer() { 13 | return customer; 14 | } 15 | public void setCustomer(AccountHolderBean customer) { 16 | this.customer = customer; 17 | } 18 | @Override 19 | public String toString() { 20 | return "AccountBean [balance=" + balance + ", customer=" + customer + "]"; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/demo/OOPD_Project/Bean/AccountHolderBean.java: -------------------------------------------------------------------------------- 1 | package com.demo.OOPD_Project.Bean; 2 | 3 | 4 | /* 5 | * This call is making a bean for account holder information and provides a way to store all the information related to the user with all the getters and setters for every variable 6 | */ 7 | 8 | public class AccountHolderBean { 9 | 10 | private String accountNumber; 11 | private String fname; 12 | private String lname; 13 | private String dateOfJoining; 14 | private String password; 15 | 16 | public AccountHolderBean() 17 | { 18 | this.accountNumber=null; 19 | this.fname = null; 20 | this.lname = null; 21 | this.dateOfJoining = null; 22 | this.password= null; 23 | } 24 | public String getAccountNumber() { 25 | return accountNumber; 26 | } 27 | public void setAccountNumber(String accountNumber) { 28 | this.accountNumber = accountNumber; 29 | } 30 | public String getFname() { 31 | return fname; 32 | } 33 | public void setFname(String fname) { 34 | this.fname = fname; 35 | } 36 | public String getLname() { 37 | return lname; 38 | } 39 | public void setLname(String lname) { 40 | this.lname = lname; 41 | } 42 | public String getDateOfJoining() { 43 | return dateOfJoining; 44 | } 45 | public void setDateOfJoining(String dateOfJoining) { 46 | this.dateOfJoining = dateOfJoining; 47 | } 48 | public String getPassword() { 49 | return password; 50 | } 51 | public void setPassword(String password) { 52 | this.password = password; 53 | } 54 | @Override 55 | public String toString() { 56 | return "AccountHolder [accountNumber=" + accountNumber + ", fname=" + fname + ", lname=" + lname 57 | + ", dateOfJoining=" + dateOfJoining + ", password=" + password + "]"; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/com/demo/OOPD_Project/Bean/AdminBean.java: -------------------------------------------------------------------------------- 1 | package com.demo.OOPD_Project.Bean; 2 | 3 | public class AdminBean { 4 | private String username; 5 | private String password; 6 | private double Interest; 7 | private double tax; 8 | public String getUsername() { 9 | return username; 10 | } 11 | public void setUsername(String username) { 12 | this.username = username; 13 | } 14 | public String getPassword() { 15 | return password; 16 | } 17 | public void setPassword(String password) { 18 | this.password = password; 19 | } 20 | @Override 21 | public String toString() { 22 | return "AdminBean [username=" + username + ", password=" + password + "]"; 23 | } 24 | public AdminBean() { 25 | this.username = null; 26 | this.password = null; 27 | } 28 | public double getInterest() { 29 | return Interest; 30 | } 31 | public void setInterest(double d) { 32 | Interest = d; 33 | } 34 | public double getTax() { 35 | return tax; 36 | } 37 | public void setTax(double tax) { 38 | this.tax = tax; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/demo/OOPD_Project/DBUtil/Database.java: -------------------------------------------------------------------------------- 1 | package com.demo.OOPD_Project.DBUtil; 2 | 3 | import java.sql.*; 4 | import com.demo.OOPD_Project.exception.OOPDException; 5 | 6 | /* 7 | * This utility provides the interface to connect to the database without requiring to pass URL string every time 8 | */ 9 | public class Database { 10 | 11 | static Connection conn=null; //declaring a Connection variable 12 | 13 | public static Connection estabblishConnection() throws OOPDException{ 14 | try{ 15 | conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/OOPD","root","System"); //Calling the database drivers 16 | } 17 | catch(SQLException e){ 18 | throw new OOPDException(e+"Error in database connection"); 19 | } 20 | return conn; //returning the connection object 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/demo/OOPD_Project/GUI/AddNewUser.java: -------------------------------------------------------------------------------- 1 | package com.demo.OOPD_Project.GUI; 2 | 3 | import java.awt.EventQueue; 4 | 5 | import javax.swing.JFrame; 6 | 7 | public class AddNewUser { 8 | 9 | private JFrame addNewUser; 10 | 11 | /** 12 | * Launch the application. 13 | */ 14 | public static void callNewUser() { 15 | EventQueue.invokeLater(new Runnable() { 16 | public void run() { 17 | try { 18 | AddNewUser window = new AddNewUser(); 19 | window.addNewUser.setVisible(true); 20 | } catch (Exception e) { 21 | e.printStackTrace(); 22 | } 23 | } 24 | }); 25 | } 26 | 27 | /** 28 | * Create the application. 29 | */ 30 | public AddNewUser() { 31 | initialize(); 32 | } 33 | 34 | /** 35 | * Initialize the contents of the frame. 36 | */ 37 | private void initialize() { 38 | addNewUser = new JFrame(); 39 | addNewUser.setBounds(100, 100, 450, 300); 40 | addNewUser.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/demo/OOPD_Project/GUI/AdminWelcomeScreen.java: -------------------------------------------------------------------------------- 1 | package com.demo.OOPD_Project.GUI; 2 | 3 | import java.awt.Component; 4 | import java.awt.Dimension; 5 | import java.awt.EventQueue; 6 | 7 | import javax.swing.JFrame; 8 | import javax.swing.JLabel; 9 | import javax.swing.JOptionPane; 10 | 11 | import com.demo.OOPD_Project.Bean.AdminBean; 12 | import com.demo.OOPD_Project.dao.AdminDAO; 13 | import com.demo.OOPD_Project.exception.OOPDException; 14 | 15 | import java.awt.Font; 16 | import java.awt.Toolkit; 17 | 18 | import javax.swing.JButton; 19 | import java.awt.event.ActionListener; 20 | import java.awt.event.ActionEvent; 21 | 22 | public class AdminWelcomeScreen { 23 | 24 | private JFrame AdminWelcome; 25 | private static AdminBean admin; 26 | private static AdminDAO service; 27 | 28 | public static void setAdmin(AdminBean a) 29 | { 30 | admin = a; 31 | } 32 | public static void setService(AdminDAO s) 33 | { 34 | service = s; 35 | } 36 | /** 37 | * Launch the application. 38 | */ 39 | public static void callAdminWelcomeScreen() { 40 | EventQueue.invokeLater(new Runnable() { 41 | public void run() { 42 | try { 43 | AdminWelcomeScreen window = new AdminWelcomeScreen(); 44 | window.AdminWelcome.setVisible(true); 45 | Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize(); 46 | int x = (int) ((dimension.getWidth() - window.AdminWelcome.getWidth()) / 2); 47 | int y = (int) ((dimension.getHeight() - window.AdminWelcome.getWidth()) / 2); 48 | window.AdminWelcome.setLocation(x, y); 49 | } catch (Exception e) { 50 | e.printStackTrace(); 51 | } 52 | } 53 | }); 54 | } 55 | 56 | /** 57 | * Create the application. 58 | * @throws OOPDException 59 | */ 60 | public AdminWelcomeScreen() throws OOPDException { 61 | initialize(); 62 | } 63 | 64 | /** 65 | * Initialize the contents of the frame. 66 | * @throws OOPDException 67 | */ 68 | private void initialize() throws OOPDException { 69 | AdminWelcome = new JFrame(); 70 | AdminWelcome.setBounds(1500, 900, 1200, 900); 71 | AdminWelcome.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); 72 | AdminWelcome.getContentPane().setLayout(null); 73 | 74 | /* If admin tries to cancel the screen directly we will log them out */ 75 | AdminWelcome.addWindowListener(new java.awt.event.WindowAdapter() { 76 | @Override 77 | public void windowClosing(java.awt.event.WindowEvent windowEvent) { 78 | if (JOptionPane.showConfirmDialog(AdminWelcome, 79 | "Are you sure you want to close this window?\n You will be logged out", "Close Window?", 80 | JOptionPane.YES_NO_OPTION, 81 | JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION){ 82 | try { 83 | service.adminLogout(admin); 84 | System.exit(0); 85 | } catch (OOPDException e) { 86 | // TODO Auto-generated catch block 87 | e.printStackTrace(); 88 | } 89 | System.exit(0); 90 | } 91 | } 92 | }); 93 | 94 | JButton btnLogout = new JButton("Logout"); 95 | btnLogout.addActionListener(new ActionListener() { 96 | public void actionPerformed(ActionEvent arg0) { 97 | Component frmLoginSystem = new JFrame("Exit"); 98 | if(JOptionPane.showConfirmDialog(frmLoginSystem, "Confirm if you want to Logout","Logout Alert",JOptionPane.YES_NO_OPTION)==JOptionPane.YES_NO_OPTION) { 99 | Home_Screen.main(null); 100 | AdminWelcome.setVisible(false); 101 | try { 102 | service.adminLogout(admin); 103 | System.exit(0); 104 | } catch (OOPDException e) { 105 | // TODO Auto-generated catch block 106 | e.printStackTrace(); 107 | } 108 | 109 | } 110 | } 111 | }); 112 | btnLogout.setBounds(159, 248, 200, 25); 113 | AdminWelcome.getContentPane().add(btnLogout); 114 | 115 | JButton btnSetInterest = new JButton("Set Interest"); 116 | btnSetInterest.addActionListener(new ActionListener() { 117 | public void actionPerformed(ActionEvent arg0) { 118 | setInterestGUI.adminBean(admin); 119 | setInterestGUI.adminDao(service); 120 | setInterestGUI.callSetInterest(); 121 | AdminWelcome.setVisible(false); 122 | } 123 | }); 124 | btnSetInterest.setBounds(159, 177, 200, 25); 125 | AdminWelcome.getContentPane().add(btnSetInterest); 126 | 127 | JLabel lblCurrentInterest = new JLabel("Current Interest Rate Structure:"); 128 | lblCurrentInterest.setBounds(32, 71, 235, 15); 129 | AdminWelcome.getContentPane().add(lblCurrentInterest); 130 | 131 | JLabel lblNewLabel = new JLabel(Double.toString(service.getInterestDB(admin))); 132 | lblNewLabel.setBounds(270, 71, 66, 15); 133 | AdminWelcome.getContentPane().add(lblNewLabel); 134 | 135 | JButton btnNewButton = new JButton("Set Tax"); 136 | btnNewButton.addActionListener(new ActionListener() { 137 | public void actionPerformed(ActionEvent arg0) { 138 | setTaxGUI.adminBean(admin); 139 | setTaxGUI.adminDao(service); 140 | setTaxGUI.runSetTaxGui(); 141 | AdminWelcome.setVisible(false); 142 | } 143 | }); 144 | btnNewButton.setBounds(777, 177, 200, 25); 145 | AdminWelcome.getContentPane().add(btnNewButton); 146 | 147 | JLabel lblCurrentTaxRate = new JLabel("Current Tax Rate Structure :"); 148 | lblCurrentTaxRate.setBounds(32, 93, 235, 15); 149 | AdminWelcome.getContentPane().add(lblCurrentTaxRate); 150 | 151 | JLabel lblNewLabel_1 = new JLabel(Double.toString(service.getTaxDB(admin))); 152 | lblNewLabel_1.setBounds(240, 93, 66, 15); 153 | AdminWelcome.getContentPane().add(lblNewLabel_1); 154 | 155 | JLabel curr = new JLabel("Interest"); 156 | curr.setBounds(650, 38, 66, 15); 157 | AdminWelcome.getContentPane().add(curr); 158 | 159 | JLabel label = new JLabel("*"); 160 | label.setBounds(730, 38, 66, 15); 161 | AdminWelcome.getContentPane().add(label); 162 | 163 | JLabel lblBalance = new JLabel("Balance"); 164 | lblBalance.setBounds(750, 38, 66, 15); 165 | AdminWelcome.getContentPane().add(lblBalance); 166 | 167 | JLabel label_1 = new JLabel("-----------"); 168 | label_1.setBounds(710, 52, 66, 15); 169 | AdminWelcome.getContentPane().add(label_1); 170 | 171 | JLabel label_2 = new JLabel("100"); 172 | label_2.setBounds(720, 71, 66, 15); 173 | AdminWelcome.getContentPane().add(label_2); 174 | 175 | JLabel lblNewLabel_2 = new JLabel("Sum Of ("); 176 | lblNewLabel_2.setFont(new Font("Dialog", Font.BOLD, 28)); 177 | lblNewLabel_2.setBounds(500, 50, 300, 35); 178 | AdminWelcome.getContentPane().add(lblNewLabel_2); 179 | 180 | JLabel lblNewLabel_3 = new JLabel(")"); 181 | lblNewLabel_3.setFont(new Font("Dialog", Font.BOLD, 28)); 182 | lblNewLabel_3.setBounds(810, 50, 66, 35); 183 | AdminWelcome.getContentPane().add(lblNewLabel_3); 184 | 185 | JButton btnShowReport = new JButton("Show Report"); 186 | btnShowReport.addActionListener(new ActionListener() { 187 | public void actionPerformed(ActionEvent arg0) { 188 | ShowReportGUI.callShowReport(); 189 | ShowReportGUI.setAdmin(admin); 190 | ShowReportGUI.setService(service); 191 | AdminWelcome.setVisible(false); 192 | } 193 | }); 194 | btnShowReport.setBounds(777, 248, 200, 25); 195 | AdminWelcome.getContentPane().add(btnShowReport); 196 | 197 | JLabel label_3 = new JLabel("["); 198 | label_3.setFont(new Font("Dialog", Font.BOLD, 28)); 199 | label_3.setBounds(825, 50, 20, 35); 200 | AdminWelcome.getContentPane().add(label_3); 201 | 202 | JLabel label_4 = new JLabel("1"); 203 | label_4.setBounds(847, 52, 10, 15); 204 | AdminWelcome.getContentPane().add(label_4); 205 | 206 | JLabel label_5 = new JLabel("-"); 207 | label_5.setFont(new Font("Dialog", Font.BOLD, 19)); 208 | label_5.setBounds(872, 50, 20, 15); 209 | AdminWelcome.getContentPane().add(label_5); 210 | 211 | JLabel lblTax = new JLabel("tax/100"); 212 | lblTax.setBounds(888, 50, 66, 15); 213 | AdminWelcome.getContentPane().add(lblTax); 214 | 215 | JLabel lblNewLabel_4 = new JLabel("]"); 216 | lblNewLabel_4.setFont(new Font("Dialog", Font.BOLD, 28)); 217 | lblNewLabel_4.setBounds(950, 50, 66, 35); 218 | AdminWelcome.getContentPane().add(lblNewLabel_4); 219 | } 220 | } 221 | -------------------------------------------------------------------------------- /src/main/java/com/demo/OOPD_Project/GUI/Admin_Login.java: -------------------------------------------------------------------------------- 1 | package com.demo.OOPD_Project.GUI; 2 | 3 | import java.awt.Dimension; 4 | import java.awt.EventQueue; 5 | 6 | import javax.swing.JFrame; 7 | import javax.swing.JLabel; 8 | import javax.swing.JOptionPane; 9 | 10 | import java.awt.Font; 11 | import java.awt.Toolkit; 12 | 13 | import javax.swing.SwingConstants; 14 | import javax.swing.SwingUtilities; 15 | 16 | import com.demo.OOPD_Project.Bean.AdminBean; 17 | import com.demo.OOPD_Project.dao.AdminDAO; 18 | import com.demo.OOPD_Project.exception.OOPDException; 19 | 20 | import javax.swing.JPasswordField; 21 | import javax.swing.JTextField; 22 | import javax.swing.JButton; 23 | import java.awt.event.ActionListener; 24 | import java.awt.event.KeyAdapter; 25 | import java.awt.event.KeyEvent; 26 | import java.awt.event.ActionEvent; 27 | 28 | /* 29 | * Login UI for employee/administrator 30 | */ 31 | public class Admin_Login { 32 | 33 | private JFrame adminLogin; 34 | private JPasswordField passwordField; 35 | private JTextField Username; 36 | 37 | /** 38 | * Launch the application. 39 | */ 40 | public static void callAdminLogin() { 41 | EventQueue.invokeLater(new Runnable() { 42 | public void run() { 43 | try { 44 | Admin_Login window = new Admin_Login(); 45 | window.adminLogin.setVisible(true); 46 | Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize(); 47 | int x = (int) ((dimension.getWidth() - window.adminLogin.getWidth()) / 2); 48 | int y = (int) ((dimension.getHeight() - window.adminLogin.getWidth()) / 2); 49 | window.adminLogin.setLocation(x, y); 50 | } catch (Exception e) { 51 | e.printStackTrace(); 52 | } 53 | } 54 | }); 55 | } 56 | 57 | /** 58 | * Create the application. 59 | */ 60 | public Admin_Login() { 61 | initialize(); 62 | } 63 | 64 | /** 65 | * Initialize the contents of the frame. 66 | */ 67 | private void initialize() { 68 | adminLogin = new JFrame(); 69 | adminLogin.setBounds(100, 100, 450, 300); 70 | adminLogin.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 71 | adminLogin.getContentPane().setLayout(null); 72 | 73 | JLabel lblWelcomeUser = new JLabel("Welcome Admin"); 74 | lblWelcomeUser.setFont(new Font("Dialog", Font.BOLD, 20)); 75 | lblWelcomeUser.setBounds(120, 12, 200, 40); 76 | adminLogin.getContentPane().add(lblWelcomeUser); 77 | 78 | JLabel lblNewLabel = new JLabel("Username"); 79 | lblNewLabel.setFont(new Font("Dialog", Font.BOLD, 15)); 80 | lblNewLabel.setBounds(41, 76, 92, 25); 81 | adminLogin.getContentPane().add(lblNewLabel); 82 | 83 | JLabel lblNewLabel_1 = new JLabel("Password"); 84 | lblNewLabel_1.setFont(new Font("Dialog", Font.BOLD, 15)); 85 | lblNewLabel_1.setHorizontalAlignment(SwingConstants.TRAILING); 86 | lblNewLabel_1.setBounds(30, 135, 92, 15); 87 | adminLogin.getContentPane().add(lblNewLabel_1); 88 | 89 | passwordField = new JPasswordField(); 90 | passwordField.setBounds(165, 130, 200, 30); 91 | adminLogin.getContentPane().add(passwordField); 92 | 93 | Username = new JTextField(); 94 | Username.setBounds(165, 72, 200, 30); 95 | adminLogin.getContentPane().add(Username); 96 | 97 | /* Disabling all the invalid inputs like special characters into the account number field*/ 98 | Username.addKeyListener(new KeyAdapter() { 99 | public void keyTyped(KeyEvent e) { 100 | char c = e.getKeyChar(); 101 | if ((c>=0 && c<=47) || (c>=58 && c<64) || (c>=91 && c<=96) || (c>122)) { 102 | e.consume(); 103 | } 104 | } 105 | }); 106 | 107 | Username.setColumns(10); 108 | 109 | JButton btnAdminLogin = new JButton("Login"); 110 | adminLogin.getRootPane().setDefaultButton(btnAdminLogin); //Sets default button as login button so that when we hit enter it automatically pops in 111 | 112 | btnAdminLogin.addActionListener(new ActionListener() { 113 | public void actionPerformed(ActionEvent arg0) { 114 | String username = Username.getText(); 115 | /* If account number input is too long */ 116 | if(username.length()>20) 117 | { 118 | JOptionPane.showMessageDialog(null, "Account number is too long","Invalid account number",JOptionPane.ERROR_MESSAGE); 119 | Username.setText(null); 120 | passwordField.setText(null); 121 | } 122 | String password = String.valueOf(passwordField.getPassword()); 123 | AdminBean admin = new AdminBean(); 124 | AdminDAO service = new AdminDAO(); 125 | admin.setUsername(username); 126 | admin.setPassword(password); 127 | try { 128 | int status = service.adminLogin(admin); 129 | if(status == 1) //Admin is already logged in from separate window 130 | { 131 | JOptionPane.showMessageDialog(null, "User is already logged in","Login Error",JOptionPane.ERROR_MESSAGE); 132 | Username.setText(null); 133 | passwordField.setText(null); 134 | } 135 | else if( status == 2 ) 136 | { 137 | adminLogin.setVisible(false); 138 | AdminWelcomeScreen.setAdmin(admin); 139 | AdminWelcomeScreen.setService(service); 140 | AdminWelcomeScreen.callAdminWelcomeScreen(); 141 | } 142 | else if((password.isBlank() || username.isBlank())) 143 | { 144 | SwingUtilities.updateComponentTreeUI(adminLogin); 145 | } 146 | else 147 | { 148 | JOptionPane.showMessageDialog(null, "Invalid Login Details","Login Error",JOptionPane.ERROR_MESSAGE); 149 | Username.setText(null); 150 | passwordField.setText(null); 151 | admin.setUsername(null); 152 | admin.setPassword(null); 153 | } 154 | } 155 | catch (Exception e) { 156 | try { 157 | throw new OOPDException("UI Error"+e); 158 | } catch (OOPDException e1) { 159 | // TODO Auto-generated catch block 160 | e1.printStackTrace(); 161 | } 162 | } 163 | } 164 | }); 165 | btnAdminLogin.setFont(new Font("Dialog", Font.BOLD, 15)); 166 | btnAdminLogin.setBounds(21, 220, 114, 25); 167 | adminLogin.getContentPane().add(btnAdminLogin); 168 | 169 | JButton btnClear = new JButton("Clear"); 170 | btnClear.addActionListener(new ActionListener() { 171 | public void actionPerformed(ActionEvent arg0) { 172 | Username.setText(null); 173 | passwordField.setText(null); 174 | } 175 | }); 176 | btnClear.setFont(new Font("Dialog", Font.BOLD, 15)); 177 | btnClear.setBounds(165, 220, 114, 25); 178 | adminLogin.getContentPane().add(btnClear); 179 | 180 | JButton btnExit = new JButton("Back"); 181 | btnExit.addActionListener(new ActionListener() { 182 | public void actionPerformed(ActionEvent arg0) { 183 | Home_Screen.main(null); 184 | adminLogin.setVisible(false); 185 | } 186 | }); 187 | btnExit.setFont(new Font("Dialog", Font.BOLD, 15)); 188 | btnExit.setBounds(310, 220, 114, 25); 189 | adminLogin.getContentPane().add(btnExit); 190 | } 191 | 192 | } 193 | -------------------------------------------------------------------------------- /src/main/java/com/demo/OOPD_Project/GUI/Deposit.java: -------------------------------------------------------------------------------- 1 | package com.demo.OOPD_Project.GUI; 2 | 3 | import java.awt.Dimension; 4 | import java.awt.EventQueue; 5 | import java.awt.Font; 6 | import java.awt.Toolkit; 7 | import java.awt.event.KeyAdapter; 8 | import java.awt.event.KeyEvent; 9 | 10 | import javax.swing.JFrame; 11 | import javax.swing.JLabel; 12 | import javax.swing.JOptionPane; 13 | import javax.swing.JTextField; 14 | 15 | import com.demo.OOPD_Project.Bean.AccountBean; 16 | import com.demo.OOPD_Project.Bean.AccountHolderBean; 17 | import com.demo.OOPD_Project.dao.AccountDAO; 18 | import com.demo.OOPD_Project.dao.AccountHolderDAO; 19 | import com.demo.OOPD_Project.dao.DepositDAO; 20 | import com.demo.OOPD_Project.exception.OOPDException; 21 | 22 | import javax.swing.JButton; 23 | import java.awt.event.ActionListener; 24 | import java.awt.event.ActionEvent; 25 | 26 | public class Deposit { 27 | 28 | private JFrame depositFrame; 29 | private static AccountHolderBean user; 30 | private static AccountHolderDAO service; 31 | private static AccountDAO account_service; 32 | private static AccountBean account; 33 | private DepositDAO dep = new DepositDAO(); 34 | private JTextField textField; 35 | 36 | public static void setUser(AccountHolderBean usr) 37 | { 38 | user = usr; 39 | } 40 | 41 | public static void setService(AccountHolderDAO s) 42 | { 43 | service = s; 44 | } 45 | 46 | public static void setAccountbean(AccountBean b) 47 | { 48 | account = b; 49 | } 50 | public static void setAccountService(AccountDAO d) 51 | { 52 | account_service = d; 53 | } 54 | 55 | /** 56 | * Launch the application. 57 | */ 58 | public static void CallDeposit() { 59 | EventQueue.invokeLater(new Runnable() { 60 | public void run() { 61 | try { 62 | Deposit window = new Deposit(); 63 | window.depositFrame.setVisible(true); 64 | Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize(); 65 | int x = (int) ((dimension.getWidth() - window.depositFrame.getWidth()) / 2); 66 | int y = (int) ((dimension.getHeight() - window.depositFrame.getWidth()) / 2); 67 | window.depositFrame.setLocation(x, y); 68 | } catch (Exception e) { 69 | e.printStackTrace(); 70 | } 71 | } 72 | }); 73 | } 74 | 75 | /** 76 | * Create the application. 77 | */ 78 | public Deposit() { 79 | initialize(); 80 | } 81 | 82 | /** 83 | * Initialize the contents of the frame. 84 | */ 85 | private void initialize() { 86 | depositFrame = new JFrame(); 87 | depositFrame.setBounds(1500, 900, 1200, 900); 88 | depositFrame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); 89 | depositFrame.getContentPane().setLayout(null); 90 | 91 | /* If user tries to cancel the screen directly we will log them out */ 92 | depositFrame.addWindowListener(new java.awt.event.WindowAdapter() { 93 | @Override 94 | public void windowClosing(java.awt.event.WindowEvent windowEvent) { 95 | if (JOptionPane.showConfirmDialog(depositFrame, 96 | "Are you sure you want to close this window?\n You will be logged out", "Close Window?", 97 | JOptionPane.YES_NO_OPTION, 98 | JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION){ 99 | try { 100 | service.ClientLogout(user); 101 | } catch (OOPDException e) { 102 | // TODO Auto-generated catch block 103 | e.printStackTrace(); 104 | } 105 | System.exit(0); 106 | } 107 | } 108 | }); 109 | 110 | JLabel lblCurrentBalance = new JLabel("Current Balance :"); 111 | lblCurrentBalance.setBounds(20, 20, 130, 15); 112 | depositFrame.getContentPane().add(lblCurrentBalance); 113 | 114 | JLabel lblNewLabel = new JLabel(Double.toString(account.getBalance())); 115 | lblNewLabel.setBounds(150, 20, 500, 15); 116 | depositFrame.getContentPane().add(lblNewLabel); 117 | 118 | textField = new JTextField(); 119 | textField.setBounds(500, 169, 200, 30); 120 | depositFrame.getContentPane().add(textField); 121 | textField.setColumns(10); 122 | 123 | JLabel lblEnterAmount = new JLabel("Enter Amount"); 124 | lblEnterAmount.setFont(new Font("Dialog", Font.BOLD, 15)); 125 | lblEnterAmount.setBounds(320, 169, 150, 30); 126 | depositFrame.getContentPane().add(lblEnterAmount); 127 | 128 | JButton btnDeposit = new JButton("Deposit"); 129 | btnDeposit.addActionListener(new ActionListener() { 130 | public void actionPerformed(ActionEvent arg0) { 131 | try { 132 | int status = dep.doDepsit(account, Double.parseDouble(textField.getText())); 133 | if(status == 0) 134 | { 135 | JOptionPane.showMessageDialog(null, "Transaction failed","Error",JOptionPane.ERROR_MESSAGE); 136 | } 137 | else if(status == 1) 138 | { 139 | JOptionPane.showMessageDialog(null, "You cannot have more than 50 lakhs in your account","Error",JOptionPane.ERROR_MESSAGE); 140 | } 141 | else if(status == 2) 142 | { 143 | JOptionPane.showMessageDialog(null, "Amount cannot be negative","Error",JOptionPane.ERROR_MESSAGE); 144 | } 145 | else if(status == 3) 146 | { 147 | depositFrame.setVisible(false); 148 | Welcome_user.callUserWelcomeScreen(); 149 | Welcome_user.setAccount(account); 150 | Welcome_user.setAccountService(account_service); 151 | Welcome_user.setService(service); 152 | Welcome_user.setUser(user); 153 | } 154 | } catch (NumberFormatException e) { 155 | // TODO Auto-generated catch block 156 | e.printStackTrace(); 157 | } catch (OOPDException e) { 158 | // TODO Auto-generated catch block 159 | e.printStackTrace(); 160 | } 161 | } 162 | }); 163 | btnDeposit.setBounds(427, 230, 120, 25); 164 | depositFrame.getContentPane().add(btnDeposit); 165 | 166 | JButton btnBack = new JButton("Back"); 167 | btnBack.addActionListener(new ActionListener() { 168 | public void actionPerformed(ActionEvent arg0) { 169 | Welcome_user.callUserWelcomeScreen(); 170 | Welcome_user.setAccount(account); 171 | Welcome_user.setAccountService(account_service); 172 | Welcome_user.setService(service); 173 | Welcome_user.setUser(user); 174 | depositFrame.setVisible(false); 175 | } 176 | }); 177 | btnBack.setBounds(594, 230, 114, 25); 178 | depositFrame.getContentPane().add(btnBack); 179 | 180 | /* Disabling all the invalid inputs like special characters into the First Name field*/ 181 | textField.addKeyListener(new KeyAdapter() { 182 | public void keyTyped(KeyEvent e) { 183 | char c = e.getKeyChar(); 184 | if (c<48 || c>57) { 185 | e.consume(); 186 | } 187 | } 188 | }); 189 | 190 | } 191 | } 192 | -------------------------------------------------------------------------------- /src/main/java/com/demo/OOPD_Project/GUI/Home_Screen.java: -------------------------------------------------------------------------------- 1 | package com.demo.OOPD_Project.GUI; 2 | 3 | import java.awt.Component; 4 | 5 | import java.awt.Dimension; 6 | import java.awt.EventQueue; 7 | 8 | import javax.swing.JFrame; 9 | import javax.swing.JButton; 10 | import java.awt.event.ActionListener; 11 | import java.awt.event.ActionEvent; 12 | import javax.swing.JLabel; 13 | import javax.swing.JOptionPane; 14 | 15 | import java.awt.Font; 16 | import java.awt.Toolkit; 17 | 18 | /* 19 | * This is the home-screen for the application 20 | */ 21 | public class Home_Screen { 22 | 23 | private JFrame home_screen; 24 | 25 | /** 26 | * Launch the application. 27 | */ 28 | public static void main(String[] args) { 29 | EventQueue.invokeLater(new Runnable() { 30 | public void run() { 31 | try { 32 | Home_Screen window = new Home_Screen(); 33 | window.home_screen.setVisible(true); 34 | Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize(); 35 | int x = (int) ((dimension.getWidth() - window.home_screen.getWidth()) / 2); 36 | int y = (int) ((dimension.getHeight() - window.home_screen.getWidth()) / 2); 37 | window.home_screen.setLocation(x, y); 38 | } catch (Exception e) { 39 | e.printStackTrace(); 40 | } 41 | } 42 | }); 43 | } 44 | 45 | /** 46 | * Create the application. 47 | */ 48 | public Home_Screen() { 49 | initialize(); 50 | } 51 | 52 | /** 53 | * Initialize the contents of the frame. 54 | */ 55 | private void initialize() { 56 | home_screen = new JFrame(); 57 | home_screen.setBounds(700, 700, 700, 300); 58 | home_screen.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 59 | home_screen.getContentPane().setLayout(null); 60 | 61 | JButton btnAdmin = new JButton("Admin"); 62 | btnAdmin.addActionListener(new ActionListener() { 63 | public void actionPerformed(ActionEvent arg0) { 64 | Admin_Login.callAdminLogin(); 65 | home_screen.setVisible(false); 66 | } 67 | }); 68 | btnAdmin.setBounds(20, 125, 169, 31); 69 | home_screen.getContentPane().add(btnAdmin); 70 | 71 | JButton btnAccountHolder = new JButton("Account Holder"); 72 | btnAccountHolder.addActionListener(new ActionListener() { 73 | public void actionPerformed(ActionEvent arg0) { 74 | Login_Screen_Client.callUserLogin(); 75 | home_screen.setVisible(false); 76 | 77 | } 78 | }); 79 | btnAccountHolder.setBounds(250, 125, 180, 31); 80 | home_screen.getContentPane().add(btnAccountHolder); 81 | 82 | JLabel lblLoginAs = new JLabel("LOGIN AS"); 83 | lblLoginAs.setFont(new Font("Dialog", Font.BOLD, 23)); 84 | lblLoginAs.setBounds(260, 39, 157, 25); 85 | home_screen.getContentPane().add(lblLoginAs); 86 | 87 | JButton btnNewButton = new JButton("Exit"); 88 | btnNewButton.addActionListener(new ActionListener() { 89 | public void actionPerformed(ActionEvent arg0) { 90 | Component frmLoginSystem = new JFrame("Exit"); 91 | if(JOptionPane.showConfirmDialog(frmLoginSystem, "Confirm if you want to exit","Banking System",JOptionPane.YES_NO_OPTION)==JOptionPane.YES_NO_OPTION) { 92 | System.exit(0); 93 | } 94 | } 95 | }); 96 | btnNewButton.setBounds(270, 190, 114, 35); 97 | home_screen.getContentPane().add(btnNewButton); 98 | 99 | JButton btnNewButton_1 = new JButton("Sign Up "); 100 | btnNewButton_1.addActionListener(new ActionListener() { 101 | public void actionPerformed(ActionEvent arg0) { 102 | SignUp.CallSignUp(); 103 | home_screen.setVisible(false); 104 | } 105 | }); 106 | btnNewButton_1.setBounds(500, 125, 169, 31); 107 | home_screen.getContentPane().add(btnNewButton_1); 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /src/main/java/com/demo/OOPD_Project/GUI/Login_Screen_Client.java: -------------------------------------------------------------------------------- 1 | package com.demo.OOPD_Project.GUI; 2 | 3 | import java.awt.Color; 4 | import java.awt.Dimension; 5 | import java.awt.EventQueue; 6 | import java.awt.Font; 7 | import java.awt.Toolkit; 8 | import java.awt.event.ActionEvent; 9 | import java.awt.event.ActionListener; 10 | import java.awt.event.KeyAdapter; 11 | import java.awt.event.KeyEvent; 12 | 13 | import javax.swing.JButton; 14 | import javax.swing.JFrame; 15 | import javax.swing.JLabel; 16 | import javax.swing.JOptionPane; 17 | import javax.swing.JPasswordField; 18 | import javax.swing.JSeparator; 19 | import javax.swing.JTextField; 20 | import javax.swing.SwingUtilities; 21 | 22 | import com.demo.OOPD_Project.Bean.AccountBean; 23 | import com.demo.OOPD_Project.Bean.AccountHolderBean; 24 | import com.demo.OOPD_Project.dao.*; 25 | import com.demo.OOPD_Project.exception.OOPDException; 26 | /* 27 | * This class provides the login UI for users/clients of the bank 28 | */ 29 | 30 | public class Login_Screen_Client { 31 | 32 | private JFrame user_login; 33 | private JTextField account_number; 34 | private JPasswordField passwordField; 35 | 36 | /** 37 | * Launch the application. 38 | */ 39 | 40 | public static void callUserLogin() { 41 | EventQueue.invokeLater(new Runnable() { 42 | public void run() { 43 | try { 44 | Login_Screen_Client window = new Login_Screen_Client(); 45 | window.user_login.setVisible(true); 46 | Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize(); 47 | int x = (int) ((dimension.getWidth() - window.user_login.getWidth()) / 2); 48 | int y = (int) ((dimension.getHeight() - window.user_login.getWidth()) / 2); 49 | window.user_login.setLocation(x, y); 50 | } catch (Exception e) { 51 | e.printStackTrace(); 52 | } 53 | } 54 | }); 55 | } 56 | 57 | /** 58 | * Create the application. 59 | */ 60 | public Login_Screen_Client() throws OOPDException { 61 | initialize(); 62 | } 63 | 64 | /** 65 | * Initialize the contents of the frame. 66 | */ 67 | private void initialize() throws OOPDException { 68 | user_login = new JFrame(); 69 | user_login.getContentPane().setBackground(Color.GRAY); 70 | user_login.setBounds(100, 100, 450, 300); 71 | user_login.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 72 | user_login.getContentPane().setLayout(null); 73 | JLabel lblLogin = new JLabel("Login"); 74 | lblLogin.setFont(new Font("Dialog", Font.BOLD, 24)); 75 | lblLogin.setBounds(170, 12, 108, 31); 76 | user_login.getContentPane().add(lblLogin); 77 | JLabel lblAccountNumber = new JLabel("Account Number"); 78 | lblAccountNumber.setFont(new Font("Dialog", Font.BOLD, 15)); 79 | lblAccountNumber.setBounds(25, 69, 148, 40); 80 | user_login.getContentPane().add(lblAccountNumber); 81 | 82 | JLabel lblPassword = new JLabel("Password"); 83 | lblPassword.setFont(new Font("Dialog", Font.BOLD, 15)); 84 | lblPassword.setBounds(25, 130, 87, 25); 85 | user_login.getContentPane().add(lblPassword); 86 | account_number = new JTextField(); 87 | 88 | /* Disabling all the invalid inputs like special characters into the account number field*/ 89 | account_number.addKeyListener(new KeyAdapter() { 90 | public void keyTyped(KeyEvent e) { 91 | char c = e.getKeyChar(); 92 | if ((c>=0 && c<=47) || (c>=58 && c<=64) || (c>=91 && c<=96) || (c>122)) { 93 | e.consume(); 94 | } 95 | } 96 | }); 97 | account_number.setBounds(204, 73, 169, 31); 98 | user_login.getContentPane().add(account_number); 99 | account_number.setColumns(10); 100 | 101 | JButton btnLogin = new JButton("Login"); 102 | user_login.getRootPane().setDefaultButton(btnLogin); //Sets default button as login button so that when we hit enter it automatically pops in 103 | btnLogin.addActionListener(new ActionListener() { 104 | public void actionPerformed(ActionEvent arg0) { 105 | String username = account_number.getText(); 106 | /* If account number input is too long */ 107 | if(username.length()>20) 108 | { 109 | JOptionPane.showMessageDialog(null, "Account number is too long","Invalid account number",JOptionPane.ERROR_MESSAGE); 110 | account_number.setText(null); 111 | passwordField.setText(null); 112 | } 113 | String password = String.valueOf(passwordField.getPassword()); 114 | AccountHolderBean client = new AccountHolderBean(); 115 | AccountHolderDAO service = new AccountHolderDAO(); 116 | AccountBean account = new AccountBean(); 117 | AccountDAO service_acc = new AccountDAO(); 118 | client.setAccountNumber(username); 119 | client.setPassword(password); 120 | try { 121 | int status = service.ClientLogin(client); 122 | if(status == 1) 123 | { 124 | JOptionPane.showMessageDialog(null, "User is already logged in","Login Error",JOptionPane.ERROR_MESSAGE); 125 | account_number.setText(null); 126 | passwordField.setText(null); 127 | } 128 | else if( status == 2 ) 129 | { 130 | account.setCustomer(client); 131 | service_acc.getBalanceFromDB(account); 132 | user_login.setVisible(false); 133 | Welcome_user.setUser(client); 134 | Welcome_user.setService(service); 135 | Welcome_user.setAccount(account); 136 | Welcome_user.callUserWelcomeScreen(); 137 | } 138 | else if((password.isBlank() || username.isBlank())) 139 | { 140 | SwingUtilities.updateComponentTreeUI(user_login); 141 | } 142 | else 143 | { 144 | JOptionPane.showMessageDialog(null, "Invalid Login Details","Login Error",JOptionPane.ERROR_MESSAGE); 145 | account_number.setText(null); 146 | passwordField.setText(null); 147 | client.setAccountNumber(null); 148 | client.setPassword(null); 149 | } 150 | } 151 | catch (Exception e) { 152 | try { 153 | throw new OOPDException("UI Error"+e); 154 | } catch (OOPDException e1) { 155 | // TODO Auto-generated catch block 156 | e1.printStackTrace(); 157 | } 158 | } 159 | } 160 | }); 161 | btnLogin.setBounds(20, 202, 114, 30); 162 | user_login.getContentPane().add(btnLogin); 163 | 164 | JButton btnClear = new JButton("Reset"); 165 | btnClear.addActionListener(new ActionListener() { 166 | public void actionPerformed(ActionEvent arg0) { 167 | account_number.setText(null); 168 | passwordField.setText(null); 169 | } 170 | }); 171 | btnClear.setBounds(168, 202, 114, 30); 172 | user_login.getContentPane().add(btnClear); 173 | 174 | JButton btnExit = new JButton("Back"); 175 | btnExit.addActionListener(new ActionListener() { 176 | public void actionPerformed(ActionEvent arg0) { 177 | Home_Screen.main(null); 178 | user_login.setVisible(false); 179 | } 180 | }); 181 | btnExit.setBounds(314, 202, 114, 30); 182 | user_login.getContentPane().add(btnExit); 183 | 184 | passwordField = new JPasswordField(); 185 | 186 | /* Disabling all space as input in password*/ 187 | passwordField.addKeyListener(new KeyAdapter() { 188 | public void keyTyped(KeyEvent e) { 189 | char c = e.getKeyChar(); 190 | if (c==127 || c==32) { 191 | e.consume(); 192 | } 193 | } 194 | }); 195 | passwordField.setBounds(204, 125, 169, 31); 196 | user_login.getContentPane().add(passwordField); 197 | 198 | JSeparator separator = new JSeparator(); 199 | separator.setBounds(23, 170, 400, 2); 200 | user_login.getContentPane().add(separator); 201 | 202 | JSeparator separator_1 = new JSeparator(); 203 | separator_1.setBounds(20, 50, 400, 2); 204 | user_login.getContentPane().add(separator_1); 205 | } 206 | } 207 | -------------------------------------------------------------------------------- /src/main/java/com/demo/OOPD_Project/GUI/ShowReportGUI.java: -------------------------------------------------------------------------------- 1 | package com.demo.OOPD_Project.GUI; 2 | 3 | import java.awt.Dimension; 4 | import java.awt.EventQueue; 5 | import java.awt.Toolkit; 6 | 7 | import javax.swing.JFrame; 8 | import javax.swing.JLabel; 9 | import javax.swing.JOptionPane; 10 | 11 | import java.awt.Font; 12 | import javax.swing.JTextField; 13 | 14 | import com.demo.OOPD_Project.Bean.AdminBean; 15 | import com.demo.OOPD_Project.dao.AdminDAO; 16 | import com.demo.OOPD_Project.exception.OOPDException; 17 | 18 | import javax.swing.JButton; 19 | import java.awt.event.ActionListener; 20 | import java.awt.event.ActionEvent; 21 | 22 | public class ShowReportGUI { 23 | 24 | private JFrame showReport; 25 | private JTextField textField; 26 | private static AdminBean admin; 27 | private static AdminDAO service; 28 | private JButton btnShow; 29 | 30 | public static void setAdmin(AdminBean a) 31 | { 32 | admin = a; 33 | } 34 | public static void setService(AdminDAO s) 35 | { 36 | service = s; 37 | } 38 | /** 39 | * Launch the application. 40 | */ 41 | public static void callShowReport() { 42 | EventQueue.invokeLater(new Runnable() { 43 | public void run() { 44 | try { 45 | ShowReportGUI window = new ShowReportGUI(); 46 | Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize(); 47 | int x = (int) ((dimension.getWidth() - window.showReport.getWidth()) / 2); 48 | int y = (int) ((dimension.getHeight() - window.showReport.getWidth()) / 2); 49 | window.showReport.setLocation(x, y); 50 | window.showReport.setVisible(true); 51 | } catch (Exception e) { 52 | e.printStackTrace(); 53 | } 54 | } 55 | }); 56 | } 57 | 58 | /** 59 | * Create the application. 60 | */ 61 | public ShowReportGUI() { 62 | initialize(); 63 | } 64 | 65 | /** 66 | * Initialize the contents of the frame. 67 | */ 68 | private void initialize() { 69 | showReport = new JFrame(); 70 | showReport.setBounds(1500, 900, 1200, 900); 71 | showReport.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); 72 | showReport.getContentPane().setLayout(null); 73 | 74 | showReport.addWindowListener(new java.awt.event.WindowAdapter() { 75 | @Override 76 | public void windowClosing(java.awt.event.WindowEvent windowEvent) { 77 | if (JOptionPane.showConfirmDialog(showReport, 78 | "Are you sure you want to close this window?\n You will be logged out", "Close Window?", 79 | JOptionPane.YES_NO_OPTION, 80 | JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION){ 81 | try { 82 | service.adminLogout(admin); 83 | System.exit(0); 84 | } catch (OOPDException e) { 85 | // TODO Auto-generated catch block 86 | e.printStackTrace(); 87 | } 88 | System.exit(0); 89 | } 90 | } 91 | }); 92 | 93 | JLabel lblEnterAccountNumber = new JLabel("Enter Account Number"); 94 | lblEnterAccountNumber.setFont(new Font("Dialog", Font.BOLD, 19)); 95 | lblEnterAccountNumber.setBounds(257, 419, 270, 15); 96 | showReport.getContentPane().add(lblEnterAccountNumber); 97 | 98 | textField = new JTextField(); 99 | textField.setBounds(537, 410, 300, 35); 100 | showReport.getContentPane().add(textField); 101 | textField.setColumns(10); 102 | 103 | JButton btnButton = new JButton("Back"); 104 | btnButton.addActionListener(new ActionListener() { 105 | public void actionPerformed(ActionEvent arg0) { 106 | AdminWelcomeScreen.setAdmin(admin); 107 | AdminWelcomeScreen.setService(service); 108 | AdminWelcomeScreen.callAdminWelcomeScreen(); 109 | showReport.setVisible(false); 110 | } 111 | }); 112 | btnButton.setBounds(640, 496, 114, 35); 113 | showReport.getContentPane().add(btnButton); 114 | 115 | btnShow = new JButton("Show"); 116 | btnShow.addActionListener(new ActionListener() { 117 | public void actionPerformed(ActionEvent arg0) { 118 | try { 119 | report.setData(service.showReport(textField.getText())); 120 | report.callreport(); 121 | } catch (OOPDException e) { 122 | // TODO Auto-generated catch block 123 | e.printStackTrace(); 124 | } 125 | 126 | } 127 | }); 128 | btnShow.setBounds(456, 496, 114, 35); 129 | showReport.getContentPane().add(btnShow); 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /src/main/java/com/demo/OOPD_Project/GUI/SignUp.java: -------------------------------------------------------------------------------- 1 | package com.demo.OOPD_Project.GUI; 2 | 3 | import java.awt.Dimension; 4 | import java.awt.EventQueue; 5 | 6 | import javax.swing.JFrame; 7 | import javax.swing.JLabel; 8 | import javax.swing.JOptionPane; 9 | 10 | import java.awt.Font; 11 | import java.awt.Toolkit; 12 | 13 | import javax.swing.JTextField; 14 | import javax.swing.SwingUtilities; 15 | 16 | import com.demo.OOPD_Project.Bean.AccountHolderBean; 17 | import com.demo.OOPD_Project.dao.AccountHolderDAO; 18 | import com.demo.OOPD_Project.exception.OOPDException; 19 | 20 | import javax.swing.JButton; 21 | import javax.swing.JPasswordField; 22 | import java.awt.event.ActionListener; 23 | import java.awt.event.KeyAdapter; 24 | import java.awt.event.KeyEvent; 25 | import java.awt.event.ActionEvent; 26 | 27 | public class SignUp { 28 | 29 | private JFrame SignUpFrame; 30 | private JTextField txtFirstName; 31 | private JTextField txtLastName; 32 | private JLabel lblLastName; 33 | private JLabel lblPassword; 34 | private JLabel lblConfirmPassword; 35 | private JButton btnNewButton; 36 | private JPasswordField passwordField; 37 | private JPasswordField passwordField_1; 38 | private AccountHolderBean client = new AccountHolderBean(); 39 | private AccountHolderDAO service = new AccountHolderDAO(); 40 | private JLabel hidelbl1; 41 | private JLabel hidelbl2; 42 | private JLabel hidelblAccountNumber; 43 | private JLabel hidelbl3; 44 | private JButton btnLogin; 45 | 46 | /** 47 | * Launch the application. 48 | */ 49 | public static void CallSignUp() { 50 | EventQueue.invokeLater(new Runnable() { 51 | public void run() { 52 | try { 53 | SignUp window = new SignUp(); 54 | window.SignUpFrame.setVisible(true); 55 | Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize(); 56 | int x = (int) ((dimension.getWidth() - window.SignUpFrame.getWidth()) / 2); 57 | int y = (int) ((dimension.getHeight() - window.SignUpFrame.getWidth()) / 2); 58 | window.SignUpFrame.setLocation(x, y); 59 | } catch (Exception e) { 60 | e.printStackTrace(); 61 | } 62 | } 63 | }); 64 | } 65 | 66 | /** 67 | * Create the application. 68 | */ 69 | public SignUp() { 70 | initialize(); 71 | } 72 | 73 | /** 74 | * Initialize the contents of the frame. 75 | */ 76 | private void initialize() { 77 | SignUpFrame = new JFrame(); 78 | SignUpFrame.setBounds(1500, 900, 1200, 900); 79 | SignUpFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 80 | SignUpFrame.getContentPane().setLayout(null); 81 | 82 | final JLabel lblNewLabel = new JLabel("Sign Up"); 83 | lblNewLabel.setFont(new Font("Dialog", Font.BOLD, 15)); 84 | lblNewLabel.setBounds(500, 12, 66, 15); 85 | SignUpFrame.getContentPane().add(lblNewLabel); 86 | 87 | final JLabel lblName = new JLabel("First Name"); 88 | lblName.setFont(new Font("Dialog", Font.BOLD, 15)); 89 | lblName.setBounds(100, 100, 100, 30); 90 | SignUpFrame.getContentPane().add(lblName); 91 | 92 | txtFirstName = new JTextField(); 93 | txtFirstName.setBounds(280, 100, 300, 30); 94 | SignUpFrame.getContentPane().add(txtFirstName); 95 | txtFirstName.setColumns(10); 96 | 97 | /* Disabling all the invalid inputs like special characters into the First Name field*/ 98 | txtFirstName.addKeyListener(new KeyAdapter() { 99 | public void keyTyped(KeyEvent e) { 100 | char c = e.getKeyChar(); 101 | if (c<65 || (c>90 && c<97) || c>122) { 102 | e.consume(); 103 | } 104 | } 105 | }); 106 | 107 | txtLastName = new JTextField(); 108 | txtLastName.setBounds(280, 170, 300, 30); 109 | SignUpFrame.getContentPane().add(txtLastName); 110 | txtLastName.setColumns(10); 111 | 112 | lblLastName = new JLabel("Last Name"); 113 | lblLastName.setFont(new Font("Dialog", Font.BOLD, 15)); 114 | lblLastName.setBounds(100, 169, 100, 30); 115 | SignUpFrame.getContentPane().add(lblLastName); 116 | 117 | /* Disabling all the invalid inputs like special characters into the Last name field*/ 118 | txtLastName.addKeyListener(new KeyAdapter() { 119 | public void keyTyped(KeyEvent e) { 120 | char c = e.getKeyChar(); 121 | if (c<65 || (c>90 && c<97) || c>122) { 122 | e.consume(); 123 | } 124 | } 125 | }); 126 | 127 | lblPassword = new JLabel("Password"); 128 | lblPassword.setFont(new Font("Dialog", Font.BOLD, 15)); 129 | lblPassword.setBounds(100, 238, 100, 30); 130 | SignUpFrame.getContentPane().add(lblPassword); 131 | 132 | lblConfirmPassword = new JLabel("Confirm Password"); 133 | lblConfirmPassword.setFont(new Font("Dialog", Font.BOLD, 15)); 134 | lblConfirmPassword.setBounds(100, 310, 200, 30); 135 | SignUpFrame.getContentPane().add(lblConfirmPassword); 136 | 137 | btnNewButton = new JButton("Sign Up"); 138 | SignUpFrame.getRootPane().setDefaultButton(btnNewButton); //Sets default button as SingUp button so that when we hit enter it automatically pops in 139 | btnNewButton.addActionListener(new ActionListener() { 140 | public void actionPerformed(ActionEvent arg0) { 141 | String fname = txtFirstName.getText(); 142 | String lname = txtLastName.getText(); 143 | String password = String.valueOf(passwordField.getPassword()); 144 | String confirm_password = String.valueOf(passwordField_1.getPassword()); 145 | if(fname.length()>40 || lname.length()>40) 146 | { 147 | JOptionPane.showMessageDialog(null, "Name cannot be greater than 40 characters","Invalid name",JOptionPane.ERROR_MESSAGE); 148 | txtFirstName.setText(null); 149 | txtLastName.setText(null); 150 | passwordField.setText(null); 151 | passwordField_1.setText(null); 152 | } 153 | else if(fname.isBlank() || lname.isBlank() || password.isBlank() || confirm_password.isBlank()) 154 | SwingUtilities.updateComponentTreeUI(SignUpFrame); 155 | else if(!password.equals(confirm_password)) 156 | { 157 | JOptionPane.showMessageDialog(null, "Password and Confirm password not matching","Invalid passwords",JOptionPane.ERROR_MESSAGE); 158 | passwordField.setText(null); 159 | passwordField_1.setText(null); 160 | } 161 | else if(password.length()<8) 162 | { 163 | JOptionPane.showMessageDialog(null, "Password should be of 8 character or more","Invalid passwords",JOptionPane.ERROR_MESSAGE); 164 | passwordField.setText(null); 165 | passwordField_1.setText(null); 166 | } 167 | else 168 | { 169 | client.setFname(fname); 170 | client.setLname(lname); 171 | client.setPassword(password); 172 | try { 173 | service.addClient(client); 174 | } catch (OOPDException e) { 175 | // TODO Auto-generated catch block 176 | e.printStackTrace(); 177 | } 178 | hidelbl1.setVisible(true); 179 | hidelbl2.setVisible(true); 180 | hidelbl3.setVisible(true); 181 | btnLogin.setVisible(true); 182 | lblName.setVisible(false); 183 | lblNewLabel.setVisible(false); 184 | lblConfirmPassword.setVisible(false); 185 | lblLastName.setVisible(false); 186 | lblPassword.setVisible(false); 187 | btnNewButton.setVisible(false); 188 | hidelblAccountNumber.setText(client.getAccountNumber()); 189 | hidelblAccountNumber.setVisible(true); 190 | txtFirstName.setVisible(false); 191 | txtLastName.setVisible(false); 192 | passwordField.setVisible(false); 193 | passwordField_1.setVisible(false); 194 | System.out.println("registration done"); 195 | } 196 | } 197 | }); 198 | btnNewButton.setBounds(261, 389, 114, 25); 199 | SignUpFrame.getContentPane().add(btnNewButton); 200 | 201 | passwordField = new JPasswordField(); 202 | passwordField.setBounds(280, 240, 300, 30); 203 | SignUpFrame.getContentPane().add(passwordField); 204 | 205 | /* Disabling all the invalid inputs like special characters into the First Name field*/ 206 | passwordField.addKeyListener(new KeyAdapter() { 207 | public void keyTyped(KeyEvent e) { 208 | char c = e.getKeyChar(); 209 | if (c==32 || c==127 || c==9) { 210 | e.consume(); 211 | } 212 | } 213 | }); 214 | 215 | 216 | passwordField_1 = new JPasswordField(); 217 | passwordField_1.setBounds(280, 310, 300, 30); 218 | SignUpFrame.getContentPane().add(passwordField_1); 219 | 220 | /* Disabling all the invalid inputs like special characters into the First Name field*/ 221 | passwordField_1.addKeyListener(new KeyAdapter() { 222 | public void keyTyped(KeyEvent e) { 223 | char c = e.getKeyChar(); 224 | if (c==32 || c==127 || c==9) { 225 | e.consume(); 226 | } 227 | } 228 | }); 229 | 230 | hidelbl1 = new JLabel("Thankyou For registring!"); 231 | hidelbl1.setFont(new Font("Dialog", Font.BOLD, 16)); 232 | hidelbl1.setBounds(450, 53, 250, 15); 233 | SignUpFrame.getContentPane().add(hidelbl1); 234 | hidelbl1.setVisible(false); 235 | 236 | hidelbl2 = new JLabel("Your Account number is :"); 237 | hidelbl2.setFont(new Font("Dialog", Font.BOLD, 15)); 238 | hidelbl2.setBounds(350, 142, 230, 15); 239 | SignUpFrame.getContentPane().add(hidelbl2); 240 | hidelbl2.setVisible(false); 241 | 242 | hidelblAccountNumber = new JLabel("n"); 243 | hidelblAccountNumber.setFont(new Font("Dialog", Font.BOLD, 15)); 244 | hidelblAccountNumber.setBounds(610, 142, 150, 15); 245 | SignUpFrame.getContentPane().add(hidelblAccountNumber); 246 | hidelblAccountNumber.setVisible(false); 247 | 248 | hidelbl3 = new JLabel("Please note it down this will be your username as well"); 249 | hidelbl3.setFont(new Font("Dialog", Font.BOLD, 15)); 250 | hidelbl3.setBounds(300, 196, 500, 35); 251 | SignUpFrame.getContentPane().add(hidelbl3); 252 | 253 | btnLogin = new JButton("Login"); 254 | btnLogin.addActionListener(new ActionListener() { 255 | public void actionPerformed(ActionEvent arg0) { 256 | Login_Screen_Client.callUserLogin(); 257 | SignUpFrame.setVisible(false); 258 | } 259 | }); 260 | btnLogin.setBounds(429, 389, 114, 25); 261 | SignUpFrame.getContentPane().add(btnLogin); 262 | hidelbl3.setVisible(false); 263 | } 264 | } 265 | -------------------------------------------------------------------------------- /src/main/java/com/demo/OOPD_Project/GUI/Welcome_user.java: -------------------------------------------------------------------------------- 1 | package com.demo.OOPD_Project.GUI; 2 | 3 | import java.awt.Dimension; 4 | import java.awt.EventQueue; 5 | import java.awt.Toolkit; 6 | 7 | import javax.swing.JFrame; 8 | import javax.swing.JButton; 9 | import java.awt.event.ActionListener; 10 | import java.awt.event.ActionEvent; 11 | import java.awt.Component; 12 | 13 | import javax.swing.JLabel; 14 | import javax.swing.JOptionPane; 15 | 16 | import com.demo.OOPD_Project.Bean.AccountBean; 17 | import com.demo.OOPD_Project.Bean.AccountHolderBean; 18 | import com.demo.OOPD_Project.dao.AccountDAO; 19 | import com.demo.OOPD_Project.dao.AccountHolderDAO; 20 | import com.demo.OOPD_Project.exception.OOPDException; 21 | /* 22 | * This will be the first interface user will see after the login 23 | */ 24 | public class Welcome_user { 25 | 26 | private JFrame userScreen; 27 | private static AccountHolderBean userbean; 28 | private static AccountHolderDAO service; 29 | private static AccountBean account; 30 | private static AccountDAO account_service; 31 | 32 | public static void setUser(AccountHolderBean client) 33 | { 34 | userbean = client; 35 | } 36 | public static void setService(AccountHolderDAO dao) 37 | { 38 | service = dao; 39 | } 40 | public static void setAccount(AccountBean a) 41 | { 42 | account = a; 43 | } 44 | public static void setAccountService(AccountDAO b) 45 | { 46 | account_service = b; 47 | } 48 | /** 49 | * Launch the application. 50 | */ 51 | public static void callUserWelcomeScreen() { 52 | EventQueue.invokeLater(new Runnable() { 53 | public void run() { 54 | try { 55 | Welcome_user window = new Welcome_user(); 56 | window.userScreen.setVisible(true); 57 | Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize(); 58 | int x = (int) ((dimension.getWidth() - window.userScreen.getWidth()) / 2); 59 | int y = (int) ((dimension.getHeight() - window.userScreen.getWidth()) / 2); 60 | window.userScreen.setLocation(x, y); 61 | } catch (Exception e) { 62 | e.printStackTrace(); 63 | } 64 | } 65 | }); 66 | } 67 | 68 | /** 69 | * Create the application. 70 | * @throws OOPDException 71 | */ 72 | public Welcome_user() throws OOPDException { 73 | initialize(); 74 | } 75 | 76 | /** 77 | * Initialize the contents of the frame. 78 | * @throws OOPDException 79 | */ 80 | private void initialize() throws OOPDException { 81 | userScreen = new JFrame(); 82 | userScreen.setBounds(1500, 900, 1200, 900); 83 | userScreen.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); 84 | userScreen.getContentPane().setLayout(null); 85 | 86 | /* If user tries to cancel the screen directly we will log them out */ 87 | userScreen.addWindowListener(new java.awt.event.WindowAdapter() { 88 | @Override 89 | public void windowClosing(java.awt.event.WindowEvent windowEvent) { 90 | if (JOptionPane.showConfirmDialog(userScreen, 91 | "Are you sure you want to close this window?\n You will be logged out", "Close Window?", 92 | JOptionPane.YES_NO_OPTION, 93 | JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION){ 94 | try { 95 | service.ClientLogout(userbean); 96 | } catch (OOPDException e) { 97 | // TODO Auto-generated catch block 98 | e.printStackTrace(); 99 | } 100 | System.exit(0); 101 | } 102 | } 103 | }); 104 | 105 | 106 | JButton btnLogout = new JButton("Logout"); 107 | btnLogout.addActionListener(new ActionListener() { 108 | public void actionPerformed(ActionEvent arg0) { 109 | Component frmLoginSystem = new JFrame("Exit"); 110 | if(JOptionPane.showConfirmDialog(frmLoginSystem, "Confirm if you want to Logout","Logout Alert",JOptionPane.YES_NO_OPTION)==JOptionPane.YES_NO_OPTION) { 111 | Home_Screen.main(null); 112 | userScreen.setVisible(false); 113 | try { 114 | service.ClientLogout(userbean); 115 | } catch (OOPDException e) { 116 | // TODO Auto-generated catch block 117 | e.printStackTrace(); 118 | } 119 | 120 | } 121 | } 122 | }); 123 | btnLogout.setBounds(430, 200, 114, 25); 124 | userScreen.getContentPane().add(btnLogout); 125 | 126 | JLabel lblWelcome = new JLabel("Welcome"); 127 | lblWelcome.setBounds(30, 12, 66, 15); 128 | userScreen.getContentPane().add(lblWelcome); 129 | 130 | JLabel NameLable = new JLabel(""); 131 | NameLable.setBounds(95, 12, 200, 15); 132 | userScreen.getContentPane().add(NameLable); 133 | NameLable.setText(userbean.getFname()+" "+userbean.getLname()); 134 | 135 | JLabel lblAccountNumber = new JLabel("Account number :"); 136 | lblAccountNumber.setBounds(30, 32, 142, 15); 137 | userScreen.getContentPane().add(lblAccountNumber); 138 | 139 | JLabel lblNewLabel = new JLabel(userbean.getAccountNumber()); 140 | lblNewLabel.setBounds(160, 32, 150, 15); 141 | userScreen.getContentPane().add(lblNewLabel); 142 | 143 | JLabel lblCurrentBalance = new JLabel("Current Balance :"); 144 | lblCurrentBalance.setBounds(30, 50, 130, 15); 145 | userScreen.getContentPane().add(lblCurrentBalance); 146 | 147 | JLabel lblNewLabel_1 = new JLabel(Double.toString(account.getBalance())); 148 | lblNewLabel_1.setBounds(160, 52, 66, 15); 149 | userScreen.getContentPane().add(lblNewLabel_1); 150 | 151 | JButton btnNewButton = new JButton("Withdraw"); 152 | btnNewButton.addActionListener(new ActionListener() { 153 | public void actionPerformed(ActionEvent arg0) { 154 | WithdrawForm.callWithdrawFrame(); 155 | WithdrawForm.setUser(userbean); 156 | WithdrawForm.setService(service); 157 | WithdrawForm.setAccountService(account_service); 158 | WithdrawForm.setAccountbean(account); 159 | userScreen.setVisible(false); 160 | } 161 | }); 162 | btnNewButton.setBounds(250, 161, 114, 25); 163 | userScreen.getContentPane().add(btnNewButton); 164 | 165 | JButton btnNewButton_1 = new JButton("Deposit"); 166 | btnNewButton_1.addActionListener(new ActionListener() { 167 | public void actionPerformed(ActionEvent arg0) { 168 | Deposit.CallDeposit(); 169 | Deposit.setAccountbean(account); 170 | Deposit.setAccountService(account_service); 171 | Deposit.setService(service); 172 | Deposit.setUser(userbean); 173 | userScreen.setVisible(false); 174 | } 175 | }); 176 | btnNewButton_1.setBounds(600, 161, 114, 25); 177 | userScreen.getContentPane().add(btnNewButton_1); 178 | } 179 | } 180 | -------------------------------------------------------------------------------- /src/main/java/com/demo/OOPD_Project/GUI/WithdrawForm.java: -------------------------------------------------------------------------------- 1 | package com.demo.OOPD_Project.GUI; 2 | 3 | import java.awt.Dimension; 4 | import java.awt.EventQueue; 5 | 6 | import javax.swing.JFrame; 7 | import javax.swing.JOptionPane; 8 | 9 | import com.demo.OOPD_Project.Bean.AccountBean; 10 | import com.demo.OOPD_Project.Bean.AccountHolderBean; 11 | import com.demo.OOPD_Project.dao.AccountDAO; 12 | import com.demo.OOPD_Project.dao.AccountHolderDAO; 13 | import com.demo.OOPD_Project.dao.Withdraw; 14 | import com.demo.OOPD_Project.exception.OOPDException; 15 | import javax.swing.JLabel; 16 | import java.awt.Font; 17 | import java.awt.Toolkit; 18 | 19 | import javax.swing.JTextField; 20 | import javax.swing.JButton; 21 | import java.awt.event.ActionListener; 22 | import java.awt.event.KeyAdapter; 23 | import java.awt.event.KeyEvent; 24 | import java.awt.event.ActionEvent; 25 | 26 | public class WithdrawForm { 27 | 28 | private JFrame withdrawFrame; 29 | private static AccountHolderBean user; 30 | private static AccountHolderDAO service; 31 | private static AccountDAO account_service; 32 | private static AccountBean account; 33 | public Withdraw withdraw = new Withdraw(); 34 | private JTextField textField; 35 | 36 | public static void setUser(AccountHolderBean usr) 37 | { 38 | user = usr; 39 | } 40 | 41 | public static void setService(AccountHolderDAO s) 42 | { 43 | service = s; 44 | } 45 | 46 | public static void setAccountbean(AccountBean b) 47 | { 48 | account = b; 49 | } 50 | public static void setAccountService(AccountDAO d) 51 | { 52 | account_service = d; 53 | } 54 | /** 55 | * Launch the application. 56 | */ 57 | public static void callWithdrawFrame() { 58 | EventQueue.invokeLater(new Runnable() { 59 | public void run() { 60 | try { 61 | WithdrawForm window = new WithdrawForm(); 62 | window.withdrawFrame.setVisible(true); 63 | Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize(); 64 | int x = (int) ((dimension.getWidth() - window.withdrawFrame.getWidth()) / 2); 65 | int y = (int) ((dimension.getHeight() - window.withdrawFrame.getWidth()) / 2); 66 | window.withdrawFrame.setLocation(x, y); 67 | } catch (Exception e) { 68 | e.printStackTrace(); 69 | } 70 | } 71 | }); 72 | } 73 | 74 | /** 75 | * Create the application. 76 | */ 77 | public WithdrawForm() { 78 | initialize(); 79 | } 80 | 81 | /** 82 | * Initialize the contents of the frame. 83 | */ 84 | private void initialize() { 85 | withdrawFrame = new JFrame(); 86 | withdrawFrame.setBounds(1500, 900, 1200, 900); 87 | withdrawFrame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); 88 | withdrawFrame.getContentPane().setLayout(null); 89 | 90 | /* If user tries to cancel the screen directly we will log them out */ 91 | withdrawFrame.addWindowListener(new java.awt.event.WindowAdapter() { 92 | @Override 93 | public void windowClosing(java.awt.event.WindowEvent windowEvent) { 94 | if (JOptionPane.showConfirmDialog(withdrawFrame, 95 | "Are you sure you want to close this window?\n You will be logged out", "Close Window?", 96 | JOptionPane.YES_NO_OPTION, 97 | JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION){ 98 | try { 99 | service.ClientLogout(user); 100 | } catch (OOPDException e) { 101 | // TODO Auto-generated catch block 102 | e.printStackTrace(); 103 | } 104 | System.exit(0); 105 | } 106 | } 107 | }); 108 | 109 | JLabel lblCurrentBalance = new JLabel("Current Balance :"); 110 | lblCurrentBalance.setFont(new Font("Dialog", Font.BOLD, 15)); 111 | lblCurrentBalance.setBounds(46, 12, 155, 25); 112 | withdrawFrame.getContentPane().add(lblCurrentBalance); 113 | 114 | JLabel lblgetBalance = new JLabel(Double.toString(account.getBalance())); 115 | lblgetBalance.setFont(new Font("Dialog", Font.BOLD, 15)); 116 | lblgetBalance.setBounds(200, 12, 500, 25); 117 | withdrawFrame.getContentPane().add(lblgetBalance); 118 | 119 | textField = new JTextField(); 120 | textField.setBounds(500, 169, 200, 30); 121 | withdrawFrame.getContentPane().add(textField); 122 | textField.setColumns(10); 123 | /* Disabling all the invalid inputs like special characters into the First Name field*/ 124 | textField.addKeyListener(new KeyAdapter() { 125 | public void keyTyped(KeyEvent e) { 126 | char c = e.getKeyChar(); 127 | if (c<48 || c>57) { 128 | e.consume(); 129 | } 130 | } 131 | }); 132 | JLabel lblEnterAmount = new JLabel("Enter Amount"); 133 | lblEnterAmount.setFont(new Font("Dialog", Font.BOLD, 15)); 134 | lblEnterAmount.setBounds(320, 169, 150, 30); 135 | withdrawFrame.getContentPane().add(lblEnterAmount); 136 | 137 | JButton btnNewButton = new JButton("Withdraw"); 138 | withdrawFrame.getRootPane().setDefaultButton(btnNewButton); 139 | btnNewButton.addActionListener(new ActionListener() { 140 | public void actionPerformed(ActionEvent arg0) { 141 | try { 142 | System.out.println(Double.parseDouble(textField.getText())); 143 | int status = withdraw.doWithdraw(account, Double.parseDouble(textField.getText())); 144 | if(status == 1) 145 | { 146 | JOptionPane.showMessageDialog(null, "Invalid Amount","Error",JOptionPane.ERROR_MESSAGE); 147 | textField.setText(null); 148 | } 149 | else if(status == 2){ 150 | withdrawFrame.setVisible(false); 151 | Welcome_user.callUserWelcomeScreen(); 152 | Welcome_user.setAccount(account); 153 | Welcome_user.setAccountService(account_service); 154 | Welcome_user.setService(service); 155 | Welcome_user.setUser(user); 156 | } 157 | else 158 | JOptionPane.showMessageDialog(null, "Transaction failed","Error",JOptionPane.ERROR_MESSAGE); 159 | } catch (OOPDException e) { 160 | // TODO Auto-generated catch block 161 | e.printStackTrace(); 162 | } 163 | } 164 | }); 165 | btnNewButton.setBounds(427, 230, 120, 25); 166 | withdrawFrame.getContentPane().add(btnNewButton); 167 | 168 | JButton btnBack = new JButton("Back"); 169 | btnBack.addActionListener(new ActionListener() { 170 | public void actionPerformed(ActionEvent arg0) { 171 | Welcome_user.callUserWelcomeScreen(); 172 | Welcome_user.setAccount(account); 173 | Welcome_user.setAccountService(account_service); 174 | Welcome_user.setService(service); 175 | Welcome_user.setUser(user); 176 | withdrawFrame.setVisible(false); 177 | } 178 | }); 179 | btnBack.setBounds(594, 230, 114, 25); 180 | withdrawFrame.getContentPane().add(btnBack); 181 | 182 | /* If user tries to cancel the screen directly we will log them out */ 183 | withdrawFrame.addWindowListener(new java.awt.event.WindowAdapter() { 184 | @Override 185 | public void windowClosing(java.awt.event.WindowEvent windowEvent) { 186 | if (JOptionPane.showConfirmDialog(withdrawFrame, 187 | "Are you sure you want to close this window?\n You will be logged out", "Close Window?", 188 | JOptionPane.YES_NO_OPTION, 189 | JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION){ 190 | try { 191 | service.ClientLogout(user); 192 | } catch (OOPDException e) { 193 | // TODO Auto-generated catch block 194 | e.printStackTrace(); 195 | } 196 | System.exit(0); 197 | } 198 | } 199 | }); 200 | 201 | } 202 | } -------------------------------------------------------------------------------- /src/main/java/com/demo/OOPD_Project/GUI/report.java: -------------------------------------------------------------------------------- 1 | package com.demo.OOPD_Project.GUI; 2 | 3 | import java.awt.EventQueue; 4 | 5 | import javax.swing.JFrame; 6 | 7 | import javax.swing.JTextArea; 8 | import javax.swing.JButton; 9 | import java.awt.event.ActionListener; 10 | import java.awt.event.ActionEvent; 11 | 12 | public class report { 13 | 14 | private JFrame frame; 15 | private static String data; 16 | public static void setData(String s) 17 | { 18 | data = s; 19 | } 20 | /** 21 | * Launch the application. 22 | */ 23 | public static void callreport() { 24 | EventQueue.invokeLater(new Runnable() { 25 | public void run() { 26 | try { 27 | report window = new report(); 28 | window.frame.setVisible(true); 29 | } catch (Exception e) { 30 | e.printStackTrace(); 31 | } 32 | } 33 | }); 34 | } 35 | 36 | /** 37 | * Create the application. 38 | */ 39 | public report() { 40 | initialize(); 41 | } 42 | 43 | /** 44 | * Initialize the contents of the frame. 45 | */ 46 | private void initialize() { 47 | frame = new JFrame(); 48 | frame.setBounds(100, 100, 450, 300); 49 | frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); 50 | frame.getContentPane().setLayout(null); 51 | 52 | JTextArea textArea = new JTextArea(); 53 | textArea.setBounds(100, 40, 200, 200); 54 | textArea.setText(data); 55 | textArea.setEnabled(false); 56 | frame.getContentPane().add(textArea); 57 | 58 | JButton btnClose = new JButton("Close"); 59 | btnClose.addActionListener(new ActionListener() { 60 | public void actionPerformed(ActionEvent arg0) { 61 | frame.setVisible(false); 62 | } 63 | }); 64 | btnClose.setBounds(314, 215, 114, 25); 65 | frame.getContentPane().add(btnClose); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/com/demo/OOPD_Project/GUI/setInterestGUI.java: -------------------------------------------------------------------------------- 1 | package com.demo.OOPD_Project.GUI; 2 | 3 | import java.awt.Dimension; 4 | import java.awt.EventQueue; 5 | import java.awt.Toolkit; 6 | 7 | import javax.swing.JFrame; 8 | import javax.swing.JOptionPane; 9 | 10 | import com.demo.OOPD_Project.Bean.AdminBean; 11 | import com.demo.OOPD_Project.dao.AdminDAO; 12 | import com.demo.OOPD_Project.exception.OOPDException; 13 | import javax.swing.JLabel; 14 | import javax.swing.JTextField; 15 | import javax.swing.JButton; 16 | import java.awt.event.ActionListener; 17 | import java.awt.event.KeyAdapter; 18 | import java.awt.event.KeyEvent; 19 | import java.awt.event.ActionEvent; 20 | 21 | public class setInterestGUI { 22 | 23 | private JFrame setInterestFrame; 24 | private static AdminBean admin; 25 | private static AdminDAO service; 26 | private JTextField textField; 27 | public static void adminBean(AdminBean ad) 28 | { 29 | admin = ad; 30 | } 31 | public static void adminDao(AdminDAO ser) 32 | { 33 | service = ser; 34 | } 35 | /** 36 | * Launch the application. 37 | */ 38 | public static void callSetInterest() { 39 | EventQueue.invokeLater(new Runnable() { 40 | public void run() { 41 | try { 42 | setInterestGUI window = new setInterestGUI(); 43 | Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize(); 44 | int x = (int) ((dimension.getWidth() - window.setInterestFrame.getWidth()) / 2); 45 | int y = (int) ((dimension.getHeight() - window.setInterestFrame.getWidth()) / 2); 46 | window.setInterestFrame.setLocation(x, y); 47 | window.setInterestFrame.setVisible(true); 48 | } catch (Exception e) { 49 | e.printStackTrace(); 50 | } 51 | } 52 | }); 53 | } 54 | 55 | /** 56 | * Create the application. 57 | */ 58 | public setInterestGUI() { 59 | initialize(); 60 | } 61 | 62 | /** 63 | * Initialize the contents of the frame. 64 | */ 65 | private void initialize() { 66 | setInterestFrame = new JFrame(); 67 | setInterestFrame.setBounds(100, 100, 450, 300); 68 | setInterestFrame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); 69 | setInterestFrame.getContentPane().setLayout(null); 70 | 71 | JLabel lblNewLabel = new JLabel("Set Interest"); 72 | lblNewLabel.setBounds(165, 12, 150, 15); 73 | setInterestFrame.getContentPane().add(lblNewLabel); 74 | 75 | JLabel lblNewLabel_1 = new JLabel("Enter Interest"); 76 | lblNewLabel_1.setBounds(78, 81, 100, 15); 77 | setInterestFrame.getContentPane().add(lblNewLabel_1); 78 | 79 | textField = new JTextField(); 80 | textField.setBounds(202, 75, 200, 30); 81 | setInterestFrame.getContentPane().add(textField); 82 | textField.setColumns(10); 83 | 84 | /* Disabling all the invalid inputs like special characters into the First Name field*/ 85 | textField.addKeyListener(new KeyAdapter() { 86 | public void keyTyped(KeyEvent e) { 87 | char c = e.getKeyChar(); 88 | if (c<46|| c==47 || c>57) { 89 | e.consume(); 90 | } 91 | } 92 | }); 93 | 94 | JButton btnSave = new JButton("Save"); 95 | btnSave.addActionListener(new ActionListener() { 96 | public void actionPerformed(ActionEvent arg0) { 97 | try { 98 | String str = textField.getText(); 99 | int i = 0,count = 0; 100 | if(str.length()==0) 101 | { 102 | JOptionPane.showMessageDialog(null, "Invalid entry","Error",JOptionPane.ERROR_MESSAGE); 103 | textField.setText(null); 104 | }else { 105 | while(i1) 112 | { 113 | JOptionPane.showMessageDialog(null, "Invalid entry","Error",JOptionPane.ERROR_MESSAGE); 114 | textField.setText(null); 115 | } 116 | else { 117 | double sum = Double.parseDouble(textField.getText()); 118 | if(sum<0) 119 | { 120 | JOptionPane.showMessageDialog(null, "Invalid entry","Error",JOptionPane.ERROR_MESSAGE); 121 | textField.setText(null); 122 | } 123 | else 124 | { 125 | admin.setInterest(sum); 126 | service.setInterestDB(admin); 127 | AdminWelcomeScreen.setAdmin(admin); 128 | AdminWelcomeScreen.setService(service); 129 | AdminWelcomeScreen.callAdminWelcomeScreen(); 130 | setInterestFrame.setVisible(false); 131 | }}} 132 | } catch (OOPDException e) { 133 | // TODO Auto-generated catch block 134 | e.printStackTrace(); 135 | } 136 | } 137 | }); 138 | btnSave.setBounds(109, 134, 114, 25); 139 | setInterestFrame.getContentPane().add(btnSave); 140 | 141 | JButton btnBacj = new JButton("Back"); 142 | btnBacj.addActionListener(new ActionListener() { 143 | public void actionPerformed(ActionEvent arg0) { 144 | AdminWelcomeScreen.setAdmin(admin); 145 | AdminWelcomeScreen.setService(service); 146 | AdminWelcomeScreen.callAdminWelcomeScreen(); 147 | setInterestFrame.setVisible(false); 148 | } 149 | }); 150 | btnBacj.setBounds(263, 134, 114, 25); 151 | setInterestFrame.getContentPane().add(btnBacj); 152 | 153 | setInterestFrame.addWindowListener(new java.awt.event.WindowAdapter() { 154 | @Override 155 | public void windowClosing(java.awt.event.WindowEvent windowEvent) { 156 | if (JOptionPane.showConfirmDialog(setInterestFrame, 157 | "Are you sure you want to close this window?\n You will be logged out", "Close Window?", 158 | JOptionPane.YES_NO_OPTION, 159 | JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION){ 160 | try { 161 | service.adminLogout(admin); 162 | System.exit(0); 163 | } catch (OOPDException e) { 164 | // TODO Auto-generated catch block 165 | e.printStackTrace(); 166 | } 167 | System.exit(0); 168 | } 169 | } 170 | }); 171 | } 172 | 173 | } 174 | -------------------------------------------------------------------------------- /src/main/java/com/demo/OOPD_Project/GUI/setTaxGUI.java: -------------------------------------------------------------------------------- 1 | package com.demo.OOPD_Project.GUI; 2 | 3 | import java.awt.Dimension; 4 | import java.awt.EventQueue; 5 | import java.awt.Toolkit; 6 | 7 | import javax.swing.JFrame; 8 | 9 | import com.demo.OOPD_Project.Bean.AdminBean; 10 | import com.demo.OOPD_Project.dao.AdminDAO; 11 | import com.demo.OOPD_Project.exception.OOPDException; 12 | 13 | import javax.swing.JLabel; 14 | import javax.swing.JOptionPane; 15 | import javax.swing.JTextField; 16 | import javax.swing.JButton; 17 | import java.awt.event.ActionListener; 18 | import java.awt.event.KeyAdapter; 19 | import java.awt.event.KeyEvent; 20 | import java.awt.event.ActionEvent; 21 | 22 | public class setTaxGUI { 23 | 24 | private JFrame taxFrame; 25 | private static AdminBean admin; 26 | private static AdminDAO service; 27 | private JTextField textField; 28 | public static void adminBean(AdminBean ad) 29 | { 30 | admin = ad; 31 | } 32 | public static void adminDao(AdminDAO ser) 33 | { 34 | service = ser; 35 | } 36 | /** 37 | * Launch the application. 38 | */ 39 | public static void runSetTaxGui() { 40 | EventQueue.invokeLater(new Runnable() { 41 | public void run() { 42 | try { 43 | setTaxGUI window = new setTaxGUI(); 44 | Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize(); 45 | int x = (int) ((dimension.getWidth() - window.taxFrame.getWidth()) / 2); 46 | int y = (int) ((dimension.getHeight() - window.taxFrame.getWidth()) / 2); 47 | window.taxFrame.setLocation(x, y); 48 | window.taxFrame.setVisible(true); 49 | } catch (Exception e) { 50 | e.printStackTrace(); 51 | } 52 | } 53 | }); 54 | } 55 | 56 | /** 57 | * Create the application. 58 | */ 59 | public setTaxGUI() { 60 | initialize(); 61 | } 62 | 63 | /** 64 | * Initialize the contents of the frame. 65 | */ 66 | private void initialize() { 67 | taxFrame = new JFrame(); 68 | taxFrame.setBounds(100, 100, 450, 300); 69 | taxFrame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); 70 | taxFrame.getContentPane().setLayout(null); 71 | 72 | JLabel lblSetTax = new JLabel("Set Tax"); 73 | lblSetTax.setBounds(161, 12, 66, 15); 74 | taxFrame.getContentPane().add(lblSetTax); 75 | 76 | JLabel lblEnterTax = new JLabel("Enter tax"); 77 | lblEnterTax.setBounds(60, 72, 66, 15); 78 | taxFrame.getContentPane().add(lblEnterTax); 79 | 80 | textField = new JTextField(); 81 | textField.setBounds(160, 68, 200, 30); 82 | taxFrame.getContentPane().add(textField); 83 | textField.setColumns(10); 84 | /* Disabling all the invalid inputs like special characters into the First Name field*/ 85 | textField.addKeyListener(new KeyAdapter() { 86 | public void keyTyped(KeyEvent e) { 87 | char c = e.getKeyChar(); 88 | if (c<46|| c==47 || c>57) { 89 | e.consume(); 90 | } 91 | } 92 | }); 93 | JButton btnSave = new JButton("Save"); 94 | btnSave.addActionListener(new ActionListener() { 95 | public void actionPerformed(ActionEvent arg0) { 96 | try { 97 | String str = textField.getText(); 98 | int i = 0,count = 0; 99 | if(str.length()==0) 100 | { 101 | JOptionPane.showMessageDialog(null, "Invalid entry","Error",JOptionPane.ERROR_MESSAGE); 102 | textField.setText(null); 103 | }else { 104 | while(i1) 111 | { 112 | JOptionPane.showMessageDialog(null, "Invalid entry","Error",JOptionPane.ERROR_MESSAGE); 113 | textField.setText(null); 114 | } 115 | else { 116 | double sum = Double.parseDouble(textField.getText()); 117 | if(sum<0) 118 | { 119 | JOptionPane.showMessageDialog(null, "Invalid entry","Error",JOptionPane.ERROR_MESSAGE); 120 | textField.setText(null); 121 | } 122 | else 123 | { 124 | admin.setInterest(sum); 125 | service.setTaxDB(admin); 126 | AdminWelcomeScreen.setAdmin(admin); 127 | AdminWelcomeScreen.setService(service); 128 | AdminWelcomeScreen.callAdminWelcomeScreen(); 129 | taxFrame.setVisible(false); 130 | }}} 131 | } catch (OOPDException e) { 132 | // TODO Auto-generated catch block 133 | e.printStackTrace(); 134 | } 135 | } 136 | }); 137 | btnSave.setBounds(60, 157, 114, 25); 138 | taxFrame.getContentPane().add(btnSave); 139 | 140 | JButton btnBack = new JButton("Back"); 141 | btnBack.addActionListener(new ActionListener() { 142 | public void actionPerformed(ActionEvent arg0) { 143 | AdminWelcomeScreen.setAdmin(admin); 144 | AdminWelcomeScreen.setService(service); 145 | AdminWelcomeScreen.callAdminWelcomeScreen(); 146 | taxFrame.setVisible(false); 147 | } 148 | }); 149 | 150 | taxFrame.addWindowListener(new java.awt.event.WindowAdapter() { 151 | @Override 152 | public void windowClosing(java.awt.event.WindowEvent windowEvent) { 153 | if (JOptionPane.showConfirmDialog(taxFrame, 154 | "Are you sure you want to close this window?\n You will be logged out", "Close Window?", 155 | JOptionPane.YES_NO_OPTION, 156 | JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION){ 157 | try { 158 | service.adminLogout(admin); 159 | System.exit(0); 160 | } catch (OOPDException e) { 161 | // TODO Auto-generated catch block 162 | e.printStackTrace(); 163 | } 164 | System.exit(0); 165 | } 166 | } 167 | }); 168 | btnBack.setBounds(246, 157, 114, 25); 169 | taxFrame.getContentPane().add(btnBack); 170 | } 171 | 172 | } 173 | -------------------------------------------------------------------------------- /src/main/java/com/demo/OOPD_Project/dao/AccountDAO.java: -------------------------------------------------------------------------------- 1 | package com.demo.OOPD_Project.dao; 2 | 3 | import java.sql.Connection; 4 | import java.sql.PreparedStatement; 5 | import java.sql.ResultSet; 6 | 7 | import com.demo.OOPD_Project.Bean.AccountBean; 8 | import com.demo.OOPD_Project.DBUtil.Database; 9 | import com.demo.OOPD_Project.exception.OOPDException; 10 | 11 | public class AccountDAO implements IAccountDAO{ 12 | public void getBalanceFromDB(AccountBean account) throws OOPDException { 13 | Connection con=Database.estabblishConnection(); //Making connection to the database 14 | try { 15 | con.setAutoCommit(false); 16 | PreparedStatement ps = con.prepareStatement(IQuerryMapper.SET_BALANCE); 17 | ps.setString(1, account.getCustomer().getAccountNumber()); 18 | ResultSet rs = ps.executeQuery(); 19 | if(rs.next()) 20 | account.setBalance(rs.getDouble(1)); 21 | con.commit(); 22 | con.close(); 23 | } 24 | catch(Exception e) 25 | { 26 | throw new OOPDException("Error getting balance "+e); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/demo/OOPD_Project/dao/AccountHolderDAO.java: -------------------------------------------------------------------------------- 1 | package com.demo.OOPD_Project.dao; 2 | 3 | 4 | /* 5 | * This is a AccountHolderDAO class which is managing all the functionalities for the user by making connection to the database. 6 | * 7 | * ClientLogin() function takes account holder's bean object as argument and provides them login function if password and account number matches to any entry in the database 8 | */ 9 | 10 | 11 | import java.sql.Connection; 12 | import java.sql.PreparedStatement; 13 | import java.sql.ResultSet; 14 | import java.time.LocalDate; 15 | import java.time.format.DateTimeFormatter; 16 | 17 | import com.demo.OOPD_Project.Bean.AccountHolderBean; 18 | import com.demo.OOPD_Project.DBUtil.Database; 19 | import com.demo.OOPD_Project.exception.OOPDException; 20 | 21 | 22 | public class AccountHolderDAO implements IAccountHolderDAO{ 23 | 24 | public int ClientLogin(AccountHolderBean client) throws OOPDException { 25 | Connection con=Database.estabblishConnection(); //Making connection to the database 26 | int status = 0; //Used to store status if login is or not 27 | try { 28 | con.setAutoCommit(false); 29 | /* Running the SQL query to get information about the user with given user-name and password */ 30 | PreparedStatement ps = con.prepareStatement(IQuerryMapper.SELECT_USER); 31 | ps.setString(1, client.getAccountNumber()); 32 | ps.setString(2, client.getPassword()); 33 | ResultSet rs=ps.executeQuery(); 34 | if(rs.next()) 35 | { 36 | PreparedStatement ps1 = con.prepareStatement(IQuerryMapper.SET_ACTIVE_TRUE); 37 | ps1.setString(1, client.getAccountNumber()); 38 | ps1.executeUpdate(); 39 | if(rs.getBoolean(6)) //client is already logged in somewhere else 40 | status = 1; 41 | else 42 | { 43 | /*Since we got the information successful now set the respective variables with correct values*/ 44 | client.setFname(rs.getString(2)); 45 | client.setLname(rs.getString(3)); 46 | client.setDateOfJoining(rs.getString(4)); 47 | status = 2; //If everything is fine turn login status to true. 48 | } 49 | } 50 | con.commit(); 51 | con.close(); 52 | } 53 | catch(Exception e) 54 | { 55 | throw new OOPDException("Error selection users "+e); 56 | } 57 | return status; 58 | } 59 | 60 | public boolean ClientLogout(AccountHolderBean client) throws OOPDException { 61 | 62 | Connection con=Database.estabblishConnection(); //Making connection to the database 63 | try { 64 | con.setAutoCommit(false); 65 | /* Running the SQL query to Logout user */ 66 | PreparedStatement ps = con.prepareStatement(IQuerryMapper.LOGOUT_USER); 67 | ps.setString(1, client.getAccountNumber()); 68 | ps.executeUpdate(); 69 | client.setAccountNumber(null); 70 | client.setDateOfJoining(null); 71 | client.setFname(null); 72 | client.setLname(null); 73 | client.setPassword(null); 74 | client = null; 75 | con.commit(); 76 | con.close(); 77 | } 78 | catch(Exception e) 79 | { 80 | throw new OOPDException("Error selection users "+e); 81 | } 82 | return true; 83 | } 84 | 85 | public boolean addClient(AccountHolderBean client) throws OOPDException { 86 | 87 | Connection con = Database.estabblishConnection(); 88 | DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy/MM/dd"); 89 | LocalDate localDate = LocalDate.now(); 90 | System.out.println(dtf.format(localDate)); 91 | try { 92 | con.setAutoCommit(false); 93 | PreparedStatement ps = con.prepareStatement(IQuerryMapper.GET_CURR_ACC_NO); 94 | ResultSet rs = ps.executeQuery(); 95 | rs.next(); 96 | int curr_acc_num = rs.getInt(1); 97 | /*Increment account number back in the table*/ 98 | ps = con.prepareStatement(IQuerryMapper.INC_ACC_NUM); 99 | ps.setInt(1, curr_acc_num+1); 100 | ps.setInt(2, curr_acc_num); 101 | ps.executeUpdate(); 102 | ps = con.prepareStatement(IQuerryMapper.ADD_USER); 103 | ps.setString(1,"abcd"+(curr_acc_num+1)); 104 | client.setAccountNumber("abcd"+(curr_acc_num+1)); 105 | ps.setString(2, client.getFname()); 106 | ps.setString(3, client.getLname()); 107 | ps.setString(4, dtf.format(localDate)); 108 | ps.setString(5, client.getPassword()); 109 | System.out.println("New user created with following details: \n"+client.getAccountNumber()+ " "+client.getFname()+" "+client.getLname()); 110 | ps.executeUpdate(); 111 | ps = con.prepareStatement(IQuerryMapper.ADD_INTO_ACCOUNT); 112 | ps.setString(1,client.getAccountNumber()); 113 | ps.executeUpdate(); 114 | /*Making the monthly and daily interest tables*/ 115 | con.prepareStatement("CREATE TABLE "+client.getAccountNumber()+"_daily"+ "(day_mon NUMERIC primary key, Interest numeric(10,2))").executeUpdate(); 116 | con.prepareStatement("CREATE TABLE "+client.getAccountNumber()+"_monthly"+"(mon NUMERIC primary key,Total_interest numeric(10,2))").executeUpdate(); 117 | con.commit(); 118 | con.close(); 119 | } 120 | catch(Exception e) 121 | { 122 | throw new OOPDException("Error adding client"+e); 123 | } 124 | return false; 125 | } 126 | } 127 | -------------------------------------------------------------------------------- /src/main/java/com/demo/OOPD_Project/dao/AdminDAO.java: -------------------------------------------------------------------------------- 1 | package com.demo.OOPD_Project.dao; 2 | 3 | import java.sql.Connection; 4 | import java.sql.PreparedStatement; 5 | import java.sql.ResultSet; 6 | import java.time.LocalDate; 7 | import java.time.ZoneId; 8 | import java.util.Calendar; 9 | import java.util.Date; 10 | import java.util.Timer; 11 | import java.util.TimerTask; 12 | 13 | import com.demo.OOPD_Project.Bean.AdminBean; 14 | import com.demo.OOPD_Project.DBUtil.Database; 15 | import com.demo.OOPD_Project.exception.OOPDException; 16 | 17 | public class AdminDAO implements IAdminDAO{ 18 | public int adminLogin(AdminBean admin) throws OOPDException { 19 | int status = 0; 20 | Connection con=Database.estabblishConnection(); //Making connection to the database 21 | try { 22 | PreparedStatement ps = con.prepareStatement(IQuerryMapper.ADMIN_LOGIN); 23 | ps.setString(1, admin.getUsername()); 24 | ps.setString(2, admin.getPassword()); 25 | ResultSet rs = ps.executeQuery(); 26 | if(rs.next()) 27 | { 28 | PreparedStatement ps1 = con.prepareStatement(IQuerryMapper.SET_ACTIVE_TRUE_ADMIN); 29 | ps1.setString(1, admin.getUsername()); 30 | ps1.executeUpdate(); 31 | if(rs.getBoolean(3)) //Admin is already logged in somewhere 32 | status = 1; 33 | else 34 | status = 2; 35 | } 36 | 37 | } 38 | catch(Exception e) 39 | { 40 | throw new OOPDException("Admin Login eror"+e); 41 | } 42 | if(status==2) 43 | { 44 | 45 | Timer timer = new Timer(); 46 | 47 | Calendar calendar = Calendar.getInstance(); 48 | calendar.set(Calendar.HOUR_OF_DAY, 23); 49 | calendar.set(Calendar.MINUTE, 58); 50 | calendar.set(Calendar.SECOND, 00); 51 | Date time = calendar.getTime(); 52 | 53 | timer.schedule(new YourTask(), 54 | time); 55 | } 56 | return status; 57 | } 58 | public boolean adminLogout(AdminBean admin) throws OOPDException { 59 | Connection con = Database.estabblishConnection(); 60 | try { 61 | con.setAutoCommit(false); 62 | PreparedStatement ps = con.prepareStatement(IQuerryMapper.LOGOUT_ADMIN); 63 | ps.setString(1,admin.getUsername()); 64 | ps.executeUpdate(); 65 | admin.setPassword(null); 66 | admin.setUsername(null); 67 | admin = null; 68 | con.commit(); 69 | con.close(); 70 | } 71 | catch(Exception e) 72 | { 73 | throw new OOPDException("Error loggin out for admin"+e); 74 | } 75 | return true; 76 | } 77 | 78 | static class YourTask extends TimerTask { 79 | public void run() { 80 | try { 81 | calculateInterest(); 82 | } catch (OOPDException e) { 83 | // TODO Auto-generated catch block 84 | e.printStackTrace(); 85 | } 86 | } 87 | @SuppressWarnings("resource") 88 | public void calculateInterest() throws OOPDException { 89 | Date date = new Date(); 90 | double sum = 0; 91 | double tax = 0; 92 | LocalDate localDate = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); 93 | int currentDay = localDate.getDayOfMonth(); 94 | int currentMonth = localDate.getMonthValue(); 95 | 96 | Connection con=Database.estabblishConnection(); //Making connection to the database 97 | try { 98 | con.setAutoCommit(false); 99 | PreparedStatement ps = con.prepareStatement("SELECT * FROM accounts"); 100 | ResultSet rs = ps.executeQuery(); 101 | while(rs.next()) 102 | { 103 | System.out.println(rs.getString(1)+" "+rs.getString(2)); 104 | ps = con.prepareStatement("SELECT interest,tax FROM admin"); 105 | ResultSet r = ps.executeQuery(); 106 | double itr = 0; 107 | double temp1=0; 108 | if(r.next()) 109 | { 110 | itr = r.getDouble(1); 111 | tax = r.getDouble(2); 112 | } 113 | ps = con.prepareStatement("INSERT INTO "+rs.getString(1)+"_daily VALUES (?,?)"); 114 | ps.setInt(1, currentDay); 115 | ps.setDouble(2,(rs.getDouble(2)*itr)/100); 116 | ps.executeUpdate(); 117 | 118 | 119 | double temp=0; 120 | if(currentDay==31 &&(currentMonth==1||currentMonth==3||currentMonth==5||currentMonth==7||currentMonth==8||currentMonth==10||currentMonth==12)) 121 | { 122 | ps = con.prepareStatement("DELETE FROM "+rs.getString(1)+"_daily"); 123 | ps.executeUpdate(); 124 | ps = con.prepareStatement("SELECT Interest FROM "+rs.getString(1)+"_daily"); 125 | ResultSet rg = ps.executeQuery(); 126 | while(rg.next()) { 127 | sum+=rg.getDouble(1); 128 | } 129 | temp = sum-((sum*tax)/100); 130 | ps = con.prepareStatement("INSERT INTO "+rs.getString(1)+"_monthly VALUES(?,?)"); 131 | ps.setInt(1, currentMonth); 132 | ps.setDouble(2,temp); 133 | ps.executeUpdate(); 134 | ps = con.prepareStatement("SELECT balance FROM accounts WHERE account_number = ?"); 135 | ps.setString(1, rs.getString(1)); 136 | rg = ps.executeQuery(); 137 | if(rg.next()) 138 | temp1=rg.getDouble(1); 139 | temp1+=temp; 140 | ps = con.prepareStatement("UPDATE TABLE accounts SET balance = ? WHERE account_number = ?"); 141 | ps.setDouble(1, temp1); 142 | ps.setString(2, rs.getString(1)); 143 | } 144 | else if(currentDay==30&&(currentMonth==4||currentMonth==6||currentMonth==9||currentMonth==11)) 145 | { 146 | 147 | ps = con.prepareStatement("DELETE FROM "+rs.getString(1)+"_daily"); 148 | ps.executeUpdate(); 149 | ps = con.prepareStatement("SELECT Interest FROM "+rs.getString(1)+"_daily"); 150 | ResultSet rx = ps.executeQuery(); 151 | while(rx.next()) { 152 | sum+=rx.getDouble(1); 153 | } 154 | temp = sum-((sum*tax)/100); 155 | ps = con.prepareStatement("INSERT INTO "+rs.getString(1)+"_monthly VALUES(?,?)"); 156 | ps.setInt(1, currentMonth); 157 | ps.setDouble(2,temp); 158 | ps.executeUpdate(); 159 | ps = con.prepareStatement("SELECT balance FROM accounts WHERE account_number = ?"); 160 | ps.setString(1, rs.getString(1)); 161 | rx = ps.executeQuery(); 162 | if(rx.next()) 163 | temp1=rx.getDouble(1); 164 | temp1+=temp; 165 | ps = con.prepareStatement("UPDATE TABLE accounts SET balance = ? WHERE account_number = ?"); 166 | ps.setDouble(1, temp1); 167 | ps.setString(2, rs.getString(1)); 168 | } 169 | else if((currentDay==28 || currentDay == 29)&&(currentMonth==2)) 170 | { 171 | 172 | ps = con.prepareStatement("DELETE FROM "+rs.getString(1)+"_daily"); 173 | ps.executeUpdate(); 174 | ps = con.prepareStatement("SELECT Interest FROM "+rs.getString(1)+"_daily"); 175 | ResultSet ry = ps.executeQuery(); 176 | while(ry.next()) { 177 | sum+=ry.getDouble(1); 178 | } 179 | temp = sum-((sum*tax)/100); 180 | ps = con.prepareStatement("INSERT INTO "+rs.getString(1)+"_monthly VALUES(?,?)"); 181 | ps.setInt(1, currentMonth); 182 | ps.setDouble(2,temp); 183 | ps.executeUpdate(); 184 | ps = con.prepareStatement("SELECT balance FROM accounts WHERE account_number = ?"); 185 | ps.setString(1, rs.getString(1)); 186 | ry = ps.executeQuery(); 187 | if(ry.next()) 188 | temp1=ry.getDouble(1); 189 | temp1+=temp; 190 | ps = con.prepareStatement("UPDATE TABLE accounts SET balance = ? WHERE account_number = ?"); 191 | ps.setDouble(1, temp1); 192 | ps.setString(2, rs.getString(1)); 193 | } 194 | } 195 | con.commit(); 196 | con.close(); 197 | } 198 | catch(Exception e) 199 | { 200 | throw new OOPDException("Error fetching records for calculate interest"+e); 201 | } 202 | 203 | } 204 | 205 | public void calculateMonthInterest(int CurrentMonth,String account) throws OOPDException{ 206 | double tax=0; 207 | double sum = 0; 208 | double balance = 0; 209 | Connection con=Database.estabblishConnection(); //Making connection to the database 210 | try { 211 | con.setAutoCommit(false); 212 | PreparedStatement ps = con.prepareStatement("SELECT tax FROM admin"); 213 | ResultSet rs = ps.executeQuery(); 214 | if(rs.next()) 215 | tax=rs.getDouble(1); 216 | System.out.println(tax); 217 | ps = con.prepareStatement("SELECT * FROM abcd123_daily"); 218 | rs = ps.executeQuery(); 219 | if(rs.next()) { 220 | System.out.println(rs.getInt(1)); 221 | } 222 | System.out.println(sum); 223 | sum = sum -((sum*tax)/100); 224 | ps = con.prepareStatement("INSERT INTO "+account+"_monthly VALUES(?,?)"); 225 | ps.setInt(1, CurrentMonth); 226 | ps.setDouble(2, sum); 227 | ps.executeUpdate(); 228 | ps = con.prepareStatement("SELECT balance FROM accounts where account_number = ?"); 229 | ps.setString(1, account); 230 | rs = ps.executeQuery(); 231 | if(rs.next()) 232 | balance = rs.getDouble(1); 233 | ps = con.prepareStatement("UPDATE accounts set balance = ? where account_number = ?"); 234 | ps.setDouble(1, balance+sum); 235 | con.commit(); 236 | con.close(); 237 | } 238 | catch(Exception e) 239 | { 240 | throw new OOPDException("Error calculating monthly intrest"); 241 | } 242 | } 243 | } 244 | 245 | public boolean setInterestDB(AdminBean admin) throws OOPDException { 246 | Connection con=Database.estabblishConnection(); //Making connection to the database 247 | try { 248 | PreparedStatement ps = con.prepareStatement("UPDATE admin set interest = ? where username = ?"); 249 | ps.setDouble(1,admin.getInterest()); 250 | ps.setString(2, admin.getUsername()); 251 | ps.executeUpdate(); 252 | } 253 | catch(Exception e) 254 | { 255 | throw new OOPDException("error updating interest"+e); 256 | } 257 | return false; 258 | } 259 | public double getInterestDB(AdminBean admin) throws OOPDException { 260 | Connection con=Database.estabblishConnection(); //Making connection to the database 261 | double interest=0.0; 262 | try { 263 | PreparedStatement ps = con.prepareStatement("SELECT interest FROM admin WHERE username = ?"); 264 | ps.setString(1, admin.getUsername()); 265 | ResultSet rs = ps.executeQuery(); 266 | if(rs.next()) 267 | interest=rs.getDouble(1); 268 | } 269 | catch(Exception e) 270 | { 271 | throw new OOPDException("error updating interest"+e); 272 | } 273 | admin.setInterest(interest); 274 | return interest; 275 | } 276 | public boolean setTaxDB(AdminBean admin) throws OOPDException{ 277 | Connection con=Database.estabblishConnection(); //Making connection to the database 278 | try { 279 | PreparedStatement ps = con.prepareStatement("UPDATE admin set tax = ? where username = ?"); 280 | ps.setDouble(1,admin.getInterest()); 281 | ps.setString(2, admin.getUsername()); 282 | ps.executeUpdate(); 283 | } 284 | catch(Exception e) 285 | { 286 | throw new OOPDException("error updating interest"+e); 287 | } 288 | return false; 289 | 290 | } 291 | public double getTaxDB(AdminBean admin) throws OOPDException{ 292 | Connection con=Database.estabblishConnection(); //Making connection to the database 293 | double interest=0.0; 294 | try { 295 | PreparedStatement ps = con.prepareStatement("SELECT tax FROM admin WHERE username = ?"); 296 | ps.setString(1, admin.getUsername()); 297 | ResultSet rs = ps.executeQuery(); 298 | if(rs.next()) 299 | interest=rs.getDouble(1); 300 | } 301 | catch(Exception e) 302 | { 303 | throw new OOPDException("error updating interest"+e); 304 | } 305 | admin.setTax(interest); 306 | return interest; 307 | 308 | } 309 | public String showReport(String accountNumber) throws OOPDException{ 310 | 311 | Connection con=Database.estabblishConnection(); //Making connection to the database 312 | System.out.println(accountNumber); 313 | String results=null; 314 | try { 315 | PreparedStatement ps = con.prepareStatement("SELECT * FROM accounts WHERE account_number = ?"); 316 | ps.setString(1, accountNumber); 317 | ResultSet rs = ps.executeQuery(); 318 | if(rs.next()) 319 | { 320 | PreparedStatement p = con.prepareStatement("SELECT * FROM "+accountNumber+"_monthly"); 321 | ResultSet r = p.executeQuery(); 322 | r.next(); 323 | String x=r.getString(1)+" "+r.getString(2)+"\n"; 324 | while(r.next()) 325 | { 326 | x+=r.getString(1)+" "+r.getString(2)+"\n"; 327 | } 328 | results = x; 329 | } 330 | else 331 | results = "None"; 332 | } 333 | catch(Exception e) 334 | { 335 | throw new OOPDException("Show report error"+e); 336 | } 337 | return results; 338 | 339 | } 340 | } 341 | -------------------------------------------------------------------------------- /src/main/java/com/demo/OOPD_Project/dao/DepositDAO.java: -------------------------------------------------------------------------------- 1 | package com.demo.OOPD_Project.dao; 2 | 3 | import java.sql.Connection; 4 | import java.sql.PreparedStatement; 5 | 6 | import com.demo.OOPD_Project.Bean.AccountBean; 7 | import com.demo.OOPD_Project.DBUtil.Database; 8 | import com.demo.OOPD_Project.exception.OOPDException; 9 | 10 | public class DepositDAO extends AccountDAO{ 11 | public int doDepsit(AccountBean account,double amount) throws OOPDException 12 | { 13 | Connection con=Database.estabblishConnection(); //Making connection to the database 14 | int status = 0; 15 | try { 16 | con.setAutoCommit(false); 17 | if((account.getBalance()+amount)>5000000) 18 | status = 1; 19 | else if(amount<0) 20 | status = 2; 21 | else { 22 | PreparedStatement ps = con.prepareStatement(IQuerryMapper.DEPOSIT); 23 | ps.setDouble(1, account.getBalance()+amount); 24 | ps.setString(2, account.getCustomer().getAccountNumber()); 25 | ps.executeUpdate(); 26 | account.setBalance(account.getBalance()+amount); 27 | status = 3; 28 | con.commit(); 29 | con.close(); 30 | } 31 | return status; 32 | } 33 | catch(Exception e) 34 | { 35 | throw new OOPDException("error withdrawing"+e); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/demo/OOPD_Project/dao/IAccountDAO.java: -------------------------------------------------------------------------------- 1 | package com.demo.OOPD_Project.dao; 2 | 3 | import com.demo.OOPD_Project.Bean.AccountBean; 4 | import com.demo.OOPD_Project.exception.OOPDException; 5 | 6 | public interface IAccountDAO { 7 | public void getBalanceFromDB(AccountBean account) throws OOPDException; 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/demo/OOPD_Project/dao/IAccountHolderDAO.java: -------------------------------------------------------------------------------- 1 | package com.demo.OOPD_Project.dao; 2 | 3 | import com.demo.OOPD_Project.Bean.AccountHolderBean; 4 | import com.demo.OOPD_Project.exception.OOPDException; 5 | 6 | public interface IAccountHolderDAO { 7 | public int ClientLogin(AccountHolderBean client) throws OOPDException; 8 | public boolean ClientLogout(AccountHolderBean client) throws OOPDException; 9 | public boolean addClient (AccountHolderBean client) throws OOPDException; 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/demo/OOPD_Project/dao/IAdminDAO.java: -------------------------------------------------------------------------------- 1 | package com.demo.OOPD_Project.dao; 2 | 3 | import com.demo.OOPD_Project.Bean.AdminBean; 4 | import com.demo.OOPD_Project.exception.OOPDException; 5 | 6 | public interface IAdminDAO { 7 | public int adminLogin(AdminBean admin) throws OOPDException; 8 | public boolean adminLogout(AdminBean admin) throws OOPDException; 9 | public boolean setInterestDB(AdminBean admin) throws OOPDException; 10 | public double getInterestDB(AdminBean admin) throws OOPDException; 11 | public boolean setTaxDB(AdminBean admin) throws OOPDException; 12 | public double getTaxDB(AdminBean admin) throws OOPDException; 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/demo/OOPD_Project/dao/IQuerryMapper.java: -------------------------------------------------------------------------------- 1 | package com.demo.OOPD_Project.dao; 2 | 3 | public interface IQuerryMapper { 4 | /*Client Queries */ 5 | public static final String SELECT_USER = "SELECT * FROM account_holders WHERE account_number=? and password=sha1(?)"; 6 | public static final String SET_ACTIVE_TRUE = "UPDATE account_holders SET active_session = true where account_number = ?"; 7 | public static final String LOGOUT_USER = "UPDATE account_holders set active_session = false where account_number = ?"; 8 | public static final String GET_CURR_ACC_NO = "SELECT * FROM current_account_number"; 9 | public static final String INC_ACC_NUM = "UPDATE current_account_number SET account_number = ? WHERE account_number = ?"; 10 | public static final String ADD_USER = "INSERT INTO account_holders VALUES(?,?,?,?,SHA1(?),false);"; 11 | public static final String ADD_INTO_ACCOUNT = "INSERT INTO accounts VALUES(?,0.0)"; 12 | 13 | /*Admin Queries*/ 14 | public static final String ADMIN_LOGIN = "SELECT * FROM admin where username = ? and password = sha1(?)"; 15 | public static final String SET_ACTIVE_TRUE_ADMIN = "UPDATE admin SET active_status=true where username = ?"; 16 | public static final String LOGOUT_ADMIN = "UPDATE admin set active_status = false where username = ?"; 17 | 18 | /*Account Queries*/ 19 | public static final String SET_BALANCE = "SELECT balance FROM accounts where account_number = ?"; 20 | 21 | /*Withdraw*/ 22 | public static final String WITHDRAW_ACCOUNT = "UPDATE accounts SET balance = ? WHERE account_number = ?"; 23 | 24 | /*DEPOSIT*/ 25 | public static final String DEPOSIT = "UPDATE accounts SET balance = ? WHERE account_number = ?"; 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/demo/OOPD_Project/dao/Withdraw.java: -------------------------------------------------------------------------------- 1 | package com.demo.OOPD_Project.dao; 2 | import java.sql.Connection; 3 | import java.sql.PreparedStatement; 4 | 5 | import com.demo.OOPD_Project.Bean.AccountBean; 6 | import com.demo.OOPD_Project.DBUtil.Database; 7 | import com.demo.OOPD_Project.exception.OOPDException; 8 | 9 | public class Withdraw extends AccountDAO{ 10 | public int doWithdraw(AccountBean account,double amount) throws OOPDException 11 | { 12 | Connection con=Database.estabblishConnection(); //Making connection to the database 13 | int status = 0; 14 | try { 15 | con.setAutoCommit(false); 16 | if(amount>=account.getBalance()) 17 | status = 1; 18 | else { 19 | PreparedStatement ps = con.prepareStatement(IQuerryMapper.WITHDRAW_ACCOUNT); 20 | ps.setDouble(1, account.getBalance()-amount); 21 | ps.setString(2, account.getCustomer().getAccountNumber()); 22 | ps.executeUpdate(); 23 | account.setBalance(account.getBalance()-amount); 24 | status = 2; 25 | con.commit(); 26 | con.close(); 27 | } 28 | return status; 29 | } 30 | catch(Exception e) 31 | { 32 | throw new OOPDException("error withdrawing"+e); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/demo/OOPD_Project/exception/OOPDException.java: -------------------------------------------------------------------------------- 1 | package com.demo.OOPD_Project.exception; 2 | 3 | /* 4 | * This is the root exception handling class for the whole project 5 | */ 6 | public class OOPDException extends Exception { 7 | 8 | private static final long serialVersionUID = 1L; 9 | public OOPDException() { 10 | // TODO Auto-generated constructor stub 11 | } 12 | public OOPDException(String message) { 13 | super(message); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/test/java/com/demo/OOPD_Project/AppTest.java: -------------------------------------------------------------------------------- 1 | package com.demo.OOPD_Project; 2 | 3 | import junit.framework.Test; 4 | import junit.framework.TestCase; 5 | import junit.framework.TestSuite; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class AppTest 11 | extends TestCase 12 | { 13 | /** 14 | * Create the test case 15 | * 16 | * @param testName name of the test case 17 | */ 18 | public AppTest( String testName ) 19 | { 20 | super( testName ); 21 | } 22 | 23 | /** 24 | * @return the suite of tests being tested 25 | */ 26 | public static Test suite() 27 | { 28 | return new TestSuite( AppTest.class ); 29 | } 30 | 31 | /** 32 | * Rigourous Test :-) 33 | */ 34 | public void testApp() 35 | { 36 | assertTrue( true ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/App.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/App.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/Bean/AccountBean.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/Bean/AccountBean.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/Bean/AccountHolderBean.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/Bean/AccountHolderBean.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/Bean/AdminBean.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/Bean/AdminBean.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/DBUtil/Database.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/DBUtil/Database.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/AddNewUser$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/AddNewUser$1.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/AddNewUser.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/AddNewUser.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/AdminWelcomeScreen$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/AdminWelcomeScreen$1.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/AdminWelcomeScreen$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/AdminWelcomeScreen$2.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/AdminWelcomeScreen$3.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/AdminWelcomeScreen$3.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/AdminWelcomeScreen$4.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/AdminWelcomeScreen$4.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/AdminWelcomeScreen$5.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/AdminWelcomeScreen$5.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/AdminWelcomeScreen$6.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/AdminWelcomeScreen$6.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/AdminWelcomeScreen.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/AdminWelcomeScreen.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/Admin_Login$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/Admin_Login$1.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/Admin_Login$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/Admin_Login$2.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/Admin_Login$3.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/Admin_Login$3.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/Admin_Login$4.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/Admin_Login$4.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/Admin_Login$5.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/Admin_Login$5.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/Admin_Login.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/Admin_Login.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/Deposit$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/Deposit$1.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/Deposit$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/Deposit$2.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/Deposit$3.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/Deposit$3.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/Deposit$4.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/Deposit$4.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/Deposit$5.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/Deposit$5.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/Deposit.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/Deposit.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/Home_Screen$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/Home_Screen$1.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/Home_Screen$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/Home_Screen$2.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/Home_Screen$3.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/Home_Screen$3.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/Home_Screen$4.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/Home_Screen$4.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/Home_Screen$5.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/Home_Screen$5.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/Home_Screen.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/Home_Screen.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/Login_Screen_Client$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/Login_Screen_Client$1.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/Login_Screen_Client$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/Login_Screen_Client$2.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/Login_Screen_Client$3.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/Login_Screen_Client$3.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/Login_Screen_Client$4.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/Login_Screen_Client$4.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/Login_Screen_Client$5.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/Login_Screen_Client$5.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/Login_Screen_Client$6.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/Login_Screen_Client$6.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/Login_Screen_Client.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/Login_Screen_Client.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/ShowReportGUI$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/ShowReportGUI$1.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/ShowReportGUI$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/ShowReportGUI$2.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/ShowReportGUI$3.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/ShowReportGUI$3.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/ShowReportGUI$4.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/ShowReportGUI$4.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/ShowReportGUI.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/ShowReportGUI.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/SignUp$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/SignUp$1.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/SignUp$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/SignUp$2.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/SignUp$3.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/SignUp$3.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/SignUp$4.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/SignUp$4.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/SignUp$5.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/SignUp$5.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/SignUp$6.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/SignUp$6.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/SignUp$7.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/SignUp$7.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/SignUp.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/SignUp.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/Welcome_user$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/Welcome_user$1.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/Welcome_user$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/Welcome_user$2.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/Welcome_user$3.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/Welcome_user$3.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/Welcome_user$4.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/Welcome_user$4.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/Welcome_user$5.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/Welcome_user$5.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/Welcome_user.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/Welcome_user.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/WithdrawForm$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/WithdrawForm$1.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/WithdrawForm$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/WithdrawForm$2.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/WithdrawForm$3.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/WithdrawForm$3.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/WithdrawForm$4.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/WithdrawForm$4.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/WithdrawForm$5.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/WithdrawForm$5.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/WithdrawForm$6.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/WithdrawForm$6.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/WithdrawForm.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/WithdrawForm.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/report$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/report$1.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/report$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/report$2.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/report.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/report.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/setInterestGUI$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/setInterestGUI$1.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/setInterestGUI$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/setInterestGUI$2.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/setInterestGUI$3.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/setInterestGUI$3.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/setInterestGUI$4.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/setInterestGUI$4.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/setInterestGUI$5.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/setInterestGUI$5.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/setInterestGUI.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/setInterestGUI.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/setTaxGUI$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/setTaxGUI$1.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/setTaxGUI$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/setTaxGUI$2.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/setTaxGUI$3.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/setTaxGUI$3.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/setTaxGUI$4.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/setTaxGUI$4.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/setTaxGUI$5.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/setTaxGUI$5.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/GUI/setTaxGUI.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/GUI/setTaxGUI.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/dao/AccountDAO.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/dao/AccountDAO.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/dao/AccountHolderDAO.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/dao/AccountHolderDAO.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/dao/AdminDAO$YourTask.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/dao/AdminDAO$YourTask.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/dao/AdminDAO.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/dao/AdminDAO.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/dao/DepositDAO.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/dao/DepositDAO.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/dao/IAccountDAO.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/dao/IAccountDAO.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/dao/IAccountHolderDAO.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/dao/IAccountHolderDAO.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/dao/IAdminDAO.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/dao/IAdminDAO.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/dao/IQuerryMapper.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/dao/IQuerryMapper.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/dao/Withdraw.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/dao/Withdraw.class -------------------------------------------------------------------------------- /target/classes/com/demo/OOPD_Project/exception/OOPDException.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/classes/com/demo/OOPD_Project/exception/OOPDException.class -------------------------------------------------------------------------------- /target/test-classes/com/demo/OOPD_Project/AppTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sushil97/Java-Bank-Application/f82ec103d2dba0fed3f1e23c9d19c5302675a2e5/target/test-classes/com/demo/OOPD_Project/AppTest.class --------------------------------------------------------------------------------