Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 200 | espaco | 1 | package br.com.ec.controller.managedbean; |
| 2 | |||
| 3 | import java.io.Serializable; |
||
| 4 | |||
| 5 | import javax.inject.Inject; |
||
| 6 | import javax.inject.Named; |
||
| 7 | |||
| 8 | import org.springframework.context.annotation.Scope; |
||
| 9 | |||
| 10 | import br.com.ec.controller.managedbean.consultademanda.PontoConsultaPorDemanda; |
||
| 11 | import br.com.ec.core.consulta.ParametrosConsulta; |
||
| 12 | import br.com.ec.core.generic.GenericService; |
||
| 13 | import br.com.ec.domain.model.Pessoa; |
||
| 14 | import br.com.ec.domain.model.Ponto; |
||
| 15 | import br.com.ec.domain.service.loja.LojaService; |
||
| 16 | import br.com.ec.web.generic.AbstractBean; |
||
| 17 | |||
| 18 | @Named |
||
| 19 | @Scope("view") |
||
| 20 | public class PontoConsultaBean extends AbstractBean<Ponto> implements Serializable { |
||
| 21 | |||
| 22 | private static final long serialVersionUID = 1L; |
||
| 23 | |||
| 24 | private PontoConsultaPorDemanda lazy; |
||
| 25 | |||
| 26 | private LojaService lojaService; |
||
| 27 | |||
| 28 | @Inject |
||
| 29 | public PontoConsultaBean(PontoConsultaPorDemanda lazy, LojaService lojaService) { |
||
| 30 | this.lazy = lazy; |
||
| 31 | this.lojaService = lojaService; |
||
| 32 | } |
||
| 33 | |||
| 34 | @Override |
||
| 35 | public void preCarregamento() { |
||
| 36 | entidade = new Ponto(); |
||
| 37 | parametrosConsulta = new ParametrosConsulta<Ponto>(); |
||
| 38 | parametrosConsulta.setEntidade(entidade); |
||
| 39 | prepararConsultaDemanda(); |
||
| 40 | } |
||
| 41 | |||
| 42 | @Override |
||
| 43 | public void limparEntidade() { |
||
| 44 | setEntidade(new Ponto()); |
||
| 45 | } |
||
| 46 | |||
| 47 | @Override |
||
| 48 | public GenericService<Ponto> getService() { |
||
| 49 | return null; |
||
| 50 | } |
||
| 51 | |||
| 52 | @Override |
||
| 53 | public Ponto getEntidade() { |
||
| 54 | return entidade; |
||
| 55 | } |
||
| 56 | |||
| 57 | @Override |
||
| 58 | public Ponto getId() { |
||
| 59 | return getEntidade(); |
||
| 60 | } |
||
| 61 | |||
| 62 | public PontoConsultaPorDemanda getLazy() { |
||
| 63 | return lazy; |
||
| 64 | } |
||
| 65 | public void setLazy(PontoConsultaPorDemanda lazy) { |
||
| 66 | this.lazy = lazy; |
||
| 67 | } |
||
| 68 | public void prepararConsultaDemanda() { |
||
| 69 | lazy.setarParametrosConsulta(getParametrosConsulta()); |
||
| 70 | } |
||
| 71 | |||
| 72 | public void selecionarPessoaParaConsulta(Pessoa pessoa) { |
||
| 73 | getParametrosConsulta().getEntidade().setPessoa(pessoa); |
||
| 74 | } |
||
| 75 | |||
| 76 | public void retirarPessoaParaConsulta() { |
||
| 77 | getParametrosConsulta().getEntidade().setPessoa(null); |
||
| 78 | } |
||
| 79 | |||
| 80 | } |