Compra de Boletos

This commit is contained in:
Soka_jplr 2024-03-17 18:32:16 -06:00
parent ca050d76ed
commit c8ebca08e3
28 changed files with 624 additions and 259 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -3,7 +3,7 @@ package Controlador;
import Modelo.Asiento;
import Modelo.Consulta;
import Modelo.Usuario;
import Vista.MetodoPago;
import Vista.SalaPrincipal;
import Vista.seleccionarBoleto;
import java.awt.BorderLayout;
@ -24,6 +24,7 @@ import javax.swing.SwingConstants;
public class ControladorBoleto implements ActionListener{
seleccionarBoleto ventana;
Consulta consulta = new Consulta();
Asiento asiento;
public ControladorBoleto(seleccionarBoleto ventana) {
this.ventana = ventana;
control();
@ -94,11 +95,16 @@ public class ControladorBoleto implements ActionListener{
}else{
if(e.getSource()== ventana.getBtnSeleccionarAsiento()){
if(ventana.getLabelNumeroAsiento().getText().isEmpty()){
JOptionPane.showMessageDialog(null, "Error. Selecciona Un Asiento Libre");
JOptionPane.showMessageDialog(null, "Error. Selecciona Un Asiento");
}else{
MetodoPago ventanaM = new MetodoPago(ventana.getZona(), asiento, ventana.getUser());
ventanaM.setLocationRelativeTo(null);
ventanaM.setVisible(true);
ventana.dispose();
}
}else{
JButton bon = (JButton) e.getSource();
Asiento asiento = consulta.getAsiento(bon.getText(),ventana.getZona().getId());
asiento = consulta.getAsiento(bon.getText(),ventana.getZona().getId());
if(asiento.isEstado()){
ventana.getLabelNumeroAsiento().setText(asiento.getNombre());
ventana.getLabelCostoAsiento().setText("$"+ventana.getZona().getPrecio());

View File

@ -0,0 +1,26 @@
package Controlador;
import Vista.ConfirmacionPago;
import Vista.SalaPrincipal;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/*
* @author Juan Ska
*/
public class ControladorCP implements ActionListener{
ConfirmacionPago ventana;
public ControladorCP(ConfirmacionPago ventana) {
this.ventana = ventana;
}
@Override
public void actionPerformed(ActionEvent e) {
if(e.getSource()==ventana.getBtnMenu()){
SalaPrincipal vent = new SalaPrincipal(ventana.getUser());
}
}
}

View File

@ -3,7 +3,9 @@ package Controlador;
import Modelo.Asiento;
import Modelo.Consulta;
import Modelo.Sala;
import Modelo.Usuario;
import Modelo.Zona;
import Vista.Login;
import Vista.SalaPrincipal;
import Vista.seleccionarBoleto;
import java.awt.Dimension;
@ -125,6 +127,13 @@ public final class ControladorEcenario implements MouseListener{
ventana.setVisible(true);
ventanaSala.dispose();
}
if(e.getSource()==ventanaSala.getBtnCerrar()){
ventanaSala.setUser(new Usuario());
Login ventana = new Login();
ventana.setLocationRelativeTo(null);
ventana.setVisible(true);
ventanaSala.dispose();
}
}
@Override

View File

@ -0,0 +1,148 @@
package Controlador;
import Modelo.Consulta;
import Modelo.Tarjeta;
import Vista.ConfirmacionPago;
import Vista.MetodoPago;
import Vista.seleccionarBoleto;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
/*
* @author Juan Ska
*/
public class ControladorPago implements ActionListener{
MetodoPago ventana;
Consulta consulta = new Consulta();
public ControladorPago(MetodoPago ventana) {
this.ventana = ventana;
keyList();
}
@Override
public void actionPerformed(ActionEvent e) {
if(e.getSource()== ventana.getBtnPagar()){
if(ventana.getTxtCodigo().getText().isEmpty() || ventana.getTxtFechaVencimiento().getText().isEmpty() || ventana.getTxtNumeroTarjeta().getText().isEmpty() || ventana.getTxtTitular().getText().isEmpty()){
JOptionPane.showMessageDialog(null, "Error.Llena todos los campos.");
}else{
if(ventana.getTxtCodigo().getText().length() ==3 && ventana.getTxtFechaVencimiento().getText().length() ==5 && ventana.getTxtNumeroTarjeta().getText().length()==16){
Double numeroT = Double.valueOf(ventana.getTxtNumeroTarjeta().getText());
int numero = Integer.parseInt(ventana.getTxtCodigo().getText());
Tarjeta tarjeta = new Tarjeta(numeroT, ventana.getTxtFechaVencimiento().getText(),numero,ventana.getTxtTitular().getText());
if(consulta.comprarAsiento(ventana.getZona(),ventana.getAsiento(), ventana.getUser())){
JOptionPane.showMessageDialog(null, "Pago Realizado con exito!!");
ConfirmacionPago ven = new ConfirmacionPago(ventana.getZona(),ventana.getAsiento(),tarjeta,ventana.getUser());
ven.setLocationRelativeTo(null);
ven.setVisible(true);
ventana.dispose();
}else{
JOptionPane.showMessageDialog(null, "Errro!!");
}
}else{
JOptionPane.showMessageDialog(null, "Error. la tarjeta tiene que tener 16 dijitos, el CVV 3 y la fecha de Vencimiento es dd/aa.");
}
}
}
if(e.getSource()==ventana.getBtnRegresar()){
JPanel panel = new JPanel();
switch (ventana.getZona().getId()) {
case 1:
seleccionarBoleto ven = new seleccionarBoleto(ventana.getZona(), panel,7,5,1, ventana.getUser());
ven.setLocationRelativeTo(null);
ven.setVisible(true);
ventana.dispose();
break;
case 2:
seleccionarBoleto vent = new seleccionarBoleto(ventana.getZona(), panel,4,6,2, ventana.getUser());
vent.setLocationRelativeTo(null);
vent.setVisible(true);
ventana.dispose();
break;
case 3:
seleccionarBoleto venta = new seleccionarBoleto(ventana.getZona(), panel,2,5,3, ventana.getUser());
venta.setLocationRelativeTo(null);
venta.setVisible(true);
ventana.dispose();
break;
case 4:
seleccionarBoleto ventan = new seleccionarBoleto(ventana.getZona(), panel,7,5,4, ventana.getUser());
ventan.setLocationRelativeTo(null);
ventan.setVisible(true);
ventana.dispose();
break;
default:
}
}
}
private void keyList() {
ventana.getTxtNumeroTarjeta().addKeyListener(new KeyListener() {
@Override
public void keyTyped(KeyEvent e) {
if(ventana.getTxtNumeroTarjeta().getText().length()>=16){
e.consume();
}
int key = e.getKeyChar();
boolean numeros = key >= 48 && key <= 57;
if (!numeros){
e.consume();
}
}
@Override
public void keyPressed(KeyEvent e) {
}
@Override
public void keyReleased(KeyEvent e) {
}
});
ventana.getTxtFechaVencimiento().addKeyListener(new KeyListener() {
@Override
public void keyTyped(KeyEvent e) {
if(ventana.getTxtFechaVencimiento().getText().length()>=5){
e.consume();
}
int key = e.getKeyChar();
boolean numeros = key >= 48 && key <= 57;
if (!numeros){
e.consume();
}
}
@Override
public void keyPressed(KeyEvent e) {
}
@Override
public void keyReleased(KeyEvent e) {
int numero = ventana.getTxtFechaVencimiento().getText().length();
if(numero==2){
ventana.getTxtFechaVencimiento().setText(ventana.getTxtFechaVencimiento().getText()+"/");
}
}
});
ventana.getTxtCodigo().addKeyListener(new KeyListener() {
@Override
public void keyTyped(KeyEvent e) {
if(ventana.getTxtCodigo().getText().length()>=3){
e.consume();
}
int key = e.getKeyChar();
boolean numeros = key >= 48 && key <= 57;
if (!numeros){
e.consume();
}
}
@Override
public void keyPressed(KeyEvent e) {
}
@Override
public void keyReleased(KeyEvent e) {
}
});
}
}

BIN
src/Images/cargando.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

@ -1,16 +1,11 @@
package Main;
import Modelo.Usuario;
import Vista.Login;
import Vista.SalaPrincipal;
public class Main {
public static void main(String[] args) {
/*Login login = new Login();
login.setLocationRelativeTo(null);
login.setVisible(true);*/
SalaPrincipal login = new SalaPrincipal(new Usuario());
Login login = new Login();
login.setLocationRelativeTo(null);
login.setVisible(true);
}

View File

@ -166,4 +166,42 @@ public class Consulta {
return asiento;
}
public boolean comprarAsiento(Zona zona, Asiento asiento, Usuario user) {
boolean verificar = false;
try {
if(asignar(zona,asiento,user)){
PreparedStatement ps;
conexion = cn.conectar();
ps= conexion.prepareStatement("UPDATE `asiento` SET `estado`= 0 "
+ "where id= '"+ asiento.getId()+"';");
ps.executeUpdate();
verificar = true;
cn.cerrarconexion();
}else{
verificar = false;
}
} catch (SQLException e) {
System.out.println(e.toString());
}
return verificar;
}
private boolean asignar(Zona zona, Asiento asiento, Usuario user) {
boolean verificar = false;
try {
PreparedStatement ps;
conexion = cn.conectar();
ps= conexion.prepareStatement("INSERT INTO `compra`(`usuario_id`,`asiento_id`,`zona_id`) VALUES(?,?,?);");
ps.setString(1, user.getNombre());
ps.setInt(2, asiento.getId());
ps.setInt(3, zona.getId());
ps.executeUpdate();
verificar = true;
cn.cerrarconexion();
} catch (SQLException e) {
System.out.println(e.toString());
}
return verificar;
}
}

View File

@ -10,9 +10,16 @@ package Modelo;
*/
public class Tarjeta {
private int numeroTarjeta;
private double numeroTarjeta;
String diaVencimiento;
int numero;
String nombreTitular;
public Tarjeta(double numeroTarjeta, String diaVencimiento, int numero, String nombreTitular) {
this.numeroTarjeta = numeroTarjeta;
this.diaVencimiento = diaVencimiento;
this.numero = numero;
this.nombreTitular = nombreTitular;
}
}

View File

@ -60,27 +60,17 @@
<Component id="logo2" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="18" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="87" 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="69" max="-2" attributes="0"/>
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="51" max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel5" min="-2" max="-2" attributes="0"/>
<Group type="102" attributes="0">
<EmptySpace min="-2" pref="20" max="-2" attributes="0"/>
<Component id="jLabel7" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
</Group>
</Group>
@ -88,7 +78,15 @@
</Group>
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="32767" attributes="0"/>
<Component id="menu" min="-2" max="-2" attributes="0"/>
<Component id="lbCorreo" min="-2" pref="219" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="32767" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="jLabel7" min="-2" max="-2" attributes="0"/>
<Component id="btnMenu" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="86" max="-2" attributes="0"/>
</Group>
</Group>
@ -106,13 +104,13 @@
<EmptySpace min="-2" pref="38" max="-2" attributes="0"/>
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="35" max="-2" attributes="0"/>
<Component id="lbCorreo" min="-2" pref="23" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jLabel5" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel7" min="-2" pref="16" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="27" max="-2" attributes="0"/>
<Component id="menu" min="-2" max="-2" attributes="0"/>
<Component id="btnMenu" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="99" max="32767" attributes="0"/>
</Group>
</Group>
@ -132,12 +130,11 @@
<Property name="text" type="java.lang.String" value="Su boleto ha sido enviado al correo"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel3">
<Component class="javax.swing.JLabel" name="lbCorreo">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Segoe UI" size="12" style="2"/>
</Property>
<Property name="text" type="java.lang.String" value="manuel23anel@gmail.com"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel5">
@ -147,7 +144,7 @@
</Component>
<Component class="javax.swing.JLabel" name="jLabel7">
<Properties>
<Property name="text" type="java.lang.String" value="SSporteConciertos@gmail.com"/>
<Property name="text" type="java.lang.String" value="drannet9@gmail.com"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="logo2">
@ -169,7 +166,7 @@
<Property name="text" type="java.lang.String" value="."/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="menu">
<Component class="javax.swing.JButton" name="btnMenu">
<Properties>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="33" green="33" red="33" type="rgb"/>

View File

@ -4,8 +4,12 @@
*/
package Vista;
import java.awt.Image;
import Modelo.Asiento;
import Modelo.Tarjeta;
import Modelo.Usuario;
import Modelo.Zona;
import javax.swing.ImageIcon;
import javax.swing.JButton;
/**
*
@ -17,24 +21,39 @@ public class ConfirmacionPago extends javax.swing.JFrame {
* Creates new form confirmacionPago
*/
ImageIcon imagen;
Zona zona;
Asiento asiento;
Tarjeta tarjeta;
Usuario user;
public ConfirmacionPago() {
public ConfirmacionPago(Zona zona, Asiento asiento, Tarjeta tarjeta, Usuario user) {
initComponents();
ImageIcon icon = new ImageIcon("C:\\Users\\reyes\\Documents\\ProyectoSalaConciertos\\SalaDeConciertos\\src\\Vista\\Images\\musica.png");
Image image = icon.getImage();
this.setIconImage(image);
this.setResizable(false);
setTitle("Confirmacion Pago");
this.setLocationRelativeTo(null);
slogan();
this.zona = zona;
this.asiento = asiento;
this.tarjeta = tarjeta;
this.user = user;
lbCorreo.setText(user.getCorreoelectronico());
}
public void slogan() {
imagen = new ImageIcon("C:\\Users\\reyes\\Documents\\ProyectoSalaConciertos\\SalaDeConciertos\\src\\Vista\\Images\\musicas.png");
imagen = new ImageIcon("src\\Images\\musicas.png");
imagenLogo.setIcon(imagen);
//logoimagen.setPreferredSize(new Dimension(150, 120));
}
public JButton getBtnMenu() {
return btnMenu;
}
public Usuario getUser() {
return user;
}
/**
* 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
@ -48,12 +67,12 @@ public class ConfirmacionPago extends javax.swing.JFrame {
jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
lbCorreo = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
logo2 = new javax.swing.JLabel();
imagenLogo = new javax.swing.JLabel();
menu = new javax.swing.JButton();
btnMenu = new javax.swing.JButton();
jLabel4.setText("jLabel4");
@ -66,12 +85,11 @@ public class ConfirmacionPago extends javax.swing.JFrame {
jLabel2.setText("Su boleto ha sido enviado al correo");
jLabel3.setFont(new java.awt.Font("Segoe UI", 2, 12)); // NOI18N
jLabel3.setText("manuel23anel@gmail.com");
lbCorreo.setFont(new java.awt.Font("Segoe UI", 2, 12)); // NOI18N
jLabel5.setText("Para aclaraciones comunicarse con:");
jLabel7.setText("SSporteConciertos@gmail.com");
jLabel7.setText("drannet9@gmail.com");
logo2.setBackground(new java.awt.Color(0, 0, 204));
logo2.setFont(new java.awt.Font("Sitka Text", 1, 18)); // NOI18N
@ -80,9 +98,9 @@ public class ConfirmacionPago extends javax.swing.JFrame {
imagenLogo.setText(".");
menu.setBackground(new java.awt.Color(51, 51, 51));
menu.setForeground(new java.awt.Color(255, 255, 255));
menu.setText("Menu Principal");
btnMenu.setBackground(new java.awt.Color(51, 51, 51));
btnMenu.setForeground(new java.awt.Color(255, 255, 255));
btnMenu.setText("Menu Principal");
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
@ -99,22 +117,21 @@ public class ConfirmacionPago extends javax.swing.JFrame {
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(87, 87, 87)
.addComponent(jLabel1))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(69, 69, 69)
.addComponent(jLabel3))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(51, 51, 51)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel2)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel5)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(20, 20, 20)
.addComponent(jLabel7))))))
.addComponent(jLabel5))))
.addContainerGap(59, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(menu)
.addComponent(lbCorreo, javax.swing.GroupLayout.PREFERRED_SIZE, 219, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel7)
.addComponent(btnMenu))
.addGap(86, 86, 86))
);
jPanel1Layout.setVerticalGroup(
@ -129,13 +146,13 @@ public class ConfirmacionPago extends javax.swing.JFrame {
.addGap(38, 38, 38)
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel3)
.addGap(35, 35, 35)
.addComponent(lbCorreo, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel5)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(27, 27, 27)
.addComponent(menu)
.addComponent(btnMenu)
.addContainerGap(99, Short.MAX_VALUE))
);
@ -160,15 +177,15 @@ public class ConfirmacionPago extends javax.swing.JFrame {
*/
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnMenu;
private javax.swing.JLabel imagenLogo;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel7;
private javax.swing.JPanel jPanel1;
private javax.swing.JLabel lbCorreo;
private javax.swing.JLabel logo2;
private javax.swing.JButton menu;
// End of variables declaration//GEN-END:variables
}

View File

@ -1,10 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
<NonVisualComponents>
<Component class="javax.swing.JTextField" name="jTextField3">
</Component>
</NonVisualComponents>
<Properties>
<Property name="defaultCloseOperation" type="int" value="3"/>
</Properties>
@ -62,13 +58,26 @@
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="37" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="lbZona" min="-2" pref="100" max="-2" attributes="0"/>
</Group>
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<Component id="jLabel4" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jLabel5" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jLabel6" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jLabel7" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jLabel8" alignment="0" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel6" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="lbNumeroAsiento" min="-2" pref="99" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel7" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="lbCosto" min="-2" pref="81" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="49" max="-2" attributes="0"/>
<Component id="jLabel8" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
<Group type="102" alignment="0" attributes="0">
@ -78,10 +87,10 @@
<Component id="jLabel9" min="-2" max="-2" attributes="0"/>
<Component id="jLabel11" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jLabel12" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jTextField1" min="-2" pref="229" max="-2" attributes="0"/>
<Component id="jTextField2" alignment="0" min="-2" pref="229" max="-2" attributes="0"/>
<Component id="jTextField4" alignment="0" min="-2" pref="229" max="-2" attributes="0"/>
<Component id="jTextField5" alignment="0" min="-2" pref="229" max="-2" attributes="0"/>
<Component id="txtNumeroTarjeta" min="-2" pref="229" max="-2" attributes="0"/>
<Component id="txtTitular" alignment="0" min="-2" pref="229" max="-2" attributes="0"/>
<Component id="txtFechaVencimiento" alignment="0" min="-2" pref="229" max="-2" attributes="0"/>
<Component id="txtCodigo" alignment="0" min="-2" pref="229" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
@ -91,11 +100,11 @@
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
<Component id="btnRegresar" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="87" max="-2" attributes="0"/>
<Component id="jButton2" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="107" max="-2" attributes="0"/>
<Component id="btnPagar" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
@ -106,41 +115,46 @@
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
<Component id="btnRegresar" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jLabel4" min="-2" pref="16" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jLabel5" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jLabel6" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jLabel7" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="jLabel3" max="32767" attributes="0"/>
<Component id="lbZona" max="32767" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="lbNumeroAsiento" alignment="3" min="-2" pref="16" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="28" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="lbCosto" alignment="3" min="-2" pref="16" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="30" max="-2" attributes="0"/>
<Component id="jLabel8" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="28" max="-2" attributes="0"/>
<Component id="jLabel9" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="9" max="-2" attributes="0"/>
<Component id="jTextField1" min="-2" max="-2" attributes="0"/>
<Component id="txtNumeroTarjeta" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel10" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jTextField4" min="-2" max="-2" attributes="0"/>
<Component id="txtFechaVencimiento" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="7" max="-2" attributes="0"/>
<Component id="jLabel11" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jTextField5" min="-2" max="-2" attributes="0"/>
<Component id="txtCodigo" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="7" max="-2" attributes="0"/>
<Component id="jLabel12" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jTextField2" min="-2" max="-2" attributes="0"/>
<Component id="txtTitular" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="jButton2" min="-2" max="-2" attributes="0"/>
<Component id="btnPagar" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="16" max="32767" attributes="0"/>
</Group>
</Group>
@ -155,7 +169,7 @@
<Property name="text" type="java.lang.String" value="Sala de conciertos"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="jButton1">
<Component class="javax.swing.JButton" name="btnRegresar">
<Properties>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="f9" green="f9" red="f9" type="rgb"/>
@ -174,17 +188,7 @@
</Component>
<Component class="javax.swing.JLabel" name="jLabel3">
<Properties>
<Property name="text" type="java.lang.String" value="Zona X"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel4">
<Properties>
<Property name="text" type="java.lang.String" value="Breve Descripcion"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel5">
<Properties>
<Property name="text" type="java.lang.String" value="Zona de Asiento:"/>
<Property name="text" type="java.lang.String" value="Zona:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel6">
@ -225,21 +229,15 @@
<Property name="text" type="java.lang.String" value="Nombre del Titular"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="jTextField1">
<Component class="javax.swing.JTextField" name="txtNumeroTarjeta">
</Component>
<Component class="javax.swing.JTextField" name="jTextField2">
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jTextField2ActionPerformed"/>
</Events>
<Component class="javax.swing.JTextField" name="txtTitular">
</Component>
<Component class="javax.swing.JTextField" name="jTextField4">
<Component class="javax.swing.JTextField" name="txtFechaVencimiento">
</Component>
<Component class="javax.swing.JTextField" name="jTextField5">
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jTextField5ActionPerformed"/>
</Events>
<Component class="javax.swing.JTextField" name="txtCodigo">
</Component>
<Component class="javax.swing.JButton" name="jButton2">
<Component class="javax.swing.JButton" name="btnPagar">
<Properties>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="ff" green="33" red="33" type="rgb"/>
@ -247,11 +245,14 @@
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="ff" green="ff" red="ff" type="rgb"/>
</Property>
<Property name="text" type="java.lang.String" value="Proceder a Pago"/>
<Property name="text" type="java.lang.String" value="Pagar"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton2ActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="lbZona">
</Component>
<Component class="javax.swing.JLabel" name="lbNumeroAsiento">
</Component>
<Component class="javax.swing.JLabel" name="lbCosto">
</Component>
</SubComponents>
</Container>

View File

@ -1,9 +1,13 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template
*/
package Vista;
import Controlador.ControladorPago;
import Modelo.Asiento;
import Modelo.Usuario;
import Modelo.Zona;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JTextField;
/**
*
* @author reyes
@ -13,27 +17,126 @@ public class MetodoPago extends javax.swing.JFrame {
/**
* Creates new form metodoPago
*/
public MetodoPago() {
Zona zona;
Usuario user;
Asiento asiento;
public MetodoPago(Zona zona, Asiento asiento, Usuario user) {
initComponents();
this.asiento = asiento;
this.zona = zona;
this.user =user;
ControladorPago controlador = new ControladorPago(this);
btnPagar.addActionListener(controlador);
btnRegresar.addActionListener(controlador);
mostrarLb();
}
/**
* 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.
*/
public Zona getZona() {
return zona;
}
public Usuario getUser() {
return user;
}
public Asiento getAsiento() {
return asiento;
}
public JButton getBtnPagar() {
return btnPagar;
}
public JLabel getLbCosto() {
return lbCosto;
}
public JLabel getLbNumeroAsiento() {
return lbNumeroAsiento;
}
public JLabel getLbZona() {
return lbZona;
}
public JTextField getTxtCodigo() {
return txtCodigo;
}
public JTextField getTxtFechaVencimiento() {
return txtFechaVencimiento;
}
public JTextField getTxtNumeroTarjeta() {
return txtNumeroTarjeta;
}
public JTextField getTxtTitular() {
return txtTitular;
}
public JButton getBtnRegresar() {
return btnRegresar;
}
public void setZona(Zona zona) {
this.zona = zona;
}
public void setUser(Usuario user) {
this.user = user;
}
public void setAsiento(Asiento asiento) {
this.asiento = asiento;
}
public void setBtnPagar(JButton btnPagar) {
this.btnPagar = btnPagar;
}
public void setBtnRegresar(JButton btnRegresar) {
this.btnRegresar = btnRegresar;
}
public void setLbCosto(JLabel lbCosto) {
this.lbCosto = lbCosto;
}
public void setLbNumeroAsiento(JLabel lbNumeroAsiento) {
this.lbNumeroAsiento = lbNumeroAsiento;
}
public void setLbZona(JLabel lbZona) {
this.lbZona = lbZona;
}
public void setTxtCodigo(JTextField txtCodigo) {
this.txtCodigo = txtCodigo;
}
public void setTxtFechaVencimiento(JTextField txtFechaVencimiento) {
this.txtFechaVencimiento = txtFechaVencimiento;
}
public void setTxtNumeroTarjeta(JTextField txtNumeroTarjeta) {
this.txtNumeroTarjeta = txtNumeroTarjeta;
}
public void setTxtTitular(JTextField txtTitular) {
this.txtTitular = txtTitular;
}
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jTextField3 = new javax.swing.JTextField();
jPanel1 = new javax.swing.JPanel();
jLabel2 = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
btnRegresar = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
@ -41,11 +144,14 @@ public class MetodoPago extends javax.swing.JFrame {
jLabel10 = new javax.swing.JLabel();
jLabel11 = new javax.swing.JLabel();
jLabel12 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jTextField2 = new javax.swing.JTextField();
jTextField4 = new javax.swing.JTextField();
jTextField5 = new javax.swing.JTextField();
jButton2 = new javax.swing.JButton();
txtNumeroTarjeta = new javax.swing.JTextField();
txtTitular = new javax.swing.JTextField();
txtFechaVencimiento = new javax.swing.JTextField();
txtCodigo = new javax.swing.JTextField();
btnPagar = new javax.swing.JButton();
lbZona = new javax.swing.JLabel();
lbNumeroAsiento = new javax.swing.JLabel();
lbCosto = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
@ -54,18 +160,14 @@ public class MetodoPago extends javax.swing.JFrame {
jLabel2.setFont(new java.awt.Font("Sitka Text", 0, 18)); // NOI18N
jLabel2.setText("Sala de conciertos");
jButton1.setBackground(new java.awt.Color(249, 249, 249));
jButton1.setText("<- Regresar");
jButton1.setBorderPainted(false);
btnRegresar.setBackground(new java.awt.Color(249, 249, 249));
btnRegresar.setText("<- Regresar");
btnRegresar.setBorderPainted(false);
jLabel1.setFont(new java.awt.Font("Segoe UI", 1, 12)); // NOI18N
jLabel1.setText("Descipcion");
jLabel3.setText("Zona X");
jLabel4.setText("Breve Descripcion");
jLabel5.setText("Zona de Asiento:");
jLabel3.setText("Zona:");
jLabel6.setText("Numero de Asiento:");
@ -82,26 +184,9 @@ public class MetodoPago extends javax.swing.JFrame {
jLabel12.setText("Nombre del Titular");
jTextField2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextField2ActionPerformed(evt);
}
});
jTextField5.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextField5ActionPerformed(evt);
}
});
jButton2.setBackground(new java.awt.Color(51, 51, 255));
jButton2.setForeground(new java.awt.Color(255, 255, 255));
jButton2.setText("Proceder a Pago");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
btnPagar.setBackground(new java.awt.Color(51, 51, 255));
btnPagar.setForeground(new java.awt.Color(255, 255, 255));
btnPagar.setText("Pagar");
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
@ -115,13 +200,22 @@ public class MetodoPago extends javax.swing.JFrame {
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(37, 37, 37)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(lbZona, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(jLabel1)
.addComponent(jLabel4)
.addComponent(jLabel5)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel6)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(lbNumeroAsiento, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel7)
.addComponent(jLabel8)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(lbCosto, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(49, 49, 49)
.addComponent(jLabel8))))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(30, 30, 30)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@ -129,60 +223,62 @@ public class MetodoPago extends javax.swing.JFrame {
.addComponent(jLabel9)
.addComponent(jLabel11)
.addComponent(jLabel12)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 229, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 229, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, 229, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, 229, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addComponent(txtNumeroTarjeta, javax.swing.GroupLayout.PREFERRED_SIZE, 229, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(txtTitular, javax.swing.GroupLayout.PREFERRED_SIZE, 229, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(txtFechaVencimiento, javax.swing.GroupLayout.PREFERRED_SIZE, 229, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(txtCodigo, javax.swing.GroupLayout.PREFERRED_SIZE, 229, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addContainerGap(29, Short.MAX_VALUE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jButton1))
.addComponent(btnRegresar))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(87, 87, 87)
.addComponent(jButton2)))
.addGap(107, 107, 107)
.addComponent(btnPagar)))
.addGap(0, 0, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(10, 10, 10)
.addComponent(jButton1)
.addComponent(btnRegresar)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel5)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(lbZona, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel6)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(lbNumeroAsiento, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(28, 28, 28)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel7)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(lbCosto, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(30, 30, 30)
.addComponent(jLabel8)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGap(28, 28, 28)
.addComponent(jLabel9)
.addGap(9, 9, 9)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(txtNumeroTarjeta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel10)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(txtFechaVencimiento, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(7, 7, 7)
.addComponent(jLabel11)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(txtCodigo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(7, 7, 7)
.addComponent(jLabel12)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(txtTitular, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jButton2)
.addComponent(btnPagar)
.addContainerGap(16, Short.MAX_VALUE))
);
@ -204,39 +300,54 @@ public class MetodoPago extends javax.swing.JFrame {
pack();
}// </editor-fold>//GEN-END:initComponents
private void jTextField2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField2ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jTextField2ActionPerformed
private void jTextField5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField5ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jTextField5ActionPerformed
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jButton2ActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton btnPagar;
private javax.swing.JButton btnRegresar;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel12;
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.JPanel jPanel1;
private javax.swing.JTextField jTextField1;
private javax.swing.JTextField jTextField2;
private javax.swing.JTextField jTextField3;
private javax.swing.JTextField jTextField4;
private javax.swing.JTextField jTextField5;
private javax.swing.JLabel lbCosto;
private javax.swing.JLabel lbNumeroAsiento;
private javax.swing.JLabel lbZona;
private javax.swing.JTextField txtCodigo;
private javax.swing.JTextField txtFechaVencimiento;
private javax.swing.JTextField txtNumeroTarjeta;
private javax.swing.JTextField txtTitular;
// End of variables declaration//GEN-END:variables
private void mostrarLb() {
switch (zona.getId()) {
case 1:
lbZona.setText("Zona B");
lbNumeroAsiento.setText(asiento.getNombre());
lbCosto.setText("$"+zona.getPrecio());
break;
case 2:
lbZona.setText("Zona General");
lbNumeroAsiento.setText(asiento.getNombre());
lbCosto.setText("$"+zona.getPrecio());
break;
case 3:
lbZona.setText("Zona VIP");
lbNumeroAsiento.setText(asiento.getNombre());
lbCosto.setText("$"+zona.getPrecio());
break;
case 4:
lbZona.setText("Zona C");
lbNumeroAsiento.setText(asiento.getNombre());
lbCosto.setText("$"+zona.getPrecio());
break;
default:
throw new AssertionError();
}
}
}

View File

@ -60,7 +60,7 @@
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
<Component id="btnCerrar" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="236" max="-2" attributes="0"/>
@ -75,7 +75,7 @@
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
<Component id="btnCerrar" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="9" max="-2" attributes="0"/>
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
@ -124,7 +124,7 @@
</Component>
<Component class="javax.swing.JLabel" name="jLabel4">
</Component>
<Component class="javax.swing.JButton" name="jButton1">
<Component class="javax.swing.JButton" name="btnCerrar">
<Properties>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="33" green="33" red="33" type="rgb"/>
@ -175,14 +175,17 @@
</Group>
</Group>
</Group>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="panelC" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="53" max="-2" attributes="0"/>
<Component id="jLabel7" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="32767" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Component id="panelC" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<Component id="jLabel7" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="39" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="255" max="-2" attributes="0"/>

View File

@ -36,16 +36,20 @@ public class SalaPrincipal extends javax.swing.JFrame {
panelC.addMouseListener(controlador);
panelGeneral.addMouseListener(controlador);
panelVip.addMouseListener(controlador);
btnCerrar.addMouseListener(controlador);
}
public void setBtnCerrar(JButton btnCerrar) {
this.btnCerrar = btnCerrar;
}
public JButton getBtnCerrar() {
return btnCerrar;
}
public Usuario getUser() {
return user;
}
public JButton getjButton1() {
return jButton1;
}
public JPanel getPanelB() {
return panelB;
}
@ -62,6 +66,10 @@ public class SalaPrincipal extends javax.swing.JFrame {
return panelVip;
}
public void setUser(Usuario user) {
this.user = user;
}
/**
* 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
@ -76,7 +84,7 @@ public class SalaPrincipal extends javax.swing.JFrame {
jLabel1 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
btnCerrar = new javax.swing.JButton();
jPanel2 = new javax.swing.JPanel();
jPanel4 = new javax.swing.JPanel();
jLabel5 = new javax.swing.JLabel();
@ -102,10 +110,10 @@ public class SalaPrincipal extends javax.swing.JFrame {
jLabel3.setText("de los escenarios más destacados de la ciudad. Asegura tu lugar, con cuatro zonas distintas para elegir,");
jButton1.setBackground(new java.awt.Color(51, 51, 51));
jButton1.setForeground(new java.awt.Color(255, 255, 255));
jButton1.setText("Cerrar Sesión");
jButton1.setBorderPainted(false);
btnCerrar.setBackground(new java.awt.Color(51, 51, 51));
btnCerrar.setForeground(new java.awt.Color(255, 255, 255));
btnCerrar.setText("Cerrar Sesión");
btnCerrar.setBorderPainted(false);
jPanel2.setBackground(new java.awt.Color(255, 255, 255));
@ -218,12 +226,14 @@ public class SalaPrincipal extends javax.swing.JFrame {
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(panelVip, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
.addComponent(panelC, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(53, 53, 53)
.addComponent(jLabel7)))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap())
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
.addComponent(jLabel7)
.addGap(39, 39, 39))))
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(255, 255, 255)
.addComponent(jLabel11)
@ -278,7 +288,7 @@ public class SalaPrincipal extends javax.swing.JFrame {
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jButton1))
.addComponent(btnCerrar))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(236, 236, 236)
.addComponent(jLabel2)))
@ -288,7 +298,7 @@ public class SalaPrincipal extends javax.swing.JFrame {
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jButton1)
.addComponent(btnCerrar)
.addGap(9, 9, 9)
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
@ -327,7 +337,7 @@ public class SalaPrincipal extends javax.swing.JFrame {
*/
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
private javax.swing.JButton btnCerrar;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel13;

View File

@ -319,7 +319,7 @@
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="ff" green="ff" red="ff" type="rgb"/>
</Property>
<Property name="text" type="java.lang.String" value="Seleccionar"/>
<Property name="text" type="java.lang.String" value="Comprar"/>
</Properties>
</Component>
</SubComponents>

View File

@ -1,24 +1,21 @@
package Vista;
import Controlador.ControladorBoleto;
import Modelo.Usuario;
import Modelo.Zona;
import java.awt.BorderLayout;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import Modelo.*;
import javax.swing.*;
/**
*
* @author reyes
*/
public class seleccionarBoleto extends javax.swing.JFrame {
private JPanel panelB;
private int numZona;
private int filas;
private int columnas;
private Zona zona;
private Usuario user;
private final JPanel panelB;
private final int numZona;
private final int filas;
private final int columnas;
private final Zona zona;
private final Usuario user;
public seleccionarBoleto(Zona zona, JPanel panelB, int filas, int columnas, int numZona, Usuario user) {
this.panelB = panelB;
this.numZona = numZona;
@ -194,7 +191,7 @@ public class seleccionarBoleto extends javax.swing.JFrame {
btnSeleccionarAsiento.setBackground(new java.awt.Color(51, 51, 51));
btnSeleccionarAsiento.setForeground(new java.awt.Color(255, 255, 255));
btnSeleccionarAsiento.setText("Seleccionar");
btnSeleccionarAsiento.setText("Comprar");
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);