private void btnNuevoActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_btnNuevoActionPerformed // TODO add your handling code here: // System.out.println("nuevo"); if (profile.getProCode() == null) { GeneralFunctions.sendMessage(this, "Favor de teclear el codigo del Perfil"); return; } if (profile.getProName() == null) { GeneralFunctions.sendMessage(this, "Favor de teclear el nombre del Perfil"); return; } if (proStatus.getSelectedIndex() == 0) { GeneralFunctions.sendMessage(this, "Favor de seleccionar un Estatus"); return; } profile.setProDteMod(new Date()); // profile.setProUsrMod(topFrame.getMainUser().getUsrId()); profile.setProUsrMod(topFrame.getMainUser()); if (profileBoundary.insert(profile) == 1) { JOptionPane.showMessageDialog(this, UIConstants.SUCCESS_SAVE); } btnLimpiarActionPerformed(null); } // GEN-LAST:event_btnNuevoActionPerformed
private void btnBuscarActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_btnBuscarActionPerformed System.out.println(profile.getProStatus()); resultList = profileBoundary.search(profile); fillTable(resultTable); formManager.updateButtonMenuState(UIConstants.BTN_BUSCAR); } // GEN-LAST:event_btnBuscarActionPerformed
private void btnEliminarActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_btnEliminarActionPerformed // TODO add your handling code here: System.out.println("eliminar"); int dialogResult = JOptionPane.showConfirmDialog( this, UIConstants.CONFIRM_DELETE, UIConstants.TYPE_WARNING, JOptionPane.YES_NO_OPTION); if (dialogResult == JOptionPane.YES_OPTION) { if (profileBoundary.delete(profile) == 1) { JOptionPane.showMessageDialog(this, UIConstants.SUCCESS_DELETE); } } btnLimpiarActionPerformed(null); } // GEN-LAST:event_btnEliminarActionPerformed
private void btnGuardarActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_btnGuardarActionPerformed // TODO add your handling code here: System.out.println("guardar"); if (profile.getProId() != null) { profile.setProDteMod(new Date()); // profile.setProUsrMod(topFrame.getMainUser().getUsrId()); profile.setProUsrMod(topFrame.getMainUser()); if (profileBoundary.update(profile) == 1) { JOptionPane.showMessageDialog(this, UIConstants.SUCCESS_UPDATE); } } btnLimpiarActionPerformed(null); } // GEN-LAST:event_btnGuardarActionPerformed
// <editor-fold defaultstate="collapsed" desc=" operaciones de tarea "> private List<Profiles> searchAll() { return profileBoundary.searchAll(new Profiles()); }