diff --git a/SeleccionarAsientoV.java b/SeleccionarAsientoV.java index 3db563e..4d51c87 100644 --- a/SeleccionarAsientoV.java +++ b/SeleccionarAsientoV.java @@ -2,6 +2,11 @@ import javax.swing.*; import java.awt.*; import java.util.ArrayList; import java.util.List; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; public class SeleccionarAsientoV extends JPanel { @@ -11,6 +16,7 @@ public class SeleccionarAsientoV extends JPanel { private int noAsientosSeleccionados = 0; private JLabel lSeleccionar = new JLabel("Asientos seleccionados: " + noAsientosSeleccionados); + private JLabel lFuncion = new JLabel("Función: XXX"); private JPanel pInferior = new JPanel(new FlowLayout(FlowLayout.CENTER)); private int total = 0; private JLabel lTotal = new JLabel("Total: " + total + "$"); @@ -34,9 +40,21 @@ public class SeleccionarAsientoV extends JPanel { crearCeldas(7,10); } + public SeleccionarAsientoV() throws HeadlessException { + this.setLayout(new BorderLayout()); + + llenarAsientos(); + + agregarComponentes(); + añadirListeners(); + + crearCeldas(7,10); + } + public void agregarComponentes(){ pSuperior.add(this.bRegresar); pSuperior.add(lSeleccionar); + pSuperior.add(this.lFuncion); pInferior.add(this.lTotal); pInferior.add(this.bSeleccionar); @@ -97,6 +115,25 @@ public class SeleccionarAsientoV extends JPanel { //bRegresar.addActionListener(new GestiónBotónCambiarVentana(this,new ventana2().panelV2)); } + public void llenarAsientos(){ + asientos = new Asiento[7][10]; + String zona = ""; + for(int i = 0; i < 7; i++) { + for (int j = 0; j < 10; j++) { + if( ( (j >= 2) && (j <= 7) ) && ( (i >= 2) && (i <= 6) ) ){ + zona = "A"; + } + if( ((i == 1) && (j > 0) && (j < 9)) || ((j == 1) && (i > 0)) || ((j == 8) && (i > 0)) ){ + zona = "B"; + } + if( (i == 0) || (j == 0) || (j == 9)){ + zona = "C"; + } + asientos[i][j]=new Asiento(i,j,zona,false); + } + } + } + public void seleccionarAsientos(Asiento asiento){ int precio = 0; @@ -146,4 +183,14 @@ public class SeleccionarAsientoV extends JPanel { lSeleccionar.setText("Asientos seleccionados: " + noAsientosSeleccionados); lTotal.setText("Total: " + total + "$"); } + + public void obtenerDatos(){ + ConexionBD con = new ConexionBD(); + Connection connection; + PreparedStatement ps; + ResultSet rs; + Statement st; + + String consulta = "SELECT * FROM ASIENTOS WHERE idFkZona INNER JOIN"; + } } diff --git a/out/production/mezontleTeam/SeleccionarAsientoV.class b/out/production/mezontleTeam/SeleccionarAsientoV.class index 88ac2b5..bbbdb61 100644 Binary files a/out/production/mezontleTeam/SeleccionarAsientoV.class and b/out/production/mezontleTeam/SeleccionarAsientoV.class differ