| 1 | |
package br.mia.test.controler; |
| 2 | |
|
| 3 | |
import java.util.List; |
| 4 | |
|
| 5 | |
import br.mia.test.model.Atividade; |
| 6 | |
import br.mia.test.model.Build; |
| 7 | |
import br.mia.test.model.CasoUso; |
| 8 | |
import br.mia.test.model.Cronograma; |
| 9 | |
import br.mia.test.model.Projeto; |
| 10 | |
import br.mia.test.model.dao.DAOProject; |
| 11 | |
import br.mia.test.model.dao.DAOTarefa; |
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
|
| 17 | |
|
| 18 | |
|
| 19 | 0 | public class ControladorCronograma |
| 20 | 0 | { |
| 21 | |
|
| 22 | |
|
| 23 | |
|
| 24 | |
|
| 25 | |
|
| 26 | |
|
| 27 | |
public final void deletar(final Atividade atividade) { |
| 28 | 0 | DAOTarefa dao = new DAOTarefa(); |
| 29 | 0 | |
| 30 | |
try { |
| 31 | 0 | dao.delete(atividade); |
| 32 | 0 | |
| 33 | 0 | } catch (Exception erro) { |
| 34 | 0 | ControladorErro.trata(erro, this); |
| 35 | 0 | } |
| 36 | 0 | } |
| 37 | 0 | |
| 38 | |
|
| 39 | |
|
| 40 | |
|
| 41 | |
|
| 42 | |
|
| 43 | |
|
| 44 | |
public final void gera(final Projeto projeto, final Build build) { |
| 45 | |
|
| 46 | |
try { |
| 47 | |
|
| 48 | 0 | DAOProject daoProject = new DAOProject(); |
| 49 | 0 | |
| 50 | 0 | List<CasoUso> array = null; |
| 51 | 0 | |
| 52 | 0 | array = daoProject.selectEscopo(projeto, build); |
| 53 | 0 | |
| 54 | 0 | Cronograma cronograma = new Cronograma(); |
| 55 | 0 | |
| 56 | 0 | cronograma.criaCronograma(array, projeto, build); |
| 57 | 0 | } catch (Exception erro) { |
| 58 | 0 | ControladorErro.trata(erro, this); |
| 59 | 0 | } |
| 60 | |
|
| 61 | 0 | } |
| 62 | 0 | |
| 63 | |
|
| 64 | |
|
| 65 | |
|
| 66 | |
|
| 67 | |
|
| 68 | |
public final void atualiza(final Atividade atividade) { |
| 69 | |
|
| 70 | 0 | DAOTarefa dao = new DAOTarefa(); |
| 71 | 0 | |
| 72 | |
try { |
| 73 | 0 | dao.update(atividade); |
| 74 | 0 | |
| 75 | 0 | } catch (Exception erro) { |
| 76 | 0 | ControladorErro.trata(erro, this); |
| 77 | 0 | } |
| 78 | |
|
| 79 | 0 | } |
| 80 | 0 | |
| 81 | |
} |