Package club.beans

Examples of club.beans.MemberBean


        init();
    }

    private void init() {
        lbError.setText("");
        MemberBean member = DataMember.getMemberByID(memberID);
        lbConfirmInfo.setText("User No. " + member.getMemberID() + ": " + member.getFirstName());
        lbOldValue.setText(String.format("%1$,.1f", member.getBalance()));
        lbNewValue.setText(String.format("%1$,.1f", member.getBalance()));
    }
View Full Code Here


                //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)){
                        int transID = dataTransaction.getMaxID( member.getMemberID());
                        dataAttendance.makeAttendance(eventID, member.getMemberID(), type, transID);
                        JOptionPane.showMessageDialog(this, "Successfully added");
                        updateListUnjoiner();
                        updateListJoiner();
                    } else{
                        JOptionPane.showMessageDialog(this, "Error make transaction!");
View Full Code Here

                //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())){
                    dataTransaction.insertTrans(admin,member.getMemberID(),des, fee);
                    joiners.remove(member);
                    JOptionPane.showMessageDialog(this, "Successfully removed");
                    updateListUnjoiner();
                    updateListJoiner();
                } else{
View Full Code Here

        }
        return errors;
    }

    private void fillMemberInfoToForm(int id) {
        MemberBean mem = new MemberBean();
        mem = DataMember.getMemberByID(id);
        index = id;

        comboMembership.removeAllItems();
        List<MembershipTypeBean> listType = new ArrayList();
        listType = DataMembership.getAllTypes();
        for (MembershipTypeBean bean : listType) {
            comboMembership.addItem(bean);
        }
        comboMembership.setSelectedItem(mem);
        comboTitle.setSelectedIndex(mem.getTitle());
        txtFirstName.setText(mem.getFirstName());
        txtLastName.setText(mem.getLastName());
        txtNickname.setText(mem.getNickname());
        txtAddress.setText(mem.getAddress());
        txtPhone.setText(mem.getPhone());
        txtEmail.setText(mem.getEmail());
        txtDateOfBirth.setDate(mem.getDateOfBirth());
        txtCompany.setText(mem.getCompany());
        comboStatus.setSelectedIndex(mem.getStatus());
        txtDescription.setText(mem.getDescription());

        Double balance = mem.getBalance();
        txtBalance.setText(String.format("%1$,.1f", balance) + "$");
    }
View Full Code Here

    }//GEN-LAST:event_btnUpdateActionPerformed

    private void btnAddMoneyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAddMoneyActionPerformed
        // TODO add your handling code here:
        (new updateBalance(null, rootPaneCheckingEnabled, MemberID)).setVisible(true);
        MemberBean mem = new MemberBean();
        mem = DataMember.getMemberByID(MemberID);
        Double balance = mem.getBalance();
        txtBalance.setText(balance.toString() + "$");
    }//GEN-LAST:event_btnAddMoneyActionPerformed
View Full Code Here

            conn = ConnectDB.connectMSDB();
            psmt = conn.prepareStatement(query);
            psmt.setInt(1, id);
            rs = psmt.executeQuery();
            while (rs.next()) {
                MemberBean member = new MemberBean();
                member.setMemberID(rs.getInt("MemberID"));
                member.setMembershipTypeID(rs.getInt("MemberShipTypeID"));
                member.setEmail(rs.getString("Email"));
                member.setBalance(rs.getDouble("Balance"));
                member.setStatus(rs.getInt("Status"));
                member.setTitle(rs.getInt("Title"));
                member.setFirstName(rs.getNString("FirstName"));
                member.setLastName(rs.getNString("LastName"));
                member.setNickname(rs.getNString("Nickname"));
                member.setAddress(rs.getNString("Address"));
                member.setDateOfBirth(rs.getDate("DateOfBirth"));
                member.setDescription(rs.getNString("Description"));
                member.setPhone(rs.getString("Phone"));
                member.setCompany(rs.getString("Company"));
                member.setJoinType(4);
                list.add(member);
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
View Full Code Here

            conn = ConnectDB.connectMSDB();
            psmt = conn.prepareStatement(query);
            psmt.setInt(1, id);
            rs = psmt.executeQuery();
            while (rs.next()) {
                MemberBean member = new MemberBean();
                member.setMemberID(rs.getInt("MemberID"));
                member.setMembershipTypeID(rs.getInt("MemberShipTypeID"));
                member.setEmail(rs.getString("Email"));
                member.setBalance(rs.getDouble("Balance"));
                member.setStatus(rs.getInt("Status"));
                member.setTitle(rs.getInt("Title"));
                member.setFirstName(rs.getNString("FirstName"));
                member.setLastName(rs.getNString("LastName"));
                member.setNickname(rs.getNString("Nickname"));
                member.setAddress(rs.getNString("Address"));
                member.setDateOfBirth(rs.getDate("DateOfBirth"));
                member.setDescription(rs.getNString("Description"));
                member.setPhone(rs.getString("Phone"));
                member.setCompany(rs.getString("Company"));
                list.add(member);
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
View Full Code Here

        try {
            conn = ConnectDB.connectMSDB();
            stmt = conn.createStatement();
            rs = stmt.executeQuery(query);
            while (rs.next()) {
                MemberBean member = new MemberBean();
                member.setMemberID(rs.getInt("MemberID"));
                member.setMembershipTypeID(rs.getInt("MemberShipTypeID"));
                member.setEmail(rs.getString("Email"));
                member.setBalance(rs.getDouble("Balance"));
                member.setStatus(rs.getInt("Status"));
                member.setTitle(rs.getInt("Title"));
                member.setFirstName(rs.getNString("FirstName"));
                member.setLastName(rs.getNString("LastName"));
                member.setNickname(rs.getNString("Nickname"));
                member.setAddress(rs.getNString("Address"));
                member.setDateOfBirth(rs.getDate("DateOfBirth"));
                member.setDescription(rs.getNString("Description"));
                member.setPhone(rs.getString("Phone"));
                member.setCompany(rs.getString("Company"));
                list.add(member);
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
View Full Code Here

        try {
            conn = ConnectDB.connectMSDB();
            stmt = conn.createStatement();
            rs = stmt.executeQuery(query);
            while (rs.next()) {
                MemberBean member = new MemberBean();
                member.setMemberID(rs.getInt("MemberID"));
                member.setMembershipTypeID(rs.getInt("MemberShipTypeID"));
                member.setEmail(rs.getString("Email"));
                member.setBalance(rs.getDouble("Balance"));
                member.setStatus(rs.getInt("Status"));
                member.setTitle(rs.getInt("Title"));
                member.setFirstName(rs.getNString("FirstName"));
                member.setLastName(rs.getNString("LastName"));
                member.setNickname(rs.getNString("Nickname"));
                member.setAddress(rs.getNString("Address"));
                member.setDateOfBirth(rs.getDate("DateOfBirth"));
                member.setDescription(rs.getNString("Description"));
                member.setPhone(rs.getString("Phone"));
                member.setCompany(rs.getString("Company"));
                list.add(member);
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
View Full Code Here

        }
        return list;
    }

    public static MemberBean getMemberByID(int id) { // find a member by ID and return as Bean
        MemberBean member = null;
        String query = "SELECT * FROM Member WHERE MemberID=" + id;
        try {
            conn = ConnectDB.connectMSDB();
            stmt = conn.createStatement();
            rs = stmt.executeQuery(query);
            if (rs.next()) {
                member = new MemberBean();
                member.setMemberID(rs.getInt("MemberID"));
                member.setMembershipTypeID(rs.getInt("MemberShipTypeID"));
                member.setEmail(rs.getString("Email"));
                member.setBalance(rs.getDouble("Balance"));
                member.setStatus(rs.getInt("Status"));
                member.setTitle(rs.getInt("Title"));
                member.setFirstName(rs.getNString("FirstName"));
                member.setLastName(rs.getNString("LastName"));
                member.setNickname(rs.getNString("Nickname"));
                member.setAddress(rs.getNString("Address"));
                member.setDateOfBirth(rs.getDate("DateOfBirth"));
                member.setDescription(rs.getNString("Description"));
                member.setPhone(rs.getString("Phone"));
                member.setCompany(rs.getString("Company"));
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            try {
View Full Code Here

TOP

Related Classes of club.beans.MemberBean

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.