From 9393e198901688a4b11d9cc5264399a0330691ba Mon Sep 17 00:00:00 2001 From: David Date: Tue, 19 Mar 2024 18:57:51 -0600 Subject: [PATCH] =?UTF-8?q?"Seleccionar=20asientos"=20sin=20par=C3=A1metro?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SeleccionarAsientoV.java | 47 ++++++++++++++++++ .../mezontleTeam/SeleccionarAsientoV.class | Bin 5447 -> 6196 bytes 2 files changed, 47 insertions(+) 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 88ac2b56bce2d9341de9ad4d241121e5b295a3b2..bbbdb613cb3b849895ec37067dd53aa248b3611b 100644 GIT binary patch literal 6196 zcmdT|dwf*&mH+P_aFj0`jB%ncA0 z*VfWS`=AeND^z*eF12fIRWd2iwOZ@0>$Yz9)$P98eY#z{-Sa_R~L` zPv-u9_x#Q|_x#S|`#bl(^7f_Y0JNzsA$Z_5;4|SzKp}FEb-+5*m_3+C4K{AxVWsS( zLSStom2lQ8c#pw=)iZ@KOQEtZ zRuFO7w^}J{(9X2h_m&`xG6NA4voVLdd+ek=Fpx;6tV~-rVW*sQuR_Ui&&aTyNu)Ch zbF{9hR<;_Lo42d5&_3cg=~NK&DZbMl%-C5gvn+%tD#WTvg=pTYq{ZF#I2mp_Z%?&} z1$Ya*J@v7!_Exd}Iui?Vy~4ayI&X1yaue}%RzY% z%+8V2K;p$`Q!O=n_UsWAO(s@|ieOSNrBgy&WujSPQZn3~x?6i+s5hHfBir>mX~*IQ z6c!74t%-G_A&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