private void sitemagregarMousePressed( java.awt.event.MouseEvent evt) { // GEN-FIRST:event_sitemagregarMousePressed try { objPerol = new PermisoshasRolesDAO(); int idrol = Integer.parseInt(lblidrol.getText()); int idmod = Integer.parseInt( qs.idChoice("modulos", "nombre", String.valueOf(CboModulo.getSelectedItem()))); objPerol.save(idrol, idmod); objPerol.find(lblidrol.getText(), Jtablepermi, lblcant); } catch (Exception e) { } } // GEN-LAST:event_sitemagregarMousePressed
private void jMenuItem2MousePressed( java.awt.event.MouseEvent evt) { // GEN-FIRST:event_jMenuItem2MousePressed objPerol = new PermisoshasRolesDAO(); int fsel; fsel = this.Jtablepermi.getSelectedRow(); if (fsel == -1) { JOptionPane.showMessageDialog(null, "Seleccione un modulo para proceder a la accion"); } else { try { DefaultTableModel m = new DefaultTableModel(); m = (DefaultTableModel) this.Jtablepermi.getModel(); String modulo = (String.valueOf(m.getValueAt(fsel, 0))); int idrol = Integer.parseInt(lblidrol.getText()); int id_mod = Integer.parseInt(qs.idChoice("modulos", "nombre", modulo)); objPerol.delete(idrol, id_mod); objPerol.find(lblidrol.getText(), Jtablepermi, lblcant); } catch (Exception e) { System.out.println("Error producido en seleccion de modulo" + e); } } } // GEN-LAST:event_jMenuItem2MousePressed
public void cargaForm() { qs = new Query(); objPerol = new PermisoshasRolesDAO(); lblidrol.setVisible(false); qs.loadChoice(CboModulo, "modulos", "nombre"); }