Esempio n. 1
0
 /**
  * @param OcorrenciaDTO $dto
  * @return bool
  * @throws Exception
  */
 public function gravar(OcorrenciaDTO $dto)
 {
     if ($dto->getCdOcorrencia() == '') {
         if (!($obj = $this->insert($dto))) {
             throw new Exception('Impossível Inserir Ocorrencia');
         }
     } else {
         if (!($obj = $this->update($dto))) {
             throw new Exception('Impossível Atualizar Ocorrencia');
         }
     }
     return $obj;
 }
Esempio n. 2
0
 private function setDados()
 {
     $dto = new OcorrenciaDTO();
     $dto->setCdOcorrencia(Input::get('cd_ocorrencia'))->setCdSetor((int) Input::get('cd_setor'))->setCdPfInformante(Input::get('informante'))->setDescAssunto(Input::get('assunto'))->setDescOcorrencia(Input::get('descricao'))->setDtOcorrencia(Input::get('dt_ocorrencia'))->setDtFim(Input::get('dt_fim'))->setDescConclusao(Input::get('desc_conclusao'))->setCdCatgEstagio(Input::get('estagio') ? 3 : null)->setCdVlCatgEstagio(Input::get('estagio'))->setCdCatgTipo(Input::get('tipo') ? 12 : null)->setCdVlCatgTipo(Input::get('tipo'))->setCdUsuarioCriacao(Session::get('user'))->setDtUsuarioCriacao('now()')->setCdUsuarioAtualiza(Session::get('user'))->setDtUsuarioAtualiza('now()');
     return $dto;
 }
Esempio n. 3
0
 public function getPessoasEnvolvidas(OcorrenciaPessoaFisicaEnvolvidaModel $pessoas)
 {
     return $pessoas->getPessoasPorOcorrencia(new PessoaFisicaModel(), $this->dto->getCdOcorrencia());
 }