Package club.beans

Examples of club.beans.MembershipTypeBean


        try {
            conn = ConnectDB.connectMSDB();
            stmt = conn.createStatement();
            rs = stmt.executeQuery(query);
            while (rs.next()) {
                MembershipTypeBean membership = new MembershipTypeBean();
                membership.setMembershipTypeID(rs.getInt("MembershipTypeID"));
                membership.setTypeName(rs.getNString("TypeName"));
                membership.setFee(rs.getDouble("Fee"));
                membership.setMin_Attendance(rs.getInt("Min_Attendance"));
                membership.setMain_Duty(rs.getNString("Main_Duty"));
                membership.setDiscount(rs.getInt("Discount"));
                list.add(membership);
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
View Full Code Here


        if (selectedRow == -1) {
            JOptionPane.showMessageDialog(rootPane, "You must chose one membership type first!", "Error!", JOptionPane.ERROR_MESSAGE);
        } else {
            int id = (int) tblMembership.getModel().getValueAt(selectedRow, 0);
            DataMembership dataMembership = new DataMembership();
            MembershipTypeBean bean = dataMembership.getTypeByID(id);
            txtTypeName.setText(bean.getTypeName());
            txtMainDuty.setText(bean.getMain_Duty());
            spinFee.setValue(bean.getFee());
            spinMinAttendance.setValue(bean.getMin_Attendance());
            spinDiscount.setValue(bean.getDiscount());
            txtHiddenID.setText(String.valueOf(bean.getMembershipTypeID()));
            panelForm.setVisible(true);
            this.setSize(this.getWidth(), 450);
            actionFlag = "Update";
        }
    }//GEN-LAST:event_btn_UpdateActionPerformed
View Full Code Here

        }
        return model;
    }

    public MembershipTypeBean getTypeByID(int id) {
        MembershipTypeBean bean = null;
        String query = "SELECT * FROM MembershipType"
                + " WHERE MembershipTypeID=" + id;
        try {
            conn = ConnectDB.connectMSDB();
            stmt = conn.createStatement();
            rs = stmt.executeQuery(query);
            if (rs.next()) {
                bean = new MembershipTypeBean();
                bean.setMembershipTypeID(rs.getInt("MembershipTypeID"));
                bean.setTypeName(rs.getNString("TypeName"));
                bean.setFee(rs.getDouble("Fee"));
                bean.setMin_Attendance(rs.getInt("Min_Attendance"));
                bean.setMain_Duty(rs.getNString("Main_Duty"));
                bean.setDiscount(rs.getInt("Discount"));
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            try {
View Full Code Here

TOP

Related Classes of club.beans.MembershipTypeBean

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.