public Types.QuestionariosType select(int id_associacao, int id_empresa)
        {
            MySqlConnection con = new MySqlConnection(Dados.StringConexao);

            string SQL = "SELECT * FROM questionario q WHERE id_associacao = @id_associacao";

            MySqlCommand cmd = new MySqlCommand(SQL, con);
            cmd.Parameters.AddWithValue("@id_associacao",id_associacao);

            con.Open();
            MySqlDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);

            Types.QuestionariosType types = new Types.QuestionariosType();
            QuestionarioRespostaDAL dalResposta = new QuestionarioRespostaDAL();
            while (dr.Read())
            {
                Types.QuestionarioType type = new Types.QuestionarioType();
                type.idQuestionario = Int32.Parse(dr["id_questionario"].ToString());
                type.IdAssociacao = Int32.Parse(dr["id_associacao"].ToString());
                type.Tipo = dr["tipo"].ToString();
                type.Descricao = dr["descricao"].ToString();
                if (id_empresa > 0)
                {
                    type.Respostas = dalResposta.select(Convert.ToInt32(id_empresa), type.idQuestionario);
                }
                types.Add(type);
            }
            return types;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            int id = Convert.ToInt32(Request.QueryString["id"]);

            try
            {
                if ( id > 0)
                {
                    BLL.EmpresaBLL BLL = new BLL.EmpresaBLL();
                    DadosEmpresa = BLL.selectRecord(id);
                    if (DadosEmpresa.IdAssociacao != Master.SessionAssociacaoId)
                        throw new Exception("IdAssociacao invalido");

                    BLL.QuestionarioBLL QuestBLL = new BLL.QuestionarioBLL();
                    RespostasQuestionario = QuestBLL.select(DadosEmpresa.IdAssociacao, DadosEmpresa.IdEmpresa);
                }
                else
                {
                    throw new Exception("No id");
                }
            }
            catch (Exception)
            {
                Session["FlashMsg"] = "Ocorreu um erro";
                Session["FlashMsgType"] = "danger";
                Response.Redirect("~/Painel/Empresas.aspx");
            }

            this.DataBind();
        }