Rev 569 | Details | Compare with Previous | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 569 | blopes | 1 | package br.com.ec.controller; |
| 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.core.generic.GenericService; |
||
| 11 | import br.com.ec.domain.dto.FornecedorDTO; |
||
| 12 | import br.com.ec.domain.model.tipos.TipoPeriodoConsulta; |
||
| 13 | import br.com.ec.domain.service.FornecedorService; |
||
| 14 | import br.com.ec.domain.service.TransferenciaService; |
||
| 15 | import br.com.ec.web.generic.AbstractBean; |
||
| 16 | |||
| 17 | @Named |
||
| 18 | @Scope("view") |
||
| 19 | public class FornecedorBean extends AbstractBean<FornecedorDTO> implements Serializable { |
||
| 20 | |||
| 21 | private static final long serialVersionUID = 1L; |
||
| 22 | |||
| 574 | blopes | 23 | private FornecedorService fornecedorService; |
| 569 | blopes | 24 | |
| 25 | @Inject |
||
| 574 | blopes | 26 | public FornecedorBean(FornecedorService fornecedorService) { |
| 27 | this.fornecedorService = fornecedorService; |
||
| 569 | blopes | 28 | } |
| 29 | |||
| 30 | @Override |
||
| 31 | public GenericService<FornecedorDTO> getService() { |
||
| 32 | return null; |
||
| 33 | } |
||
| 34 | |||
| 35 | @Override |
||
| 36 | public FornecedorDTO getId() { |
||
| 37 | return null; |
||
| 38 | } |
||
| 39 | |||
| 40 | @Override |
||
| 41 | public void preCarregamento() { |
||
| 42 | limparEntidade(); |
||
| 43 | } |
||
| 44 | |||
| 45 | @Override |
||
| 46 | public void limparEntidade() { |
||
| 47 | setEntidade(new FornecedorDTO()); |
||
| 48 | } |
||
| 49 | |||
| 50 | /**************************************************/ |
||
| 51 | |||
| 52 | public TipoPeriodoConsulta[] getTiposPeriodoConsulta() { |
||
| 53 | return TipoPeriodoConsulta.values(); |
||
| 54 | } |
||
| 55 | |||
| 56 | /**************************************************/ |
||
| 57 | |||
| 58 | /* |
||
| 59 | public void gerarTransferencias() { |
||
| 60 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
||
| 61 | public void execute() { |
||
| 62 | transferenciaService.gerarTransferenciasAutomaticamente(getEntidade()); |
||
| 63 | LancadorMensagem.lancarSucesso("TRANSFERÊNCIAS DE " + TipoProduto.parse(getEntidade().getTipoProduto()).getDescricao() + " GERADAS COM SUCESSO"); |
||
| 64 | } |
||
| 65 | }); |
||
| 66 | } |
||
| 67 | |||
| 68 | public void efetivarTransferencias() { |
||
| 69 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
||
| 70 | public void execute() { |
||
| 71 | transferenciaService.efetivarTransferencias(getEntidade()); |
||
| 72 | LancadorMensagem.lancarSucesso("TRANSFERÊNCIAS DE " + TipoProduto.parse(getEntidade().getTipoProduto()).getDescricao() + " EFETIVADAS COM SUCESSO"); |
||
| 73 | } |
||
| 74 | }); |
||
| 75 | } |
||
| 76 | */ |
||
| 77 | } |