
package bbuvajava;

public class jfrmDomicializaciones extends javax.swing.JFrame {
    Sucursal auxsuc;
    public jfrmDomicializaciones(Sucursal suc) {
        initComponents();
        auxsuc=suc;
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel2 = new javax.swing.JLabel();
        TBcliente = new javax.swing.JTextField();
        Brealizar = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        Tarea = new javax.swing.JTextArea();
        LabelPrincipal = new javax.swing.JLabel();

        jLabel2.setText("CLIENTE: ");

        TBcliente.setText("20984002161000015263");

        Brealizar.setText("REALIZAR");
        Brealizar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BrealizarActionPerformed(evt);
            }
        });

        Tarea.setColumns(20);
        Tarea.setRows(5);
        Tarea.setEnabled(false);
        jScrollPane1.setViewportView(Tarea);

        LabelPrincipal.setFont(new java.awt.Font("Tahoma", 0, 14));
        LabelPrincipal.setForeground(new java.awt.Color(255, 0, 0));
        LabelPrincipal.setText("DOMICIALIZACIONES");

        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(189, 189, 189)
                        .addComponent(Brealizar))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(45, 45, 45)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 374, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel2)
                                .addGap(28, 28, 28)
                                .addComponent(TBcliente, javax.swing.GroupLayout.PREFERRED_SIZE, 232, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(170, 170, 170)
                        .addComponent(LabelPrincipal)))
                .addContainerGap(54, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(20, 20, 20)
                .addComponent(LabelPrincipal, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(32, 32, 32)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(TBcliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addComponent(Brealizar)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 239, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(24, Short.MAX_VALUE))
        );

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

    private void BrealizarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BrealizarActionPerformed
        String cliente=TBcliente.getText();
        Producto p=auxsuc.get_Producto(cliente);
        if(p!=null){
            String mensaje;
            mensaje=p.mostrar_domicializaciones();
            Tarea.setText(mensaje);
        }
        else{
            TBcliente.setText("NºCuenta incorrecto.");
        }
    }//GEN-LAST:event_BrealizarActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton Brealizar;
    private javax.swing.JLabel LabelPrincipal;
    private javax.swing.JTextField TBcliente;
    private javax.swing.JTextArea Tarea;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JScrollPane jScrollPane1;
    // End of variables declaration//GEN-END:variables

}
