/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * jfrmInformacionCuenta.java
 *
 * Created on 25-nov-2009, 17:42:25
 */

package bbuvajava;

import javax.swing.JFrame;

/**
 *
 * @author Administrador
 */
public class jfrmInformacionCuenta extends javax.swing.JFrame {
    String id,cuenta;
    Sucursal AuxSuc;
    JFrame formularioPPal;

    /** Creates new form jfrmInformacionCuenta */
    public jfrmInformacionCuenta(String iden,String c,Sucursal suc,JFrame form) {
        id=iden;
        cuenta=c;
        formularioPPal=form;
        AuxSuc=suc;
        initComponents();

        jlblIdentificador.setText(id);
        jlblNumCuenta.setText(c);
    }

    /** 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")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jlblIdentificador = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jlblNumCuenta = new javax.swing.JLabel();
        jbtnUltimosMovimientos = new javax.swing.JButton();
        jbtnDomicilaciones = new javax.swing.JButton();
        jbtnDatosMovimiento = new javax.swing.JButton();
        jbtnCancelar = new javax.swing.JButton();
        jbtnAtras = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                formWindowClosing(evt);
            }
        });

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 12));
        jLabel1.setText("CONSULTAS - CUENTAS");

        jLabel2.setText("Identificador titular:");

        jLabel4.setText("Número Cuenta:");

        jbtnUltimosMovimientos.setText("Ultimos Movimientos");
        jbtnUltimosMovimientos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtnUltimosMovimientosActionPerformed(evt);
            }
        });

        jbtnDomicilaciones.setText("Domiciliaciones");

        jbtnDatosMovimiento.setText("Datos de un Movimiento");
        jbtnDatosMovimiento.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtnDatosMovimientoActionPerformed(evt);
            }
        });

        jbtnCancelar.setText("Cancelar");
        jbtnCancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtnCancelarActionPerformed(evt);
            }
        });

        jbtnAtras.setText("<<Atras");
        jbtnAtras.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtnAtrasActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().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()
                        .addContainerGap()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel1)
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel2)
                                    .addComponent(jLabel4))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jlblNumCuenta, javax.swing.GroupLayout.PREFERRED_SIZE, 255, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jlblIdentificador, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(112, 112, 112)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(jbtnDatosMovimiento, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jbtnDomicilaciones, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jbtnUltimosMovimientos, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 353, Short.MAX_VALUE))))
                .addContainerGap(72, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(363, Short.MAX_VALUE)
                .addComponent(jbtnAtras)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jbtnCancelar)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(jlblIdentificador))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(jlblNumCuenta))
                .addGap(27, 27, 27)
                .addComponent(jbtnUltimosMovimientos)
                .addGap(18, 18, 18)
                .addComponent(jbtnDomicilaciones)
                .addGap(18, 18, 18)
                .addComponent(jbtnDatosMovimiento)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 44, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jbtnCancelar)
                    .addComponent(jbtnAtras))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jbtnCancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnCancelarActionPerformed
        // TODO add your handling code here:
        this.dispose();
}//GEN-LAST:event_jbtnCancelarActionPerformed

    private void jbtnAtrasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnAtrasActionPerformed
        // TODO add your handling code here:
        new jfrmCuentas(AuxSuc,id,formularioPPal).setVisible(true);
        this.dispose();
}//GEN-LAST:event_jbtnAtrasActionPerformed

    private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
        // TODO add your handling code here:
        
    }//GEN-LAST:event_formWindowClosing

    private void jbtnUltimosMovimientosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnUltimosMovimientosActionPerformed
           // TODO add your handling code here:
           String texto;
           Producto cuen=AuxSuc.devuelveCuenta(cuenta);

           texto=cuen.dameUltimosMovimientos();
          
           new jfrmUltimosMovimientos(AuxSuc,texto,id,cuenta,formularioPPal).setVisible(true);
           this.dispose();
    }//GEN-LAST:event_jbtnUltimosMovimientosActionPerformed

    private void jbtnDatosMovimientoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnDatosMovimientoActionPerformed
        new jfrmDatosMovimiento(id,cuenta,AuxSuc,formularioPPal).setVisible(true);
        this.dispose();
    }//GEN-LAST:event_jbtnDatosMovimientoActionPerformed

    /**
    * @param args the command line arguments
    */
    /*
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new jfrmInformacionCuenta().setVisible(true);
            }
        });
    }*/

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JButton jbtnAtras;
    private javax.swing.JButton jbtnCancelar;
    private javax.swing.JButton jbtnDatosMovimiento;
    private javax.swing.JButton jbtnDomicilaciones;
    private javax.swing.JButton jbtnUltimosMovimientos;
    private javax.swing.JLabel jlblIdentificador;
    private javax.swing.JLabel jlblNumCuenta;
    // End of variables declaration//GEN-END:variables

}
