
import java.text.ParseException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JFrame;

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

/*
 * jfrmRemesaCargos.java
 *
 * Created on 11-nov-2009, 18:12:33
 */

/**
 *
 * @author acc_local
 */
public class jfrmRemesaCargos extends javax.swing.JFrame {

    JFrame auxJf;
    Sucursal sucAux = new Sucursal();
    /** Creates new form jfrmRemesaCargos */
    public jfrmRemesaCargos(Sucursal suc,JFrame jf) {
        auxJf=jf;
        initComponents();
        sucAux = suc;
    }


    /** 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();
        jtxtPathFicheroRemesa = new javax.swing.JTextField();
        jScrollPane1 = new javax.swing.JScrollPane();
        jtxtaVerRemesa = new javax.swing.JTextArea();
        jbtImportar = new javax.swing.JButton();
        jbtValidar = new javax.swing.JButton();
        jLabel6 = new javax.swing.JLabel();
        label1 = new java.awt.Label();

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

        jLabel1.setFont(new java.awt.Font("Comic Sans MS", 1, 18));
        jLabel1.setText("Tratamiento de Remesa de Cargos");

        jLabel2.setFont(new java.awt.Font("Comic Sans MS", 0, 14));
        jLabel2.setText("Fichero a tratar: ");

        jtxtaVerRemesa.setColumns(20);
        jtxtaVerRemesa.setRows(5);
        jScrollPane1.setViewportView(jtxtaVerRemesa);

        jbtImportar.setFont(new java.awt.Font("Comic Sans MS", 0, 12));
        jbtImportar.setText("Importar");
        jbtImportar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtImportarActionPerformed(evt);
            }
        });

        jbtValidar.setFont(new java.awt.Font("Comic Sans MS", 0, 12));
        jbtValidar.setText("Validar");
        jbtValidar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtValidarActionPerformed(evt);
            }
        });

        jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/EstafadorLogo2.JPG"))); // NOI18N

        label1.setFont(new java.awt.Font("Comic Sans MS", 1, 48));
        label1.setText("SwindlerBank");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel6)
                .addGap(90, 90, 90)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(label1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel1))
                .addContainerGap())
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 579, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(94, 94, 94)
                        .addComponent(jLabel2)
                        .addGap(51, 51, 51)
                        .addComponent(jtxtPathFicheroRemesa, javax.swing.GroupLayout.PREFERRED_SIZE, 229, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 54, Short.MAX_VALUE)
                        .addComponent(jbtImportar)))
                .addGap(48, 48, 48))
            .addGroup(layout.createSequentialGroup()
                .addGap(294, 294, 294)
                .addComponent(jbtValidar)
                .addContainerGap(306, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                        .addGap(20, 20, 20)
                        .addComponent(label1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(42, 42, 42)
                        .addComponent(jLabel1))
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, 193, Short.MAX_VALUE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(jtxtPathFicheroRemesa, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jbtImportar))
                .addGap(18, 18, 18)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 206, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(35, 35, 35)
                .addComponent(jbtValidar)
                .addGap(29, 29, 29))
        );

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

    @SuppressWarnings("empty-statement")
    private void jbtImportarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtImportarActionPerformed
        // TODO add your handling code here:
        String mensaje = sucAux.verRemesaCargos(jtxtPathFicheroRemesa.getText());

        jtxtaVerRemesa.setText(mensaje);;
}//GEN-LAST:event_jbtImportarActionPerformed

    private void jbtValidarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtValidarActionPerformed
        try {
            // TODO add your handling code here:
            sucAux.incorporarRemesa(jtxtPathFicheroRemesa.getText());
        } catch (ParseException ex) {
            Logger.getLogger(jfrmRemesaCargos.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_jbtValidarActionPerformed

 /*<<<<<<< .mine
   
     try {
            auxsuc.incorporarRemesa(jtxtPathFicheroRemesa.getText());
        } catch (ParseException ex) {
            Logger.getLogger(jfrmRemesaCargos.class.getName()).log(Level.SEVERE, null, ex);
        }
     */

    private void formWindowClosed(java.awt.event.WindowEvent evt) {                                  
        // TODO add your handling code here:
    }                                 

 /*=======
   
     try {
            auxsuc.incorporarRemesa(jtxtPathFicheroRemesa.getText());
        } catch (ParseException ex) {
            Logger.getLogger(jfrmRemesaCargos.class.getName()).log(Level.SEVERE, null, ex);
        }
     */

    private void formWindowClosed(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosed
        auxJf.setEnabled(true);
    }//GEN-LAST:event_formWindowClosed

    private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
        auxJf.setEnabled(true);
    }//GEN-LAST:event_formWindowClosing

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

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JButton jbtImportar;
    private javax.swing.JButton jbtValidar;
    private javax.swing.JTextField jtxtPathFicheroRemesa;
    private javax.swing.JTextArea jtxtaVerRemesa;
    private java.awt.Label label1;
    // End of variables declaration//GEN-END:variables

}
