예제 #1
0
        private EntQuestionarioEmpresaResposta retornaPerguntaMultiplaEscolha(Int32 numero)
        {
            //armazena resposta em BD
            EntQuestionarioEmpresaResposta ent = new EntQuestionarioEmpresaResposta();

            if (((RadioButton)this.FindControl("pergunta" + (numero) + "resposta1")).Checked)
            {
                ent.Pergunta.IdPergunta         = int.Parse(((RadioButton)this.FindControl("pergunta" + (numero) + "resposta1")).Attributes["perguntaId"]);
                ent.Resposta.IdPerguntaResposta = int.Parse(((RadioButton)this.FindControl("pergunta" + (numero) + "resposta1")).Attributes["respostaId"]);
            }
            else if (((RadioButton)this.FindControl("pergunta" + (numero) + "resposta2")).Checked)
            {
                ent.Pergunta.IdPergunta         = int.Parse(((RadioButton)this.FindControl("pergunta" + (numero) + "resposta2")).Attributes["perguntaId"]);
                ent.Resposta.IdPerguntaResposta = int.Parse(((RadioButton)this.FindControl("pergunta" + (numero) + "resposta2")).Attributes["respostaId"]);
            }
            else if (((RadioButton)this.FindControl("pergunta" + (numero) + "resposta3")).Checked)
            {
                ent.Pergunta.IdPergunta         = int.Parse(((RadioButton)this.FindControl("pergunta" + (numero) + "resposta3")).Attributes["perguntaId"]);
                ent.Resposta.IdPerguntaResposta = int.Parse(((RadioButton)this.FindControl("pergunta" + (numero) + "resposta3")).Attributes["respostaId"]);
            }
            else if (((RadioButton)this.FindControl("pergunta" + (numero) + "resposta4")).Checked)
            {
                ent.Pergunta.IdPergunta         = int.Parse(((RadioButton)this.FindControl("pergunta" + (numero) + "resposta4")).Attributes["perguntaId"]);
                ent.Resposta.IdPerguntaResposta = int.Parse(((RadioButton)this.FindControl("pergunta" + (numero) + "resposta4")).Attributes["respostaId"]);
            }

            return(ent);
        }
예제 #2
0
        protected void Gravar()
        {
            IdQuestionario        = int.Parse(this.HdnIdQuestionario.Value);
            IdQuestionarioEmpresa = int.Parse(this.HdnIdQuestionarioEmpresa.Value);
            IdEmpresaCadastro     = int.Parse(this.HdnIdEmpresaCadastro.Value);
            IdTurma             = int.Parse(this.HdnIdTurma.Value);
            Pergunta            = new EntPergunta();
            Pergunta.IdPergunta = int.Parse(HdnIdPergunta.Value);
            Int32 IdResposta = int.Parse(HdnIdResposta.Value);

            EntQuestionarioEmpresaResposta temp = new EntQuestionarioEmpresaResposta();

            temp.QuestionarioEmpresa.IdQuestionarioEmpresa = IdQuestionarioEmpresa;
            temp.Pergunta.IdPergunta         = Pergunta.IdPergunta;
            temp.Resposta.IdPerguntaResposta = IdResposta;
            temp.Valor01 = this.resposta1_1.Text;
            temp.Valor02 = this.resposta1_2.Text;
            temp.Valor03 = this.resposta2_1.Text;
            temp.Valor04 = this.resposta2_2.Text;
            if (IdUsuarioLogado > 0)
            {
                temp.UsuarioDigitador.IdUsuario = IdUsuarioLogado;
            }

            new BllQuestionarioEmpresaResposta().InserirAtualizar(temp);
        }
예제 #3
0
        private EntQuestionarioEmpresaResposta retornaResposta(int IdQuestionarioEmpresa, int NumeroPergunta)
        {
            EntQuestionarioEmpresaResposta temp = new EntQuestionarioEmpresaResposta();

            temp.QuestionarioEmpresa.IdQuestionarioEmpresa = IdQuestionarioEmpresa;

            switch (NumeroPergunta)
            {
            case 2:
                temp = retornaPergunta2(temp);
                break;

            case 3:
                temp = retornaPergunta3(temp);
                break;

            case 4:
                temp = retornaPergunta4(temp);
                break;

            case 5:
                temp = retornaPergunta5(temp);
                break;

            default:
                temp = retornaPergunta6(temp, NumeroPergunta);
                break;
            }
            return(temp);
        }
예제 #4
0
        /// <summary>
        /// Retorna uma Lista de entidade de Ranking Finalista
        /// </summary>
        /// <autor>Fabio Moraes</autor>
        /// <returns><list type="EntAdmGrupo">Lista de RelRankingCandidataEstadual</list></returns>
        public EntQuestionarioEmpresaResposta ObterQuestionarioEmpresaRespostaPorPergunta(Int32 IdQuestionarioEmpresa, Int32 IdPergunta, bool isAvaliacao)
        {
            EntQuestionarioEmpresaResposta objQuestionarioEmpresaResposta = new EntQuestionarioEmpresaResposta();

            using (DbConnection connection = db.CreateConnection())
            {
                connection.Open();
                DbTransaction transaction = connection.BeginTransaction();
                try
                {
                    objQuestionarioEmpresaResposta = dalQuestionarioEmpresaResposta.ObterQuestionarioEmpresaRespostaPorPergunta(IdQuestionarioEmpresa, IdPergunta, true, transaction, db);
                    if (objQuestionarioEmpresaResposta == null)
                    {
                        objQuestionarioEmpresaResposta = dalQuestionarioEmpresaResposta.ObterQuestionarioEmpresaRespostaPorPergunta(IdQuestionarioEmpresa, IdPergunta, false, transaction, db);
                    }

                    transaction.Commit();
                }
                catch
                {
                    transaction.Rollback();
                    throw;
                }
                finally
                {
                    connection.Close();
                }
            }
            return(objQuestionarioEmpresaResposta);
        }
예제 #5
0
        public void Gravar(String pontoForte, String oportunidadeMelhoria)
        {
            IdQuestionario        = int.Parse(this.HdnIdQuestionario.Value);
            IdQuestionarioEmpresa = int.Parse(this.HdnIdQuestionarioEmpresa.Value);
            IdEmpresaCadastro     = int.Parse(this.HdnIdEmpresaCadastro.Value);
            IdTurma             = int.Parse(this.HdnIdTurma.Value);
            Pergunta            = new EntPergunta();
            Pergunta.IdPergunta = int.Parse(HdnIdPergunta.Value);
            Int32 IdResposta = int.Parse(HdnIdResposta.Value);

            EntQuestionarioEmpresaResposta temp = new EntQuestionarioEmpresaResposta();

            temp.QuestionarioEmpresa.IdQuestionarioEmpresa = IdQuestionarioEmpresa;
            temp.Pergunta.IdPergunta         = Pergunta.IdPergunta;
            temp.Resposta.IdPerguntaResposta = IdResposta;
            temp.Valor01                    = this.resposta1_1.Text;
            temp.Valor02                    = this.resposta1_2.Text;
            temp.Valor03                    = this.resposta2_1.Text;
            temp.Valor04                    = this.resposta2_2.Text;
            temp.PontoForte                 = pontoForte;
            temp.OportunidadeMelhoria       = oportunidadeMelhoria;
            temp.UsuarioAvaliador.IdUsuario = IdUsuarioLogado;

            new BllQuestionarioEmpresaResposta().InserirAtualizar(temp);
        }
예제 #6
0
        public void Gravar(String pontoForte, String oportunidadeMelhoria)
        {
            IdQuestionario        = int.Parse(this.HdnIdQuestionario.Value);
            IdQuestionarioEmpresa = int.Parse(this.HdnIdQuestionarioEmpresa.Value);
            IdEmpresaCadastro     = int.Parse(this.HdnIdEmpresaCadastro.Value);
            IdTurma             = int.Parse(this.HdnIdTurma.Value);
            Pergunta            = new EntPergunta();
            Pergunta.IdPergunta = int.Parse(this.HdnIdPergunta.Value);
            Pergunta            = new BllPergunta().ObterPerguntaPorQuestionarioEmpresaPergunta(IdQuestionarioEmpresa, Pergunta.IdPergunta, false);

            //armazena resposta em BD
            EntQuestionarioEmpresaResposta ent = new EntQuestionarioEmpresaResposta();

            ent.Justificativa       = this.TxtJustificativa.Text;
            ent.Pergunta.IdPergunta = this.Pergunta.IdPergunta;
            ent.QuestionarioEmpresa.IdQuestionarioEmpresa = this.IdQuestionarioEmpresa;
            ent.PontoForte           = pontoForte;
            ent.OportunidadeMelhoria = oportunidadeMelhoria;
            if (this.respostaSim.Checked)
            {
                ent.Resposta.IdPerguntaResposta = this.Pergunta.ListPerguntaResposta[0].IdPerguntaResposta;
                ent.RespostaBool = true;
            }
            else if (this.respostaNao.Checked)
            {
                ent.Resposta.IdPerguntaResposta = this.Pergunta.ListPerguntaResposta[1].IdPerguntaResposta;
                ent.RespostaBool = false;
            }
            ent.UsuarioAvaliador.IdUsuario = IdUsuarioLogado;
            if (ent.Resposta.IdPerguntaResposta > 0)
            {
                new BllQuestionarioEmpresaResposta().InserirAtualizar(ent);
            }
        }
예제 #7
0
        protected void Gravar()
        {
            IdQuestionario        = int.Parse(this.HdnIdQuestionario.Value);
            IdQuestionarioEmpresa = int.Parse(this.HdnIdQuestionarioEmpresa.Value);
            IdEmpresaCadastro     = int.Parse(this.HdnIdEmpresaCadastro.Value);
            IdTurma             = int.Parse(this.HdnIdTurma.Value);
            Pergunta            = new EntPergunta();
            Pergunta.IdPergunta = int.Parse(this.HdnIdPergunta.Value);
            Pergunta            = new BllPergunta().ObterPerguntaPorQuestionarioEmpresaPergunta(IdQuestionarioEmpresa, Pergunta.IdPergunta, false);

            //armazena resposta em BD
            EntQuestionarioEmpresaResposta ent = new EntQuestionarioEmpresaResposta();

            ent.Pergunta.IdPergunta = this.Pergunta.IdPergunta;
            ent.QuestionarioEmpresa.IdQuestionarioEmpresa = this.IdQuestionarioEmpresa;
            ent.Resposta.IdPerguntaResposta = this.Pergunta.ListPerguntaResposta[0].IdPerguntaResposta;
            ent.RespostaTexto = this.TxtResposta.Text;
            if (IdUsuarioLogado > 0)
            {
                ent.UsuarioDigitador.IdUsuario = IdUsuarioLogado;
            }
            if (ent.Resposta.IdPerguntaResposta > 0)
            {
                new BllQuestionarioEmpresaResposta().InserirAtualizar(ent);
            }
        }
예제 #8
0
        public void Gravar(String pontoForte, String oportunidadeMelhoria)
        {
            IdQuestionario        = int.Parse(this.HdnIdQuestionario.Value);
            IdQuestionarioEmpresa = int.Parse(this.HdnIdQuestionarioEmpresa.Value);
            IdEmpresaCadastro     = int.Parse(this.HdnIdEmpresaCadastro.Value);
            IdTurma             = int.Parse(this.HdnIdTurma.Value);
            Pergunta            = new EntPergunta();
            Pergunta.IdPergunta = int.Parse(pergunta1respostaSim.Attributes["perguntaId"]);

            List <EntQuestionarioEmpresaResposta> listaResposta = new List <EntQuestionarioEmpresaResposta>();

            //pergunta 1
            EntQuestionarioEmpresaResposta temp = new EntQuestionarioEmpresaResposta();

            temp.Pergunta.IdPergunta = int.Parse(pergunta1respostaSim.Attributes["perguntaId"]);
            temp.QuestionarioEmpresa.IdQuestionarioEmpresa = IdQuestionarioEmpresa;
            temp.Resposta.IdPerguntaResposta = int.Parse(pergunta1respostaSim.Attributes["respostaId"]);
            temp.PontoForte           = pontoForte;
            temp.OportunidadeMelhoria = oportunidadeMelhoria;
            if (pergunta1respostaSim.Checked)
            {
                temp.RespostaBool = true;
            }
            else if (pergunta1respostaNao.Checked)
            {
                temp.RespostaBool = false;
            }
            temp.UsuarioAvaliador.IdUsuario = IdUsuarioLogado;
            listaResposta.Add(temp);

            //tabela 1
            for (int i = 1; i < 11; i++)
            {
                temp = new EntQuestionarioEmpresaResposta();

                temp.QuestionarioEmpresa.IdQuestionarioEmpresa = IdQuestionarioEmpresa;
                temp.PontoForte                  = pontoForte;
                temp.OportunidadeMelhoria        = oportunidadeMelhoria;
                temp.Pergunta.IdPergunta         = int.Parse(((TextBox)this.FindControl("resposta" + (i) + "_1")).Attributes["perguntaId"]);
                temp.Resposta.IdPerguntaResposta = int.Parse(((TextBox)this.FindControl("resposta" + (i) + "_1")).Attributes["respostaId"]);
                temp.Valor01 = ((TextBox)this.FindControl("resposta" + (i) + "_1")).Text;
                temp.Valor02 = ((TextBox)this.FindControl("resposta" + (i) + "_2")).Text;
                if (((RadioButton)this.FindControl("resposta" + (i) + "_P")).Checked)
                {
                    temp.RespostaBool = true;
                }
                else
                {
                    temp.RespostaBool = false;
                }
                temp.UsuarioAvaliador.IdUsuario = IdUsuarioLogado;
                listaResposta.Add(temp);
            }

            foreach (EntQuestionarioEmpresaResposta qer in listaResposta)
            {
                new BllQuestionarioEmpresaResposta().InserirAtualizar(qer);
            }
        }
예제 #9
0
        private EntQuestionarioEmpresaResposta retornaPergunta4(EntQuestionarioEmpresaResposta temp)
        {
            temp.Pergunta.IdPergunta         = int.Parse(TxtResposta4.Attributes["perguntaId"]);
            temp.Resposta.IdPerguntaResposta = int.Parse(TxtResposta4.Attributes["respostaId"]);
            temp.RespostaTexto = TxtResposta4.Text;

            return(temp);
        }
예제 #10
0
        private EntQuestionarioEmpresaResposta retornaPergunta6(EntQuestionarioEmpresaResposta temp, int Numero)
        {
            temp.Pergunta.IdPergunta         = int.Parse(((TextBox)this.FindControl("TxtResposta" + (Numero))).Attributes["perguntaId"]);
            temp.Resposta.IdPerguntaResposta = int.Parse(((TextBox)this.FindControl("TxtResposta" + (Numero))).Attributes["respostaId"]);
            temp.RespostaTexto = ((TextBox)this.FindControl("TxtResposta" + (Numero))).Text;

            return(temp);
        }
예제 #11
0
        private Boolean Gravar()
        {
            EntQuestionarioEmpresaResposta objQuestionarioEmpresaResposta = PageToObject();

            MessageBox(this.Page, "Avaliação inserida com sucesso!");

            return(true);
        }
예제 #12
0
        protected void Gravar()
        {
            IdQuestionario        = int.Parse(this.HdnIdQuestionario.Value);
            IdQuestionarioEmpresa = int.Parse(this.HdnIdQuestionarioEmpresa.Value);
            IdEmpresaCadastro     = int.Parse(this.HdnIdEmpresaCadastro.Value);
            IdTurma = int.Parse(this.HdnIdTurma.Value);

            List <EntQuestionarioEmpresaResposta> listaResposta = new List <EntQuestionarioEmpresaResposta>();
            int i = 1;

            while (i < 38)
            {
                EntQuestionarioEmpresaResposta temp = new EntQuestionarioEmpresaResposta();
                temp.QuestionarioEmpresa.IdQuestionarioEmpresa = IdQuestionarioEmpresa;
                temp.UsuarioDigitador.IdUsuario = IdUsuarioLogado;
                if (this.FindControl("justificativa" + (i)) != null)
                {
                    temp.Justificativa = ((TextBox)this.FindControl("justificativa" + (i))).Text;
                }
                if (((RadioButton)this.FindControl("pergunta" + i + "respostaA")).Checked)
                {
                    temp.Pergunta.IdPergunta         = int.Parse(((RadioButton)this.FindControl("pergunta" + i + "respostaA")).Attributes["perguntaId"]);
                    temp.Resposta.IdPerguntaResposta = int.Parse(((RadioButton)this.FindControl("pergunta" + i + "respostaA")).Attributes["respostaId"]);
                    listaResposta.Add(temp);
                }
                else if (((RadioButton)this.FindControl("pergunta" + i + "respostaB")).Checked)
                {
                    temp.Pergunta.IdPergunta         = int.Parse(((RadioButton)this.FindControl("pergunta" + i + "respostaB")).Attributes["perguntaId"]);
                    temp.Resposta.IdPerguntaResposta = int.Parse(((RadioButton)this.FindControl("pergunta" + i + "respostaB")).Attributes["respostaId"]);
                    listaResposta.Add(temp);
                }
                else if (((RadioButton)this.FindControl("pergunta" + i + "respostaC")).Checked)
                {
                    temp.Pergunta.IdPergunta         = int.Parse(((RadioButton)this.FindControl("pergunta" + i + "respostaC")).Attributes["perguntaId"]);
                    temp.Resposta.IdPerguntaResposta = int.Parse(((RadioButton)this.FindControl("pergunta" + i + "respostaC")).Attributes["respostaId"]);
                    listaResposta.Add(temp);
                }
                else if (((RadioButton)this.FindControl("pergunta" + i + "respostaD")).Checked)
                {
                    temp.Pergunta.IdPergunta         = int.Parse(((RadioButton)this.FindControl("pergunta" + i + "respostaD")).Attributes["perguntaId"]);
                    temp.Resposta.IdPerguntaResposta = int.Parse(((RadioButton)this.FindControl("pergunta" + i + "respostaD")).Attributes["respostaId"]);
                    listaResposta.Add(temp);
                }
                if (i > 31 && i < 37)
                {
                    temp.Valor01 = ((TextBox)this.FindControl("tx1_" + (i))).Text;
                    temp.Valor02 = ((TextBox)this.FindControl("tx2_" + (i))).Text;
                    temp.Valor03 = ((TextBox)this.FindControl("tx3_" + (i))).Text;
                }
                i++;
            }

            foreach (EntQuestionarioEmpresaResposta qer in listaResposta)
            {
                new BllQuestionarioEmpresaResposta().InserirAtualizar(qer);
            }
        }
예제 #13
0
        private EntQuestionarioEmpresaResposta PageToObject()
        {
            EntQuestionarioEmpresaResposta objQuestionarioEmpresaResposta = new EntQuestionarioEmpresaResposta();

            objQuestionarioEmpresaResposta.Pergunta.PerguntaTipo.IdPerguntaTipo = int.Parse(HddnFldIdTipoPergunta.Value);
            objQuestionarioEmpresaResposta.Pergunta.IdPergunta = int.Parse(HddnFldIdPergunta.Value);
            objQuestionarioEmpresaResposta.QuestionarioEmpresa.IdQuestionarioEmpresa = int.Parse(HddnFldIdQuestionarioEmpresa.Value);

            switch (objQuestionarioEmpresaResposta.Pergunta.PerguntaTipo.IdPerguntaTipo)
            {
            case EntPerguntaTipo.PERGUNTA_TIPO_MULTIPLA_ESCOLHA_4_OPCOES:
                this.UCPerguntaMultiplaEscolha4Opcoes1.Gravar(this.TxtPontoForte.Text, this.TxtOportunidade.Text);
                break;

            case EntPerguntaTipo.PERGUNTA_TIPO_MULTIPLA_ESCOLHA_3_OPCOES:
                this.UCPerguntaMultiplaEscolha3Opcoes1.Gravar(this.TxtPontoForte.Text, this.TxtOportunidade.Text);
                break;

            case EntPerguntaTipo.PERGUNTA_TIPO_TEXTO:
                this.UCPerguntaTexto1.Gravar(this.TxtPontoForte.Text, this.TxtOportunidade.Text);
                break;

            case EntPerguntaTipo.PERGUNTA_TIPO_SIM_NAO:
                this.UCPerguntaSimNao1.Gravar(this.TxtPontoForte.Text, this.TxtOportunidade.Text);
                break;

            case EntPerguntaTipo.PERGUNTA_TIPO_ESPECIAL_31_QUESTIONARIO_GESTAO_2009_2010:
                this.UCPerguntaEspecialGestao311.Gravar(this.TxtPontoForte.Text, this.TxtOportunidade.Text);
                break;

            case EntPerguntaTipo.PERGUNTA_TIPO_ESPECIAL_1_QUESTIONARIO_RESPONSABILIDADE_SOCIAL_2009_2010:
                this.UCPerguntaEspecialResponsabilidadeSocial11.Gravar(this.TxtPontoForte.Text, this.TxtOportunidade.Text);
                break;

            case EntPerguntaTipo.PERGUNTA_TIPO_ESPECIAL_6_QUESTIONARIO_RESPONSABILIDADE_SOCIAL_2009_2010:
                this.UCPerguntaEspecialResponsabilidadeSocial61.Gravar(this.TxtPontoForte.Text, this.TxtOportunidade.Text);
                break;

            case EntPerguntaTipo.PERGUNTA_TIPO_ESPECIAL_3_QUESTIONARIO_RESPONSABILIDADE_SOCIAL_2011:
                this.UCPerguntaEspecialResponsabilidadeSocial3_1.Gravar(this.TxtPontoForte.Text, this.TxtOportunidade.Text);
                break;

            case EntPerguntaTipo.PERGUNTA_TIPO_ESPECIAL_7A_QUESTIONARIO_RESPONSABILIDADE_SOCIAL_2011:
                this.UCPerguntaEspecialResponsabilidadeSocial7a_1.Gravar(this.TxtPontoForte.Text, this.TxtOportunidade.Text);
                break;

            case EntPerguntaTipo.PERGUNTA_TIPO_ESPECIAL_8B_QUESTIONARIO_RESPONSABILIDADE_SOCIAL_2011:
                this.UCPerguntaEspecialResponsabilidadeSocial8b_1.Gravar(this.TxtPontoForte.Text, this.TxtOportunidade.Text);
                break;

            case EntPerguntaTipo.PERGUNTA_TIPO_ESPECIAL_32_QUESTIONARIO_GESTAO_2011:
                this.UCPerguntaEspecialGestao32_1.Gravar(this.TxtPontoForte.Text, this.TxtOportunidade.Text);
                break;
            }

            return(objQuestionarioEmpresaResposta);
        }
예제 #14
0
        private EntQuestionarioEmpresaResposta retornaPerguntaTexto(Int32 numero)
        {
            EntQuestionarioEmpresaResposta ent = new EntQuestionarioEmpresaResposta();

            ent.Pergunta.IdPergunta         = int.Parse(((TextBox)this.FindControl("TxtResposta" + (numero))).Attributes["perguntaId"]);
            ent.Resposta.IdPerguntaResposta = int.Parse(((TextBox)this.FindControl("TxtResposta" + (numero))).Attributes["respostaId"]);
            ent.RespostaTexto = ((TextBox)this.FindControl("TxtResposta" + (numero))).Text;

            return(ent);
        }
예제 #15
0
        private EntQuestionarioEmpresaResposta retornaResposta(int IdQuestionarioEmpresa, int NumeroPergunta, String pontoForte, String oportunidadeMelhoria)
        {
            EntQuestionarioEmpresaResposta temp = new EntQuestionarioEmpresaResposta();

            temp.QuestionarioEmpresa.IdQuestionarioEmpresa = IdQuestionarioEmpresa;
            temp = retornaPergunta6(temp, NumeroPergunta);
            temp.UsuarioAvaliador.IdUsuario = IdUsuarioLogado;
            temp.PontoForte           = pontoForte;
            temp.OportunidadeMelhoria = oportunidadeMelhoria;
            return(temp);
        }
예제 #16
0
        private EntQuestionarioEmpresaResposta retornaResposta(int IdQuestionarioEmpresa, int NumeroPergunta)
        {
            EntQuestionarioEmpresaResposta temp = new EntQuestionarioEmpresaResposta();

            temp.QuestionarioEmpresa.IdQuestionarioEmpresa = IdQuestionarioEmpresa;
            temp = retornaPergunta6(temp, NumeroPergunta);
            if (IdUsuarioLogado > 0)
            {
                temp.UsuarioDigitador.IdUsuario = IdUsuarioLogado;
            }
            return(temp);
        }
예제 #17
0
        /// <summary>
        /// Altera uma Resposta
        /// </summary>
        /// <autor>Thiago Moreira</autor>
        /// <param name="objCidade">Entidade da Cidade</param>
        /// <param name="transaction">Transaction</param>
        /// <param name="db">DataBase</param>
        public void Alterar(EntQuestionarioEmpresaResposta objQuestionarioEmpresaResposta, DbTransaction transaction, Database db)
        {
            DbCommand dbCommand = null;

            if (objQuestionarioEmpresaResposta.UsuarioAvaliador != null && objQuestionarioEmpresaResposta.UsuarioAvaliador.IdUsuario > 0)
            {
                dbCommand = db.GetStoredProcCommand("STP_AtualizaQuestionarioEmpresaRespostaAvaliador");
            }
            else
            {
                dbCommand = db.GetStoredProcCommand("STP_AtualizaQuestionarioEmpresaRespostaEmpresa");
            }
            dbCommand.CommandTimeout = BdConfig.CommmandTimeout;

            db.AddInParameter(dbCommand, "@nCEA_QUESTIONARIO_EMPRESA", DbType.Int32, objQuestionarioEmpresaResposta.QuestionarioEmpresa.IdQuestionarioEmpresa);
            db.AddInParameter(dbCommand, "@nCEA_PERGUNTA", DbType.Int32, objQuestionarioEmpresaResposta.Pergunta.IdPergunta);
            db.AddInParameter(dbCommand, "@nCEA_RESPOSTA", DbType.Int32, objQuestionarioEmpresaResposta.Resposta.IdPerguntaResposta);
            db.AddInParameter(dbCommand, "@sTX_RESPOSTA", DbType.String, objQuestionarioEmpresaResposta.RespostaTexto);
            db.AddInParameter(dbCommand, "@sTX_JUSTIFICATIVA", DbType.String, objQuestionarioEmpresaResposta.Justificativa);
            db.AddInParameter(dbCommand, "@sTX_OPORTUNIDADE_MELHORIA", DbType.String, objQuestionarioEmpresaResposta.OportunidadeMelhoria);
            db.AddInParameter(dbCommand, "@sTX_PONTO_FORTE", DbType.String, objQuestionarioEmpresaResposta.PontoForte);
            db.AddInParameter(dbCommand, "@FL_RESPOSTA_BOOL", DbType.Boolean, objQuestionarioEmpresaResposta.RespostaBool);
            db.AddInParameter(dbCommand, "@sTX_VALOR_01", DbType.String, objQuestionarioEmpresaResposta.Valor01);
            db.AddInParameter(dbCommand, "@sTX_VALOR_02", DbType.String, objQuestionarioEmpresaResposta.Valor02);
            db.AddInParameter(dbCommand, "@sTX_VALOR_03", DbType.String, objQuestionarioEmpresaResposta.Valor03);
            db.AddInParameter(dbCommand, "@sTX_VALOR_04", DbType.String, objQuestionarioEmpresaResposta.Valor04);
            db.AddInParameter(dbCommand, "@sTX_VALOR_05", DbType.String, objQuestionarioEmpresaResposta.Valor05);
            db.AddInParameter(dbCommand, "@sTX_VALOR_06", DbType.String, objQuestionarioEmpresaResposta.Valor06);
            db.AddInParameter(dbCommand, "@sTX_VALOR_07", DbType.String, objQuestionarioEmpresaResposta.Valor07);
            db.AddInParameter(dbCommand, "@sTX_VALOR_08", DbType.String, objQuestionarioEmpresaResposta.Valor08);
            db.AddInParameter(dbCommand, "@sTX_VALOR_09", DbType.String, objQuestionarioEmpresaResposta.Valor09);
            db.AddInParameter(dbCommand, "@sTX_VALOR_10", DbType.String, objQuestionarioEmpresaResposta.Valor10);
            if (objQuestionarioEmpresaResposta.UsuarioAvaliador != null && objQuestionarioEmpresaResposta.UsuarioAvaliador.IdUsuario > 0)
            {
                db.AddInParameter(dbCommand, "@nCEA_USUARIO_AVALIADOR", DbType.Int32, objQuestionarioEmpresaResposta.UsuarioAvaliador.IdUsuario);
            }
            else
            {
                db.AddInParameter(dbCommand, "@nCEA_USUARIO_AVALIADOR", DbType.Int32, DBNull.Value);
            }
            if (objQuestionarioEmpresaResposta.UsuarioDigitador != null && objQuestionarioEmpresaResposta.UsuarioDigitador.IdUsuario > 0)
            {
                db.AddInParameter(dbCommand, "@nCEA_USUARIO_DIGITADOR", DbType.Int32, objQuestionarioEmpresaResposta.UsuarioDigitador.IdUsuario);
            }
            else
            {
                db.AddInParameter(dbCommand, "@nCEA_USUARIO_DIGITADOR", DbType.Int32, DBNull.Value);
            }

            db.ExecuteNonQuery(dbCommand, transaction);
        }
예제 #18
0
        private EntQuestionarioEmpresaResposta retornaPergunta8b()
        {
            EntQuestionarioEmpresaResposta ent = new EntQuestionarioEmpresaResposta();

            ent.Pergunta.IdPergunta         = int.Parse(this.TxtResposta18_1.Attributes["perguntaId"]);
            ent.Resposta.IdPerguntaResposta = int.Parse(this.TxtResposta18_1.Attributes["respostaId"]);

            ent.Valor01 = this.TxtResposta18_1.Text;
            ent.Valor02 = this.TxtResposta18_2.Text;
            ent.Valor03 = this.TxtResposta18_3.Text;
            ent.Valor04 = this.TxtResposta18_4.Text;

            return(ent);
        }
예제 #19
0
        private EntQuestionarioEmpresaResposta retornaPergunta2(EntQuestionarioEmpresaResposta temp)
        {
            temp.Pergunta.IdPergunta         = int.Parse(pergunta2_Sim.Attributes["perguntaId"]);
            temp.Resposta.IdPerguntaResposta = int.Parse(pergunta2_Sim.Attributes["respostaId"]);
            if (pergunta2_Sim.Checked)
            {
                temp.RespostaBool = true;
            }
            else if (pergunta2_Nao.Checked)
            {
                temp.RespostaBool = false;
            }
            temp.Justificativa = TxtResposta2.Text;

            return(temp);
        }
예제 #20
0
        protected void Gravar()
        {
            IdQuestionario        = int.Parse(this.HdnIdQuestionario.Value);
            IdQuestionarioEmpresa = int.Parse(this.HdnIdQuestionarioEmpresa.Value);
            IdEmpresaCadastro     = int.Parse(this.HdnIdEmpresaCadastro.Value);
            IdTurma             = int.Parse(this.HdnIdTurma.Value);
            Pergunta            = new EntPergunta();
            Pergunta.IdPergunta = int.Parse(resposta1_1.Attributes["perguntaId"]);

            List <EntQuestionarioEmpresaResposta> listaResposta = new List <EntQuestionarioEmpresaResposta>();

            //tabela 1
            for (int i = 1; i < 9; i++)
            {
                EntQuestionarioEmpresaResposta temp = new EntQuestionarioEmpresaResposta();

                temp.QuestionarioEmpresa.IdQuestionarioEmpresa = IdQuestionarioEmpresa;
                temp.Pergunta.IdPergunta = int.Parse(((CheckBox)this.FindControl("resposta" + (i) + "_1")).Attributes["perguntaId"]);
                if (((RadioButton)this.FindControl("resposta" + (i) + "_1")).Checked)
                {
                    temp.Resposta.IdPerguntaResposta = int.Parse(((RadioButton)this.FindControl("resposta" + (i) + "_1")).Attributes["respostaId"]);
                }
                else if (((RadioButton)this.FindControl("resposta" + (i) + "_2")).Checked)
                {
                    temp.Resposta.IdPerguntaResposta = int.Parse(((RadioButton)this.FindControl("resposta" + (i) + "_2")).Attributes["respostaId"]);
                }
                else if (((RadioButton)this.FindControl("resposta" + (i) + "_3")).Checked)
                {
                    temp.Resposta.IdPerguntaResposta = int.Parse(((RadioButton)this.FindControl("resposta" + (i) + "_3")).Attributes["respostaId"]);
                }
                else if (((RadioButton)this.FindControl("resposta" + (i) + "_4")).Checked)
                {
                    temp.Resposta.IdPerguntaResposta = int.Parse(((RadioButton)this.FindControl("resposta" + (i) + "_4")).Attributes["respostaId"]);
                }
                if (IdUsuarioLogado > 0)
                {
                    temp.UsuarioDigitador.IdUsuario = IdUsuarioLogado;
                }
                listaResposta.Add(temp);
            }

            foreach (EntQuestionarioEmpresaResposta qer in listaResposta)
            {
                new BllQuestionarioEmpresaResposta().InserirAtualizar(qer);
            }
        }
예제 #21
0
        private EntQuestionarioEmpresaResposta retornaResposta(int IdQuestionarioEmpresa, int NumeroPergunta)
        {
            EntQuestionarioEmpresaResposta temp = new EntQuestionarioEmpresaResposta();

            switch (NumeroPergunta)
            {
            case 1:
            case 2:
            case 3:
            case 4:
            case 5:
            case 6:
            case 7:
            case 8:
            case 9:
            case 10:
            case 11:
            case 12:
            case 13:
            case 14:
            case 16:
                temp = retornaPerguntaMultiplaEscolha(NumeroPergunta);
                break;

            case 17:
            case 19:
            case 20:
            case 21:
            case 22:
                temp = retornaPerguntaTexto(NumeroPergunta);
                break;

            case 15:
                temp = retornaPergunta7a();
                break;

            case 18:
                temp = retornaPergunta8b();
                break;
            }
            temp.QuestionarioEmpresa.IdQuestionarioEmpresa = IdQuestionarioEmpresa;
            temp.UsuarioDigitador.IdUsuario = UsuarioLogado.IdUsuario;

            return(temp);
        }
예제 #22
0
        protected void Gravar()
        {
            IdQuestionario        = int.Parse(this.HdnIdQuestionario.Value);
            IdQuestionarioEmpresa = int.Parse(this.HdnIdQuestionarioEmpresa.Value);
            IdEmpresaCadastro     = int.Parse(this.HdnIdEmpresaCadastro.Value);
            IdTurma             = int.Parse(this.HdnIdTurma.Value);
            Pergunta            = new EntPergunta();
            Pergunta.IdPergunta = int.Parse(rdSim31.Attributes["perguntaId"]);

            List <EntQuestionarioEmpresaResposta> listaResposta = new List <EntQuestionarioEmpresaResposta>();
            int i = 31;

            while (i < 39)
            {
                EntQuestionarioEmpresaResposta temp = new EntQuestionarioEmpresaResposta();
                temp.QuestionarioEmpresa.IdQuestionarioEmpresa = IdQuestionarioEmpresa;
                temp.UsuarioDigitador.IdUsuario  = IdUsuarioLogado;
                temp.Pergunta.IdPergunta         = int.Parse(((RadioButton)this.FindControl("rdSim" + i)).Attributes["perguntaId"]);
                temp.Resposta.IdPerguntaResposta = int.Parse(((RadioButton)this.FindControl("rdSim" + i)).Attributes["respostaId"]);

                if (((RadioButton)this.FindControl("rdSim" + (i))).Checked)
                {
                    temp.RespostaBool = true;
                }
                else
                {
                    temp.RespostaBool = false;
                }
                temp.Valor01 = ((TextBox)this.FindControl("tx1_" + (i))).Text;
                temp.Valor02 = ((TextBox)this.FindControl("tx2_" + (i))).Text;
                temp.Valor03 = ((TextBox)this.FindControl("tx3_" + (i))).Text;
                i++;
                if (IdUsuarioLogado > 0)
                {
                    temp.UsuarioDigitador.IdUsuario = IdUsuarioLogado;
                }
                listaResposta.Add(temp);
            }

            foreach (EntQuestionarioEmpresaResposta qer in listaResposta)
            {
                new BllQuestionarioEmpresaResposta().InserirAtualizar(qer);
            }
        }
예제 #23
0
        /// <summary>
        /// Inclui uma QuestionarioEmpresaResposta
        /// </summary>
        /// <autor>Fabio Senziani</autor>
        /// <param name="objQuestionarioEmpresaResposta">Entidade da QuestionarioEmpresaResposta</param>
        /// <returns>Entidade de QuestionarioEmpresaResposta</returns>
        public void InserirAtualizar(EntQuestionarioEmpresaResposta objQuestionarioEmpresaResposta, Boolean AlteraEnviaQuestionario)
        {
            using (DbConnection connection = db.CreateConnection())
            {
                connection.Open();
                DbTransaction transaction = connection.BeginTransaction();
                try
                {
                    bool isAvaliador = false;
                    if (objQuestionarioEmpresaResposta.UsuarioAvaliador != null && objQuestionarioEmpresaResposta.UsuarioAvaliador.IdUsuario > 0)
                    {
                        isAvaliador = true;
                    }
                    EntQuestionarioEmpresaResposta temp = dalQuestionarioEmpresaResposta.ObterQuestionarioEmpresaRespostaPorPergunta(objQuestionarioEmpresaResposta.QuestionarioEmpresa.IdQuestionarioEmpresa, objQuestionarioEmpresaResposta.Pergunta.IdPergunta, isAvaliador, transaction, db);

                    if (AlteraEnviaQuestionario)
                    {
                        EntQuestionarioEmpresa objQuestionarioEmpresa = new BllQuestionarioEmpresa().ObterPorId(objQuestionarioEmpresaResposta.QuestionarioEmpresa.IdQuestionarioEmpresa);
                        objQuestionarioEmpresa = new BllQuestionarioEmpresa().ObterQuestionarioAtivoPorEtapa(objQuestionarioEmpresa.Questionario.IdQuestionario, objQuestionarioEmpresa.EmpresaCadastro.IdEmpresaCadastro, objQuestionarioEmpresa.Etapa.IdEtapa);
                        objQuestionarioEmpresa.EnviaQuestionario = false;
                        dalQuestionarioEmpresa.AlterarSomenteEnviaQuestionario(objQuestionarioEmpresa, transaction, db);
                    }

                    if (temp != null && temp.QuestionarioEmpresa.IdQuestionarioEmpresa > 0)
                    {
                        dalQuestionarioEmpresaResposta.Alterar(objQuestionarioEmpresaResposta, transaction, db);
                    }
                    else
                    {
                        dalQuestionarioEmpresaResposta.Inserir(objQuestionarioEmpresaResposta, transaction, db);
                    }
                    transaction.Commit();
                }
                catch
                {
                    transaction.Rollback();
                    throw;
                }
                finally
                {
                    connection.Close();
                }
            }
        }
예제 #24
0
        private EntQuestionarioEmpresa CalculaPontuacaoResponsabilidadeSocial2011(EntQuestionarioEmpresa QuestionarioEmpresa)
        {
            List <EntQuestionarioPontuacao> listaPontuacao = new List <EntQuestionarioPontuacao>();
            EntQuestionarioPontuacao        pontuacaoTemp  = new EntQuestionarioPontuacao();

            for (int i = 0; i < QuestionarioEmpresa.ListQuestionarioEmpresaResposta.Count; i++)
            {
                EntQuestionarioEmpresaResposta resposta = QuestionarioEmpresa.ListQuestionarioEmpresaResposta[i];
                if (pontuacaoTemp.Criterio.IdCriterio == 0)
                {
                    pontuacaoTemp.Criterio.IdCriterio         = resposta.Pergunta.Criterio.IdCriterio;
                    pontuacaoTemp.Questionario.IdQuestionario = QuestionarioEmpresa.Questionario.IdQuestionario;
                    pontuacaoTemp.QuestionarioEmpresa.IdQuestionarioEmpresa = QuestionarioEmpresa.IdQuestionarioEmpresa;
                    if (resposta.UsuarioAvaliador.IdUsuario > 0)
                    {
                        pontuacaoTemp.Avaliador = true;
                    }
                    pontuacaoTemp.Ponto = resposta.Resposta.Ponto;
                }
                else if (resposta.Pergunta.Criterio.IdCriterio != pontuacaoTemp.Criterio.IdCriterio || pontuacaoTemp.Avaliador != (resposta.UsuarioAvaliador.IdUsuario > 0))
                {
                    listaPontuacao.Add(pontuacaoTemp);
                    pontuacaoTemp = new EntQuestionarioPontuacao();
                    pontuacaoTemp.Criterio.IdCriterio         = resposta.Pergunta.Criterio.IdCriterio;
                    pontuacaoTemp.Questionario.IdQuestionario = QuestionarioEmpresa.Questionario.IdQuestionario;
                    pontuacaoTemp.QuestionarioEmpresa.IdQuestionarioEmpresa = QuestionarioEmpresa.IdQuestionarioEmpresa;
                    if (resposta.UsuarioAvaliador.IdUsuario > 0)
                    {
                        pontuacaoTemp.Avaliador = true;
                    }
                    pontuacaoTemp.Ponto = resposta.Resposta.Ponto;
                }
                else
                {
                    pontuacaoTemp.Ponto += resposta.Resposta.Ponto;
                }
            }
            listaPontuacao.Add(pontuacaoTemp);

            //Falta parte de resultados

            QuestionarioEmpresa.ListQuestionarioPontuacao = listaPontuacao;
            return(QuestionarioEmpresa);
        }
예제 #25
0
        public void Gravar(String pontoForte, String oportunidadeMelhoria)
        {
            IdQuestionario        = int.Parse(this.HdnIdQuestionario.Value);
            IdQuestionarioEmpresa = int.Parse(this.HdnIdQuestionarioEmpresa.Value);
            IdEmpresaCadastro     = int.Parse(this.HdnIdEmpresaCadastro.Value);
            IdTurma             = int.Parse(this.HdnIdTurma.Value);
            Pergunta            = new EntPergunta();
            Pergunta.IdPergunta = int.Parse(this.HdnIdPergunta.Value);
            Pergunta            = new BllPergunta().ObterPerguntaPorQuestionarioEmpresaPergunta(IdQuestionarioEmpresa, Pergunta.IdPergunta, false);

            //armazena resposta em BD
            EntQuestionarioEmpresaResposta ent = new EntQuestionarioEmpresaResposta();

            ent.PontoForte           = pontoForte;
            ent.OportunidadeMelhoria = oportunidadeMelhoria;
            ent.Valor01             = this.tx1_31.Text;
            ent.Valor02             = this.tx2_31.Text;
            ent.Valor03             = this.tx3_31.Text;
            ent.Pergunta.IdPergunta = this.Pergunta.IdPergunta;
            ent.QuestionarioEmpresa.IdQuestionarioEmpresa = this.IdQuestionarioEmpresa;
            if (this.radioA.Checked)
            {
                ent.Resposta.IdPerguntaResposta = this.Pergunta.ListPerguntaResposta[0].IdPerguntaResposta;
            }
            else if (this.radioB.Checked)
            {
                ent.Resposta.IdPerguntaResposta = this.Pergunta.ListPerguntaResposta[1].IdPerguntaResposta;
            }
            else if (this.radioC.Checked)
            {
                ent.Resposta.IdPerguntaResposta = this.Pergunta.ListPerguntaResposta[2].IdPerguntaResposta;
            }
            else if (this.radioD.Checked)
            {
                ent.Resposta.IdPerguntaResposta = this.Pergunta.ListPerguntaResposta[3].IdPerguntaResposta;
            }

            ent.UsuarioAvaliador.IdUsuario = IdUsuarioLogado;
            if (ent.Resposta.IdPerguntaResposta > 0)
            {
                new BllQuestionarioEmpresaResposta().InserirAtualizar(ent);
            }
        }
예제 #26
0
        protected void Gravar()
        {
            IdQuestionario        = int.Parse(this.HdnIdQuestionario.Value);
            IdQuestionarioEmpresa = int.Parse(this.HdnIdQuestionarioEmpresa.Value);
            IdEmpresaCadastro     = int.Parse(this.HdnIdEmpresaCadastro.Value);
            IdTurma             = int.Parse(this.HdnIdTurma.Value);
            Pergunta            = new EntPergunta();
            Pergunta.IdPergunta = int.Parse(this.HdnIdPergunta.Value);
            Pergunta            = new BllPergunta().ObterPerguntaPorQuestionarioEmpresaPergunta(IdQuestionarioEmpresa, Pergunta.IdPergunta, false);

            //armazena resposta em BD
            EntQuestionarioEmpresaResposta ent = new EntQuestionarioEmpresaResposta();

            ent.Valor01             = this.tx1_31.Text;
            ent.Valor02             = this.tx2_31.Text;
            ent.Valor03             = this.tx3_31.Text;
            ent.Pergunta.IdPergunta = this.Pergunta.IdPergunta;
            ent.QuestionarioEmpresa.IdQuestionarioEmpresa = this.IdQuestionarioEmpresa;
            if (this.respostaSelecionada.Value.Equals("A"))
            {
                ent.Resposta.IdPerguntaResposta = this.Pergunta.ListPerguntaResposta[0].IdPerguntaResposta;
            }
            else if (this.respostaSelecionada.Value.Equals("B"))
            {
                ent.Resposta.IdPerguntaResposta = this.Pergunta.ListPerguntaResposta[1].IdPerguntaResposta;
            }
            else if (this.respostaSelecionada.Value.Equals("C"))
            {
                ent.Resposta.IdPerguntaResposta = this.Pergunta.ListPerguntaResposta[2].IdPerguntaResposta;
            }
            else if (this.respostaSelecionada.Value.Equals("D"))
            {
                ent.Resposta.IdPerguntaResposta = this.Pergunta.ListPerguntaResposta[3].IdPerguntaResposta;
            }
            if (IdUsuarioLogado > 0)
            {
                ent.UsuarioDigitador.IdUsuario = IdUsuarioLogado;
            }
            if (ent.Resposta.IdPerguntaResposta > 0)
            {
                new BllQuestionarioEmpresaResposta().InserirAtualizar(ent);
            }
        }
예제 #27
0
        private String GerarRespostaAutomatica(EntQuestionarioEmpresaResposta objQuestionarioEmpresaResposta)
        {
            String html = "";

            html += "    <tr>";
            html += "       <td colspan='2'>";
            html += "<b>Comentário para a empresa:</b>";
            html += "       </td>";
            html += "    </tr>";
            html += "    <tr>";
            html += "       <td style='width:30px;border:1px solid black;text-align:center;'>";
            html += GerarLetra(objQuestionarioEmpresaResposta.Resposta.Ordem);
            html += "       </td>";
            html += "       <td style='border:1px solid black;'>";
            html += objQuestionarioEmpresaResposta.Resposta.RespostaAutomatica;
            html += "       </td>";
            html += "    </tr>";

            return(html);
        }
예제 #28
0
        protected void Gravar()
        {
            IdQuestionario        = int.Parse(this.HdnIdQuestionario.Value);
            IdQuestionarioEmpresa = int.Parse(this.HdnIdQuestionarioEmpresa.Value);
            IdEmpresaCadastro     = int.Parse(this.HdnIdEmpresaCadastro.Value);
            IdTurma = int.Parse(this.HdnIdTurma.Value);

            List <EntQuestionarioEmpresaResposta> listaResposta = new List <EntQuestionarioEmpresaResposta>();
            int i = 1;

            while (i < 31)
            {
                EntQuestionarioEmpresaResposta temp = new EntQuestionarioEmpresaResposta();
                temp.QuestionarioEmpresa.IdQuestionarioEmpresa = IdQuestionarioEmpresa;
                temp.UsuarioDigitador.IdUsuario = IdUsuarioLogado;
                if (((RadioButton)this.FindControl("pergunta" + i + "respostaA")).Checked)
                {
                    temp.Pergunta.IdPergunta         = int.Parse(((RadioButton)this.FindControl("pergunta" + i + "respostaA")).Attributes["perguntaId"]);
                    temp.Resposta.IdPerguntaResposta = int.Parse(((RadioButton)this.FindControl("pergunta" + i + "respostaA")).Attributes["respostaId"]);
                    listaResposta.Add(temp);
                }
                else if (((RadioButton)this.FindControl("pergunta" + i + "respostaB")).Checked)
                {
                    temp.Pergunta.IdPergunta         = int.Parse(((RadioButton)this.FindControl("pergunta" + i + "respostaB")).Attributes["perguntaId"]);
                    temp.Resposta.IdPerguntaResposta = int.Parse(((RadioButton)this.FindControl("pergunta" + i + "respostaB")).Attributes["respostaId"]);
                    listaResposta.Add(temp);
                }
                else if (((RadioButton)this.FindControl("pergunta" + i + "respostaC")).Checked)
                {
                    temp.Pergunta.IdPergunta         = int.Parse(((RadioButton)this.FindControl("pergunta" + i + "respostaC")).Attributes["perguntaId"]);
                    temp.Resposta.IdPerguntaResposta = int.Parse(((RadioButton)this.FindControl("pergunta" + i + "respostaC")).Attributes["respostaId"]);
                    listaResposta.Add(temp);
                }
                i++;
            }

            foreach (EntQuestionarioEmpresaResposta qer in listaResposta)
            {
                new BllQuestionarioEmpresaResposta().InserirAtualizar(qer);
            }
        }
예제 #29
0
        private EntQuestionarioEmpresaResposta retornaPergunta5(EntQuestionarioEmpresaResposta temp)
        {
            temp.Pergunta.IdPergunta = int.Parse(pergunta5respostaA.Attributes["perguntaId"]);
            if (pergunta5respostaA.Checked)
            {
                temp.Resposta.IdPerguntaResposta = int.Parse(pergunta5respostaA.Attributes["respostaId"]);
            }
            else if (pergunta5respostaB.Checked)
            {
                temp.Resposta.IdPerguntaResposta = int.Parse(pergunta5respostaB.Attributes["respostaId"]);
            }
            else if (pergunta5respostaC.Checked)
            {
                temp.Resposta.IdPerguntaResposta = int.Parse(pergunta5respostaC.Attributes["respostaId"]);
            }
            else if (pergunta5respostaD.Checked)
            {
                temp.Resposta.IdPerguntaResposta = int.Parse(pergunta5respostaD.Attributes["respostaId"]);
            }

            return(temp);
        }
예제 #30
0
        /// <summary>
        /// Popula Questionario Empresa Resposta, conforme DataReader passado
        /// </summary>
        /// <autor>Thiago Moreira</autor>
        /// <param name="dtrDados">DataReader a ser percorrido.</param>
        /// <returns><list type="EntQuestionarioEmpresa">Lista de EntQuestionarioEmpresa</list></returns>
        private List <EntQuestionarioEmpresaResposta> PopularAvaliacao(DbDataReader dtrDados)
        {
            List <EntQuestionarioEmpresaResposta> listEntReturn = new List <EntQuestionarioEmpresaResposta>();
            EntQuestionarioEmpresaResposta        entReturn;

            try
            {
                while (dtrDados.Read())
                {
                    entReturn = new EntQuestionarioEmpresaResposta();

                    entReturn.Pergunta.IdPergunta         = ObjectUtils.ToInt(dtrDados["CEA_PERGUNTA"]);
                    entReturn.Resposta.IdPerguntaResposta = ObjectUtils.ToInt(dtrDados["CEA_RESPOSTA"]);
                    entReturn.UsuarioAvaliador.IdUsuario  = ObjectUtils.ToInt(dtrDados["CEA_USUARIO_AVALIADOR"]);
                    entReturn.QuestionarioEmpresa.IdQuestionarioEmpresa = ObjectUtils.ToInt(dtrDados["CEA_QUESTIONARIO_EMPRESA"]);
                    entReturn.Justificativa        = ObjectUtils.ToString(dtrDados["TX_JUSTIFICATIVA"]);
                    entReturn.OportunidadeMelhoria = ObjectUtils.ToString(dtrDados["TX_OPORTUNIDADE_MELHORIA"]);
                    entReturn.Pergunta.Pergunta    = ObjectUtils.ToString(dtrDados["TX_PERGUNTA"]);
                    entReturn.QuestionarioEmpresa.Questionario.Questionario   = ObjectUtils.ToString(dtrDados["TX_QUESTIONARIO"]);
                    entReturn.QuestionarioEmpresa.Questionario.IdQuestionario = ObjectUtils.ToInt(dtrDados["CEA_QUESTIONARIO"]);
                    entReturn.QuestionarioEmpresa.Etapa.IdEtapa    = ObjectUtils.ToInt(dtrDados["CEA_ETAPA"]);
                    entReturn.Pergunta.PerguntaTipo.IdPerguntaTipo = ObjectUtils.ToInt(dtrDados["CEA_PERGUNTA_TIPO"]);
                    entReturn.Pergunta.Ordem         = ObjectUtils.ToInt(dtrDados["NU_ORDEM"]);
                    entReturn.Pergunta.NumeroQuestao = ObjectUtils.ToString(dtrDados["NU_QUESTAO"]);

                    listEntReturn.Add(entReturn);
                }

                dtrDados.Close();
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(listEntReturn);
        }