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

/*
 * jfrmArqueo.java
 *
 * Created on 29-dic-2009, 11:46:38
 */

package javacgc;

/**
 *
 * @author Cinta
 */
public class jfrmArqueo extends javax.swing.JFrame {
Sucursal s;
Caja c;
Empleado e;
    /** Creates new form jfrmArqueo */
    public jfrmArqueo(Sucursal su, Caja ca, Empleado em) {
        s=su;
        c=ca;
        e=em;
        initComponents();
        jlblcantidad.setText(String.valueOf(c.getSaldo()));
    }

    /** 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();
        jlblcantidad = new javax.swing.JLabel();
        jbttnconfirmar = new javax.swing.JButton();
        jbttnNoconfirmar = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel1.setText("ARQUEO");

        jLabel2.setText("Confirme si esta cantidad es la correcta: ");

        jbttnconfirmar.setText("Confirmar");
        jbttnconfirmar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbttnconfirmarActionPerformed(evt);
            }
        });

        jbttnNoconfirmar.setText("No confirmado");
        jbttnNoconfirmar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbttnNoconfirmarActionPerformed(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()
                        .addGap(116, 116, 116)
                        .addComponent(jLabel1))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(42, 42, 42)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jbttnconfirmar)
                                .addGap(26, 26, 26)
                                .addComponent(jbttnNoconfirmar))
                            .addComponent(jLabel2)))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(64, 64, 64)
                        .addComponent(jlblcantidad)))
                .addContainerGap(40, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addGap(31, 31, 31)
                .addComponent(jLabel2)
                .addGap(35, 35, 35)
                .addComponent(jlblcantidad)
                .addGap(62, 62, 62)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jbttnconfirmar)
                    .addComponent(jbttnNoconfirmar))
                .addContainerGap(39, Short.MAX_VALUE))
        );

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

    private void jbttnconfirmarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbttnconfirmarActionPerformed
        if(c.arqueoInicial(e)!=null){
        new JFramePrincipal(s,c).setVisible(true);}
    }//GEN-LAST:event_jbttnconfirmarActionPerformed

    private void jbttnNoconfirmarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbttnNoconfirmarActionPerformed
        //new jfrmParteDif(c,s).setVisible(true);
        Arqueo arq=c.arqueoInicial(e);
        if(c!=null && e!=null && arq!=null) {
             new jfrmParteDif(c,s,arq).setVisible(true);
            }
    }//GEN-LAST:event_jbttnNoconfirmarActionPerformed

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

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JButton jbttnNoconfirmar;
    private javax.swing.JButton jbttnconfirmar;
    private javax.swing.JLabel jlblcantidad;
    // End of variables declaration//GEN-END:variables

}
