Skip to content
Snippets Groups Projects
Commit e024272a authored by El_Pouleto's avatar El_Pouleto
Browse files

debut

parent eabc96a7
Branches
No related tags found
No related merge requests found
Showing
with 731 additions and 17 deletions
No preview for this file type
No preview for this file type
......@@ -29,5 +29,23 @@
<artifactId>jcalendar</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20200518</version>
<type>bundle</type>
</dependency>
<dependency>
<groupId>com.vaadin.external.google</groupId>
<artifactId>android-json</artifactId>
<version>0.0.20131108.vaadin1</version>
<type>jar</type>
</dependency>
</dependencies>
</project>
\ No newline at end of file
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.mycompany.disenosoftwareproject.interfaz.pares_vista_control;
/**
*
* @author el_pouleto
*/
public class CrtlVistaRegistrarse {
}
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="168" max="-2" attributes="0"/>
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="74" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="consultarVacaciones" min="-2" max="-2" attributes="0"/>
<Component id="consultarDatos" min="-2" max="-2" attributes="0"/>
<Component id="attenderLlamada" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
<EmptySpace pref="92" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace pref="9" max="32767" attributes="0"/>
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="consultarDatos" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="consultarVacaciones" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="attenderLlamada" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="65" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="text" type="java.lang.String" value="Operador"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="consultarDatos">
<Properties>
<Property name="text" type="java.lang.String" value="Consultar mis datos en la empresa"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="consultarVacaciones">
<Properties>
<Property name="text" type="java.lang.String" value="Consultar vacaciones"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="consultarVacacionesActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="attenderLlamada">
<Properties>
<Property name="text" type="java.lang.String" value="Attender llamada"/>
</Properties>
</Component>
</SubComponents>
</Form>
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JPanel.java to edit this template
*/
package com.mycompany.disenosoftwareproject.interfaz.pares_vista_control;
import javax.swing.JFrame;
public class ViewOperador extends javax.swing.JPanel {
public ViewOperador(String rol) {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
consultarDatos = new javax.swing.JButton();
consultarVacaciones = new javax.swing.JButton();
attenderLlamada = new javax.swing.JButton();
jLabel1.setText("Operador");
consultarDatos.setText("Consultar mis datos en la empresa");
consultarVacaciones.setText("Consultar vacaciones");
consultarVacaciones.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
consultarVacacionesActionPerformed(evt);
}
});
attenderLlamada.setText("Attender llamada");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(168, 168, 168)
.addComponent(jLabel1))
.addGroup(layout.createSequentialGroup()
.addGap(74, 74, 74)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(consultarVacaciones)
.addComponent(consultarDatos)
.addComponent(attenderLlamada))))
.addContainerGap(92, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap(9, Short.MAX_VALUE)
.addComponent(jLabel1)
.addGap(18, 18, 18)
.addComponent(consultarDatos)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(consultarVacaciones)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(attenderLlamada)
.addContainerGap(65, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents
private void consultarDatosActionPerformed(java.awt.event.ActionEvent evt) {
// Ne fait rien
}
private void consultarVacacionesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_consultarVacacionesActionPerformed
// Ne fait rien
}//GEN-LAST:event_consultarVacacionesActionPerformed
/* A modifier quand nom de la 2e partie
private void attenderLlamadaActionPerformed(){
JFrame frame = new JFrame("Attender Llamada");
frame.setContentPane(new Vista####());
frame.pack();
frame.setVisible(true);
}
*/
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton attenderLlamada;
private javax.swing.JButton consultarDatos;
private javax.swing.JButton consultarVacaciones;
private javax.swing.JLabel jLabel1;
// End of variables declaration//GEN-END:variables
}
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="130" max="-2" attributes="0"/>
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="103" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="consultarVacaciones" min="-2" max="-2" attributes="0"/>
<Component id="consultarDatos" min="-2" max="-2" attributes="0"/>
<Component id="consultarEmergencia" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="consultarTurnos" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="solicitarCambioTurno" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
<EmptySpace pref="63" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="consultarDatos" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="consultarVacaciones" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="consultarEmergencia" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="consultarTurnos" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="solicitarCambioTurno" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="100" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="text" type="java.lang.String" value="Personal de Operativo"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="consultarDatos">
<Properties>
<Property name="text" type="java.lang.String" value="Consultar mis datos en la empresa"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="consultarVacaciones">
<Properties>
<Property name="text" type="java.lang.String" value="Consultar vacaciones"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="consultarEmergencia">
<Properties>
<Property name="text" type="java.lang.String" value="Concultar emergencia atendidas"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="consultarTurnos">
<Properties>
<Property name="text" type="java.lang.String" value="Concultar mis turnos"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="solicitarCambioTurno">
<Properties>
<Property name="text" type="java.lang.String" value="Solicitar cambio de turno"/>
</Properties>
</Component>
</SubComponents>
</Form>
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JPanel.java to edit this template
*/
package com.mycompany.disenosoftwareproject.interfaz.pares_vista_control;
public class ViewPersonalDeOperativo extends javax.swing.JPanel {
public ViewPersonalDeOperativo(String rol) {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
consultarDatos = new javax.swing.JButton();
consultarVacaciones = new javax.swing.JButton();
consultarEmergencia = new javax.swing.JButton();
consultarTurnos = new javax.swing.JButton();
solicitarCambioTurno = new javax.swing.JButton();
jLabel1.setText("Personal de Operativo");
consultarDatos.setText("Consultar mis datos en la empresa");
consultarVacaciones.setText("Consultar vacaciones");
consultarEmergencia.setText("Concultar emergencia atendidas");
consultarTurnos.setText("Concultar mis turnos");
solicitarCambioTurno.setText("Solicitar cambio de turno");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(130, 130, 130)
.addComponent(jLabel1))
.addGroup(layout.createSequentialGroup()
.addGap(103, 103, 103)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(consultarVacaciones)
.addComponent(consultarDatos)
.addComponent(consultarEmergencia)
.addComponent(consultarTurnos)
.addComponent(solicitarCambioTurno))))
.addContainerGap(63, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1)
.addGap(18, 18, 18)
.addComponent(consultarDatos)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(consultarVacaciones)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(consultarEmergencia)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(consultarTurnos)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(solicitarCambioTurno)
.addContainerGap(100, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents
private void consultarDatosActionPerformed(java.awt.event.ActionEvent evt) {
// Ne fait rien
}
private void consultarVacacionesActionPerformed(java.awt.event.ActionEvent evt) {
// Ne fait rien
}
/* A modifier quand nom de la 4e partie
private void attenderLlamadaActionPerformed(){
JFrame frame = new JFrame("Concultar emergencia atendidas");
frame.setContentPane(new Vista####());
frame.pack();
frame.setVisible(true);
}
*/
private void consultarTurnosActionPerformed(java.awt.event.ActionEvent evt) {
// Ne fait rien
}
private void solicitarCambioTurnoActionPerformed(java.awt.event.ActionEvent evt) {
// Ne fait rien
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton consultarDatos;
private javax.swing.JButton consultarEmergencia;
private javax.swing.JButton consultarTurnos;
private javax.swing.JButton consultarVacaciones;
private javax.swing.JLabel jLabel1;
private javax.swing.JButton solicitarCambioTurno;
// End of variables declaration//GEN-END:variables
}
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="-2" pref="178" max="-2" attributes="0"/>
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="83" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="consultarVacaciones" min="-2" max="-2" attributes="0"/>
<Component id="consultarDatos" min="-2" max="-2" attributes="0"/>
<Component id="organizarOperador" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="modificarOperador" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="organizarOperatorEmergencia" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
<EmptySpace pref="19" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="32767" attributes="0"/>
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="consultarDatos" min="-2" pref="23" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="consultarVacaciones" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="organizarOperador" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="modificarOperador" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="organizarOperatorEmergencia" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="40" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="text" type="java.lang.String" value="Gerente"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="consultarDatos">
<Properties>
<Property name="text" type="java.lang.String" value="Consultar mis datos en la empresa"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="consultarDatosActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="consultarVacaciones">
<Properties>
<Property name="text" type="java.lang.String" value="Consultar vacaciones"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="consultarVacacionesActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="organizarOperador">
<Properties>
<Property name="text" type="java.lang.String" value="Organizar turnos de operador"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="organizarOperadorActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="modificarOperador">
<Properties>
<Property name="text" type="java.lang.String" value="Modificar operador en turno"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="modificarOperadorActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="organizarOperatorEmergencia">
<Properties>
<Property name="text" type="java.lang.String" value="Organizar turnos de operativos de emergencia"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="organizarOperatorEmergenciaActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Form>
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JPanel.java to edit this template
*/
package com.mycompany.disenosoftwareproject.interfaz.pares_vista_control;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class VistaGerente extends javax.swing.JPanel {
public VistaGerente(String rol) {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
consultarDatos = new javax.swing.JButton();
consultarVacaciones = new javax.swing.JButton();
organizarOperador = new javax.swing.JButton();
modificarOperador = new javax.swing.JButton();
organizarOperatorEmergencia = new javax.swing.JButton();
jLabel1.setText("Gerente");
consultarDatos.setText("Consultar mis datos en la empresa");
consultarDatos.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
consultarDatosActionPerformed(evt);
}
});
consultarVacaciones.setText("Consultar vacaciones");
consultarVacaciones.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
consultarVacacionesActionPerformed(evt);
}
});
organizarOperador.setText("Organizar turnos de operador");
organizarOperador.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
organizarOperadorActionPerformed(evt);
}
});
modificarOperador.setText("Modificar operador en turno");
modificarOperador.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
modificarOperadorActionPerformed(evt);
}
});
organizarOperatorEmergencia.setText("Organizar turnos de operativos de emergencia");
organizarOperatorEmergencia.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
organizarOperatorEmergenciaActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(178, 178, 178)
.addComponent(jLabel1))
.addGroup(layout.createSequentialGroup()
.addGap(83, 83, 83)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(consultarVacaciones)
.addComponent(consultarDatos)
.addComponent(organizarOperador)
.addComponent(modificarOperador)
.addComponent(organizarOperatorEmergencia))))
.addContainerGap(19, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel1)
.addGap(18, 18, 18)
.addComponent(consultarDatos, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(consultarVacaciones)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(organizarOperador)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(modificarOperador)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(organizarOperatorEmergencia)
.addContainerGap(40, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents
private void consultarDatosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_consultarDatosActionPerformed
// Ne fait rien
}//GEN-LAST:event_consultarDatosActionPerformed
private void consultarVacacionesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_consultarVacacionesActionPerformed
// Ne fait rien
}//GEN-LAST:event_consultarVacacionesActionPerformed
private void organizarOperadorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_organizarOperadorActionPerformed
JFrame frame = new JFrame("Modificar Operador en Turno");
frame.setContentPane(new VistaModificarOperadorEnTurno());
frame.pack();
frame.setVisible(true);
}//GEN-LAST:event_organizarOperadorActionPerformed
private void modificarOperadorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_modificarOperadorActionPerformed
// Ne fait rien
}//GEN-LAST:event_modificarOperadorActionPerformed
private void organizarOperatorEmergenciaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_organizarOperatorEmergenciaActionPerformed
// Ne fait rien
}//GEN-LAST:event_organizarOperatorEmergenciaActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton consultarDatos;
private javax.swing.JButton consultarVacaciones;
private javax.swing.JLabel jLabel1;
private javax.swing.JButton modificarOperador;
private javax.swing.JButton organizarOperador;
private javax.swing.JButton organizarOperatorEmergencia;
// End of variables declaration//GEN-END:variables
}
......@@ -40,7 +40,7 @@
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="146" max="-2" attributes="0"/>
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
<Component id="iniciarSesion" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
......@@ -57,7 +57,7 @@
<EmptySpace max="-2" attributes="0"/>
<Component id="jTextField2" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
<Component id="iniciarSesion" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="96" max="32767" attributes="0"/>
</Group>
</Group>
......@@ -81,7 +81,7 @@
<Property name="text" type="java.lang.String" value="Contrase&#xf1;a"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="jButton1">
<Component class="javax.swing.JButton" name="iniciarSesion">
<Properties>
<Property name="text" type="java.lang.String" value="Iniciar sesi&#xf3;n"/>
</Properties>
......
......@@ -3,17 +3,18 @@
* Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JPanel.java to edit this template
*/
package com.mycompany.disenosoftwareproject.interfaz.pares_vista_control;
import com.mycompany.disenosoftwareproject.negocio.modelos;
import javax.swing.JOptionPane;
import org.json.JSONArray;
import org.json.JSONObject;
import org.json.JSONException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.io.IOException;
/**
*
* @author defre
*/
public class RegistrarseView extends javax.swing.JPanel {
public class VistaRegistrarse extends javax.swing.JPanel {
/**
* Creates new form RegistrarseView
*/
public RegistrarseView() {
public VistaRegistrarse() {
initComponents();
}
......@@ -29,7 +30,7 @@ public class RegistrarseView extends javax.swing.JPanel {
jTextField2 = new javax.swing.JTextField();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
iniciarSesion = new javax.swing.JButton();
jTextField1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
......@@ -41,7 +42,7 @@ public class RegistrarseView extends javax.swing.JPanel {
jLabel2.setText("Contraseña");
jButton1.setText("Iniciar sesión");
iniciarSesion.setText("Iniciar sesión");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
......@@ -64,7 +65,7 @@ public class RegistrarseView extends javax.swing.JPanel {
.addContainerGap(148, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addGap(146, 146, 146)
.addComponent(jButton1)
.addComponent(iniciarSesion)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
layout.setVerticalGroup(
......@@ -79,7 +80,7 @@ public class RegistrarseView extends javax.swing.JPanel {
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jButton1)
.addComponent(iniciarSesion)
.addContainerGap(96, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents
......@@ -88,9 +89,64 @@ public class RegistrarseView extends javax.swing.JPanel {
}//GEN-LAST:event_jTextField1ActionPerformed
private void iniciarSesionActionPerformed(java.awt.event.ActionEvent evt) throws JSONException, IOException {
String identificador = jTextField1.getText();
String contrasena = jTextField2.getText();
if (identificador.isEmpty() || contrasena.isEmpty()) {
JOptionPane.showMessageDialog(this, "Por favor, rellene todos los campos.", "Error", JOptionPane.ERROR_MESSAGE);
} else {
boolean isAuthenticated = false;
String rol = "";
// Lire le fichier JSON
String content = new String(Files.readAllBytes(Paths.get("AChanger.json")));
JSONArray empleados = new JSONArray(content);
for (int i = 0; i < empleados.length(); i++) {
JSONObject empleado = empleados.getJSONObject(i);
if (empleado.getString("identificador").equals(identificador) &&
empleado.getString("contrasena").equals(contrasena)) {
isAuthenticated = true;
rol = empleado.getString("rol");
break;
}
}
if (isAuthenticated) {
switch (rol) {
case "gerente":
JOptionPane.showMessageDialog(this, "Acceso concedido. Rol: Gerente", "Bienvenido", JOptionPane.INFORMATION_MESSAGE);
// Ouvrir la vue GerenteView
VistaGerente gerenteView = new Gerente();
// Code pour afficher la vue GerenteView
break;
case "operador":
JOptionPane.showMessageDialog(this, "Acceso concedido. Rol: Operador", "Bienvenido", JOptionPane.INFORMATION_MESSAGE);
// Ouvrir la vue OperadorView
ViewOperador operadorView = new Operador();
// Code pour afficher la vue OperadorView
break;
case "medico":
case "conductor":
JOptionPane.showMessageDialog(this, "Acceso concedido. Rol: Personal de Operativo", "Bienvenido", JOptionPane.INFORMATION_MESSAGE);
// Ouvrir la vue PersonalDeOperativoView
ViewPersonalDeOperativo personalDeOperativoView = new PersonalDeOperativo();
// Code pour afficher la vue PersonalDeOperativoView
break;
default:
JOptionPane.showMessageDialog(this, "Rol desconocido.", "Error", JOptionPane.ERROR_MESSAGE);
}
} else {
JOptionPane.showMessageDialog(this, "Identificador o contraseña incorrecta.", "Error", JOptionPane.ERROR_MESSAGE);
}
}
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
private javax.swing.JButton iniciarSesion;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JTextField jTextField1;
......
......@@ -10,6 +10,7 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
*
* @author defre
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment