Exemplo n.º 1
0
 /*
  * 
  */
 public Boolean BuscarPerguntaPorId(int id)
 {
     try
     {
         PerguntaDAO pDAO = new PerguntaDAO();
         if (pDAO.BuscarPerguntaPorId(id))
         {
             this.idPergunta = pDAO.idPergunta;
             this.enunciado = pDAO.enunciado;
             this.dificuldade = Convert.ToString(pDAO.dificuldade);
             this.alternativas[0] = pDAO.alternativaCorreta;
             this.alternativas[1] = pDAO.alternativaIncorreta1;
             this.alternativas[2] = pDAO.alternativaIncorreta2;
             this.alternativas[3] = pDAO.alternativaIncorreta3;
             this.alternativas[4] = pDAO.alternativaIncorreta4;
             this.estatisticas[0] = pDAO.estatisticaAltCorreta;
             this.estatisticas[1] = pDAO.estatisticaAltIncorreta1;
             this.estatisticas[2] = pDAO.estatisticaAltIncorreta2;
             this.estatisticas[3] = pDAO.estatisticaAltIncorreta3;
             this.estatisticas[4] = pDAO.estatisticaAltIncorreta4;
             this.tema = Convert.ToString(pDAO.idTema);
             return true;
         }
         else
             return false;
     }
     catch (Exception)
     {
         return false;
         //throw;
     }            
     //return (new PerguntaDAO()).BuscarPerguntaPorId(id);
 }