Metziop

Untitled

May 20th, 2021
818
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.98 KB | None | 0 0
  1.  
  2.     private void btnStopActionPerformed(java.awt.event.ActionEvent evt) {                                        
  3.         this.btnStart.setEnabled(true);
  4.  
  5.         tiempo.stop();
  6.  
  7.         try {
  8.  
  9.             int fila = jtAsignaciones.getSelectedRow();
  10.             String idTrabajo = jtAsignaciones.getValueAt(fila, 0).toString();
  11.  
  12.             String querry = "UPDATE pedidosempleado SET horaTermino=?, estatus=? WHERE idPedidoEmpleado=?";
  13.             Connection conn = MySQLConection.getConnection();
  14.             PreparedStatement ps = conn.prepareStatement(querry);
  15.             String estatus = "terminado";
  16.  
  17.             ps.setTime(1, Time.valueOf(LocalTime.now()));
  18.             ps.setString(2, estatus);
  19.             ps.setString(3, idTrabajo);
  20.             ps.executeUpdate();
  21.         } catch (Exception e) {
  22.             JOptionPane.showMessageDialog(null, "error" + e);
  23.         }
  24.         String user = loginSesion.user;
  25.         actualizartabla(user);
  26.  
  27.  
  28.     }                  
Advertisement
Add Comment
Please, Sign In to add comment