Package club.beans

Examples of club.beans.ConfigBean


            AdministratorBean auth = DataAdmin.getAuthentication(acc);
            if (auth != null && pass.equals(auth.getPassword())) {
                String name = auth.getFullname();
                //JOptionPane.showMessageDialog(rootPane, "Hello "+name, "Error!", JOptionPane.ERROR_MESSAGE);
                DataConfig dataConfig = new DataConfig();
                ConfigBean config = dataConfig.readConfigFile();
                config.setAdminAccount(acc);
                config.setAdminID(auth.getAdminID());
                if (dataConfig.writeConfigFile(config)){
                    new MainFrame();
                } else{
                    JOptionPane.showMessageDialog(rootPane, "Error! Click OK to exit application", "Error!", JOptionPane.ERROR_MESSAGE);
                    System.exit(0);
View Full Code Here


        return errors;
    }
    private void addEvent(){
        DataConfig dataConfig = new DataConfig();
        try{
            ConfigBean config = dataConfig.readConfigFile();
            String name = tfName.getText();
            int accountID = config.getAdminID();
            String des = taDescription.getText();
            java.util.Date date = calDate.getDate();
            float duration = Float.parseFloat(tfTime.getText());
            String venue = tfVenue.getText();
            int type = ((EventTypeBean)cbbEventType.getSelectedItem()).getEventType();
View Full Code Here

    public static Connection conn = null;

    public static Connection connectMSDB() throws ClassNotFoundException {
        try {
            DataConfig data = new DataConfig();
            ConfigBean bean = new ConfigBean();
            try{
                bean = data.readConfigFile();
            } catch(Exception e){
                (new ConnectDBDialog()).setVisible(true);
                return null;
            }
            Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
            String connectionUrl = "jdbc:sqlserver://" + bean.getDBServer()  + bean.getDBPort() + ";"
                    + "databaseName=" + bean.getDBName() + ";user=" + bean.getDBUser() + ";password=" + bean.getDBPass() + ";";
            conn = DriverManager.getConnection(connectionUrl);
        } catch (SQLException ex) {
            Logger.getLogger(ConnectDB.class.getName()).log(Level.SEVERE, null, ex);
            JOptionPane.showMessageDialog(null, "Connect Database is failed");
        } catch (NullPointerException e){
View Full Code Here

            return false;
        }
    }
   
    public int getCurrentAdminID(){
        ConfigBean config = readConfigFile();
        return config.getAdminID();
    }
View Full Code Here

        ConfigBean config = readConfigFile();
        return config.getAdminID();
    }
    public  boolean isRightConfig(){
        try{
            ConfigBean config = readConfigFile();
            if (IsValidDBInfo(config)){
                return true;
            } else{
                (new ConnectDBDialog()).setVisible(true);
                return false;
View Full Code Here

        int adminID = configBean.getAdminID();
        return DataAdmin.isExistID(admin, adminID);
    }
    public boolean isFullControlAdmin(){
        try{
            ConfigBean config = readConfigFile();
            AdministratorBean admin = DataAdmin.getAdminByID(config.getAdminID());
            return (admin.getStatus()== 2) ? true: false;
        } catch (Exception e){
            e.printStackTrace();
            return false;
        }
View Full Code Here

            e.printStackTrace();
            return false;
        }
    }
    public ConfigBean readConfigFile(){
        ConfigBean config;
        if (!isConfigFileExist())
            return null;
        try{
            FileInputStream fin = new FileInputStream(configFile);
            ObjectInputStream ois = new ObjectInputStream(fin);
View Full Code Here

        String pass = txtPassword.getText().trim().toLowerCase();
       
        if (ConnectDB.testConnect(host, port, user, pass, name)){
            //can connect, now write the info to config file
            DataConfig dataConfig =  new DataConfig();
            ConfigBean configBean = new ConfigBean();
            configBean.setDBName(name);
            configBean.setDBPass(pass);
            configBean.setDBUser(user);
            configBean.setDBServer(host);
            configBean.setDBPort(port);
            if(dataConfig.writeConfigFile(configBean)){
                //write successfully
                new MainFrame();
                this.dispose();
            } else{
View Full Code Here

                DataTransaction dataTransaction = new DataTransaction();
                EventBean event = dataEvent.getEventByID(eventID);

                //tru tien
                DataConfig dataConfig = new DataConfig();
                ConfigBean config = dataConfig.readConfigFile();
                int admin = config.getAdminID();
                MemberBean member = (MemberBean)unjoiners.get(listUnjoiner.getSelectedIndex());
                String des = "Pay fee to join event: " + event.getDescription();
                Double fee = (type == 0) ? event.getFee() : 0.0;
                if (member.getBalance() >= fee || type !=0){
                    if (dataTransaction.insertTrans(admin, member.getMemberID(), des, 0.0-fee)){
View Full Code Here

                DataTransaction dataTransaction = new DataTransaction();
                EventBean event = dataEvent.getEventByID(eventID);

                //tru tien
                DataConfig dataConfig = new DataConfig();
                ConfigBean config = dataConfig.readConfigFile();
                int admin = config.getAdminID();
                MemberBean member = (MemberBean)joiners.get(listJoiner.getSelectedIndex());
                String des = "Return fee of event: " + event.getDescription();
                int type = member.getJoinType();
                Double fee = (type == 0) ? event.getFee() : 0.0;
                if (dataAttendance.removeAttendance(eventID, member.getMemberID())){
View Full Code Here

TOP

Related Classes of club.beans.ConfigBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.