Advertisement
Metziop

Untitled

May 22nd, 2021
881
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.08 KB | None | 0 0
  1. private void btnModActionPerformed(java.awt.event.ActionEvent evt) {                                      
  2.  
  3.         int fila = jtAsignaciones.getSelectedRow();
  4.         String idTrabajo = jtAsignaciones.getValueAt(fila, 0).toString();
  5.         String condicional = jtAsignaciones.getValueAt(fila, 1).toString();
  6.         if ("terminado".equals(condicional)) {
  7.             try {
  8.  
  9.                 String querry = "UPDATE pedidosempleado SET estatus=? WHERE idPedidoEmpleado=?";
  10.                 String estatus = "autorizado";
  11.                 Connection conn = MySQLConection.getConnection();
  12.                 PreparedStatement ps = conn.prepareStatement(querry);
  13.                 ps.setString(1, estatus);
  14.                 ps.setString(2, idTrabajo);
  15.                 ps.executeUpdate();
  16.  
  17.             } catch (Exception e) {
  18.                 JOptionPane.showMessageDialog(null, "error" + e);
  19.             }
  20.         } else {
  21.             JOptionPane.showMessageDialog(null, "El pedido todavia no esta termiando");
  22.         }
  23.  
  24.         actualizartabla();
  25.  
  26.  
  27.     }                                
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement