/** * * @author Johannes Rothkegel, Juan Pablo Rothkegel Ide, Raul Cortes * * Esta clase es la encargada de manejar la vista de la pantalla principal de nuestro programa. * Es la que genera todos los elementos visibles y de interacción, como por ejemplo el boton * que ingresa el request para revisar si existe el número de reserva o RUT en la base de datos. */ public class CheckIn extends javax.swing.JFrame { /** * Creates new form CheckIn */ public CheckIn() { 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. */ @SuppressWarnings("unchecked") // private void initComponents() { Error = new javax.swing.JDialog(); jLabel8 = new javax.swing.JLabel(); jLabel9 = new javax.swing.JLabel(); volver = new javax.swing.JButton(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); codReserva = new javax.swing.JTextField(); jLabel5 = new javax.swing.JLabel(); rut = new javax.swing.JTextField(); jLabel6 = new javax.swing.JLabel(); ingresar = new javax.swing.JButton(); jLabel7 = new javax.swing.JLabel(); jLabel10 = new javax.swing.JLabel(); jLabel8.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jLabel8.setText("Error al ingresar Rut o Codigo de reserva!"); jLabel9.setText("Intente nuevamente o dirijase al meson principal."); volver.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N volver.setText("Volver"); javax.swing.GroupLayout ErrorLayout = new javax.swing.GroupLayout(Error.getContentPane()); Error.getContentPane().setLayout(ErrorLayout); ErrorLayout.setHorizontalGroup( ErrorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, ErrorLayout.createSequentialGroup() .addContainerGap(104, Short.MAX_VALUE) .addGroup(ErrorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jLabel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(95, 95, 95)) .addGroup(ErrorLayout.createSequentialGroup() .addGap(190, 190, 190) .addComponent(volver) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); ErrorLayout.setVerticalGroup( ErrorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(ErrorLayout.createSequentialGroup() .addGap(38, 38, 38) .addComponent(jLabel8) .addGap(18, 18, 18) .addComponent(jLabel9) .addGap(43, 43, 43) .addComponent(volver) .addContainerGap(47, Short.MAX_VALUE)) ); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jLabel1.setFont(new java.awt.Font("Tahoma", 0, 36)); // NOI18N jLabel1.setText("Check-In"); jLabel2.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jLabel2.setText("Ingrese su codigo de reserva o Rut para poder acceder a los datos de su "); jLabel2.setVerticalAlignment(javax.swing.SwingConstants.TOP); jLabel3.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jLabel3.setText("reserva. De no tener reserva presione el boton ubicado en la parte inferior de la pantalla. "); jLabel4.setText("No tiene reserva ? "); codReserva.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N codReserva.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { codReservaActionPerformed(evt); } }); jLabel5.setText("Ingresa Codigo de Reserva"); rut.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N rut.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { rutActionPerformed(evt); } }); jLabel6.setText("Ingresa Rut o DNI"); ingresar.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N ingresar.setText("Ingresar"); ingresar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { ingresarActionPerformed(evt); } }); jLabel7.setText("Oprima el boton para elegir habitacion."); jLabel10.setText("Dirijase al meson principal."); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(137, 137, 137) .addComponent(codReserva, javax.swing.GroupLayout.PREFERRED_SIZE, 174, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(rut, javax.swing.GroupLayout.PREFERRED_SIZE, 174, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(137, 137, 137)) .addGroup(layout.createSequentialGroup() .addGap(158, 158, 158) .addComponent(jLabel5) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel6) .addGap(181, 181, 181)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addGap(15, 391, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(ingresar) .addComponent(jLabel4)) .addGap(410, 410, 410)) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(374, 374, 374) .addComponent(jLabel1)) .addGroup(layout.createSequentialGroup() .addGap(88, 88, 88) .addComponent(jLabel3)) .addGroup(layout.createSequentialGroup() .addGap(149, 149, 149) .addComponent(jLabel2)) .addGroup(layout.createSequentialGroup() .addGap(340, 340, 340) .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 195, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addGap(371, 371, 371) .addComponent(jLabel10))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(45, 45, 45) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(29, 29, 29) .addComponent(jLabel2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel3) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 113, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel5) .addComponent(jLabel6)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(codReserva, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(rut, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(47, 47, 47) .addComponent(jLabel7) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(ingresar) .addGap(44, 44, 44) .addComponent(jLabel4) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel10) .addGap(108, 108, 108)) ); pack(); }// private void codReservaActionPerformed(java.awt.event.ActionEvent evt) { } private void rutActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: } private void ingresarActionPerformed(java.awt.event.ActionEvent evt) { Personas p = new Personas(); ReservasPersona r = new ReservasPersona(p); if(r.getReservaId(codReserva.getText()) != null){ this.setVisible(false); new ReservaDatos(r.getReservaId(codReserva.getText())).setVisible(true); } else if(r.getReservaRut(rut.getText()) != null){ this.setVisible(false); new ReservaDatos(r.getReservaRut(rut.getText())).setVisible(true); } } // Variables declaration - do not modify private javax.swing.JDialog Error; private javax.swing.JTextField codReserva; private javax.swing.JButton ingresar; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel10; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel8; private javax.swing.JLabel jLabel9; private javax.swing.JTextField rut; private javax.swing.JButton volver; // End of variables declaration }