}
}//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) {