private void loginJButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_loginJButtonMouseClicked
        /*
        *If the login button is clicked then collect data entered in form and
        *login user.
        */
        String email = emailJFrield.getText();
        String password = new String(passwordJField.getPassword());
        
        int user_id = Auth.login(email,password);
        if(user_id == -1)  {
            JOptionPane.showMessageDialog(mainJFrame, 
                    "Username or password is not correct.",
                    "Login Error",  JOptionPane.ERROR_MESSAGE);
        }
        else {
        /*
        * From the user id get the user type and redirect them to the correct
        * main page
        */        
            String user_type = User.getType(user_id);
            switch(user_type){
                case "admin":
                    break;
                case "csa":
                    RegularCSA csaUser = new RegularCSA(user_id);
                    
                    //if its a CSA then destroy the current pannel and open another
                    mainJFrame.getContentPane().remove(this);

                    CSAMainMenu csaMainMenu = new CSAMainMenu(mainJFrame,csaUser);
                    mainJFrame.getContentPane().add(csaMainMenu);

                    mainJFrame.getContentPane().invalidate();
                    mainJFrame.getContentPane().revalidate();
                    mainJFrame.getContentPane().repaint();
                    break;
                case "customer":
                    break;
                case "merchant":
                    break;
            }            
        }               
    }//GEN-LAST:event_loginJButtonMouseClicked