示例#1
0
  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
示例#2
0
  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