Package maissocial.gui

Source Code of maissocial.gui.LogradouroGUI

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

package maissocial.gui;

import java.util.Date;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import maissocial.controle.Fachada;
import maissocial.entidade.Bairro;
import maissocial.entidade.Logradouro;
import maissocial.entidade.TipoLogradouro;

/**
*
* @author luciano
*/
public class LogradouroGUI {

    public static void main(String[] args){


        Bairro br = null;
        TipoLogradouro tl = null;
        Logradouro lg = null;
        Date data = new Date();

        try {
            br = Fachada.getInstance().getBairroControle().pesquisarBairroPorCodigo(1);
            tl = Fachada.getInstance().getTpLogradouroControle().pesquisarTipoLogradouroPorCodigo(1);
            lg = new Logradouro (br, tl, "Frei Caneca", "55.000-000", 1, data);
            Fachada.getInstance().getLogradouroControle().salvarLogradouro(lg);
            JOptionPane.showMessageDialog(null, "Logradouro cadastrado com sucesso!");
            Logradouro lg2 = Fachada.getInstance().getLogradouroControle().pesquisarLogradouroPorCodigo(1);
            System.out.print(lg2.getNome());

        } catch (Exception ex) {
            Logger.getLogger(LogradouroGUI.class.getName()).log(Level.SEVERE, null, ex);
        }

    }

}
TOP

Related Classes of maissocial.gui.LogradouroGUI

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.