Subversion Repositories Integrator Subversion

Rev

Rev 106 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

package br.com.ec.controller.managedbean;

import java.io.Serializable;
import java.util.List;

import javax.inject.Inject;
import javax.inject.Named;

import org.springframework.context.annotation.Scope;

import br.com.ec.core.consulta.ParametrosConsulta;
import br.com.ec.core.generic.GenericService;
import br.com.ec.domain.model.EmpresaAdquirente;
import br.com.ec.domain.service.empresaadquirente.EmpresaAdquirenteService;
import br.com.ec.web.generic.AbstractBean;

@Named
@Scope("view")
public class EmpresaAdquirenteBean extends AbstractBean<EmpresaAdquirente> implements Serializable {

        private static final long serialVersionUID = 1L;
       
        private EmpresaAdquirenteService empresaAdquirenteService;
       
        private EmpresaAdquirente empresaAdquirenteSelecionada;

        @Inject
        public EmpresaAdquirenteBean(EmpresaAdquirenteService empresaAdquirenteService) {
                this.empresaAdquirenteService = empresaAdquirenteService;
        }
       
        @Override
        public void preCarregamento() {
                entidade = new EmpresaAdquirente();
                parametrosConsulta = new ParametrosConsulta<EmpresaAdquirente>();
                parametrosConsulta.setEntidade(entidade);
        }
       
        @Override
        public void limparEntidade() {
                EmpresaAdquirente empresaAdquirente = new EmpresaAdquirente();
                setEntidade(empresaAdquirente);
        }

        @Override
        public GenericService<EmpresaAdquirente> getService() {
                return empresaAdquirenteService;
        }
       
        @Override
        public EmpresaAdquirente getEntidade() {
                return entidade;
        }

        @Override
        public EmpresaAdquirente getId() {
                return getEntidade();
        }
       
        public EmpresaAdquirente getEmpresaAdquirenteSelecionada() {
                return empresaAdquirenteSelecionada;
        }
        public void setEmpresaAdquirenteSelecionada(EmpresaAdquirente empresaAdquirenteSelecionada) {
                this.empresaAdquirenteSelecionada = empresaAdquirenteSelecionada;
        }
       
        public List<EmpresaAdquirente> listarEmpresasAdquirentesAtivas() {
                return empresaAdquirenteService.listarEmpresasAdquirentesAtivas();
        }

        public List<EmpresaAdquirente> listarEmpresaAdquirentes() {
                return empresaAdquirenteService.consultarTodos(new EmpresaAdquirente());
        }
       
}