Package controllerTeste

Source Code of controllerTeste.EnderecoController

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

package controllerTeste;

import daoTeste.EnderecoDAO;
import model.Endereco;

/**
*
* @author IconeServidor
*/
public class EnderecoController {
   
    private Endereco endereco;
    private EnderecoDAO enderecoDAO;
   
    public EnderecoController() {
        this.endereco = new Endereco();
        this.enderecoDAO = new EnderecoDAO();
    }

    public Endereco getEndereco(String codigo) {
        endereco = enderecoDAO.getEndereco(codigo);
        return endereco;
    }

    public boolean atualizar(Endereco pEndereco) {
        boolean atualizou = false;
        endereco = pEndereco;
        if(enderecoDAO.atualizar(endereco)){
            atualizou = true;
        }
        return atualizou;
    }
   
    public boolean salvar(Endereco pEndereco) {
        boolean salvou = false;
        endereco = pEndereco;
        if(enderecoDAO.salvar(endereco)){
           salvou = true;
        }
        return salvou;
    }

    public boolean excluir(String codigo) {
        boolean excluiu = false;
        if(enderecoDAO.excluir(codigo)){
            excluiu = true;
        }else{
            excluiu = false;
        }
        return excluiu;
    }
   
}
TOP

Related Classes of controllerTeste.EnderecoController

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.