Package club.data

Examples of club.data.DataEventType


    /**
     * Creates new form MembershipDialog
     */
    private void refreshData() throws SQLException {
        DataEventType dataType = new DataEventType();
        DefaultTableModel model = dataType.getAllTypesAsModel();
        tblEventType.setModel(model);
    }
View Full Code Here


        int selectedRow = tblEventType.getSelectedRow();
        if (selectedRow == -1) {
            JOptionPane.showMessageDialog(rootPane, "You must chose one event type first!", "Error!", JOptionPane.ERROR_MESSAGE);
        } else {
            int id = (int) tblEventType.getModel().getValueAt(selectedRow, 0);
            DataEventType dateEventType = new DataEventType();
            EventTypeBean bean = dateEventType.getEventTypeByID(id);
            txtTypeName.setText(bean.getType());
            txtHiddenID.setText(String.valueOf(bean.getEventType()));
            panelForm.setVisible(true);
            this.setSize(this.getWidth(), 400);
            actionFlag = "Update";
View Full Code Here

        }
    }//GEN-LAST:event_btn_DeleteActionPerformed

    private void btn_SubmitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_SubmitActionPerformed
        if (Validator.checkIsNotEmpty(txtTypeName.getText())) {
            DataEventType dataType = new DataEventType();
            if (actionFlag.equals("Update")) {
                try {
                    int id = Integer.parseInt(txtHiddenID.getText());
                    dataType.updateTypeByID(id, txtTypeName.getText().trim());
                    panelForm.setVisible(false);
                    this.setSize(this.getWidth(), 290);
                    refreshData();
                } catch (SQLException ex) {
                    Logger.getLogger(EventType.class.getName()).log(Level.SEVERE, null, ex);
                    JOptionPane.showMessageDialog(rootPane, "Error Updating !", "Error!", JOptionPane.ERROR_MESSAGE);
                }
            }
            if (actionFlag.equals("Add")) {
                try {
                   
                    dataType.insertEventType(txtTypeName.getText().trim());
                    panelForm.setVisible(false);
                    this.setSize(this.getWidth(), 290);
                    refreshData();
                   
                } catch (SQLException ex) {
View Full Code Here

TOP

Related Classes of club.data.DataEventType

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.