Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void btnAsignarActionPerformed(java.awt.event.ActionEvent evt) {
- try {
- //String user1=loginSesion.user;
- String querry=("INSERT INTO pedidosempleado (estatus, tiempoEstimado, numeroEmpleado, idArreglo, user,comision1, sucursal1) values(?,?,?,?,?,?,?)");
- Connection conn = MySQLConection.getConnection();
- PreparedStatement ps = conn.prepareStatement(querry);
- String estatus="asignado";
- String sucursal1= "Matriz";
- int fila = jtArreglos.getSelectedRow();
- String tiempoElavoracion = jtArreglos.getValueAt(fila, 2).toString();
- String idArreglo = jtArreglos.getValueAt(fila, 0).toString();
- int fila2 = jtEmpleados.getSelectedRow();
- String numEmpleado = jtEmpleados.getValueAt(fila2, 0).toString();
- String user =jtEmpleados.getValueAt(fila2, 2).toString();
- ps.setString(1, estatus);
- ps.setString(2, tiempoElavoracion);
- ps.setInt(3, Integer.parseInt(numEmpleado));
- ps.setInt(4, Integer.parseInt(idArreglo));
- ps.setString(5, user);
- ps.setDouble(6, Double.valueOf(txtcomision.getText()));
- ps.setString(7, sucursal1);
- int res= ps.executeUpdate();
- //insertarcomision();
- if(res>0){
- JOptionPane.showMessageDialog(null, "Trabajo asignado correctamente");
- }else{JOptionPane.showMessageDialog(null, "Error al asignar trabajo");}
- conn.close();
- } catch (Exception e) {
- JOptionPane.showMessageDialog(null,"error"+e);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement