protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (String.IsNullOrEmpty(Request.QueryString["form"]))
                {
                    lblMensagem.Text = "Não foi Possível achar as perguntas do formulário.";
                    return;
                }

                RespostasDAL  rd       = new RespostasDAL();
                SqlDataReader form     = rd.BuscarPerguntasPorFormulario(Int32.Parse(Request.QueryString["form"].ToString()));
                string        conteudo = "";
                int           count    = 0;

                if (form.HasRows)
                {
                    while (form.Read())
                    {
                        count++;
                        conteudo += "<spam style=\"color: #8b020f\" >" + count + ". " + form["Descricao"].ToString() + "</spam> <br>" + form["Resposta"].ToString() + "<br><br>";
                    }
                }
                else
                {
                    lblMensagem.Text = "Nenhuma resposta para o formulário.";
                    return;
                }

                ltrConteudo.Text = conteudo;
            }
        }
        protected void btnEnviar_Click(object sender, EventArgs e)
        {
            try
            {
                int idFormulario = Int32.Parse(Request.Cookies["idFormulario"].Value);

                for (int i = 1; i <= Request.Cookies["idPergunta"].Values.Count; i++)
                {
                    Respostas    r  = new Respostas();
                    RespostasDAL rd = new RespostasDAL();

                    string resposta = "resposta" + Request.Cookies["idPergunta"].Values[i.ToString()].ToString();

                    if (Request.Form[resposta].Trim() == "")
                    {
                        throw new Exception("Nenhum campo pode ficar vazio!!");
                    }
                    else
                    {
                        r.Resposta     = Request.Form[resposta];
                        r.IdFormulario = idFormulario;
                        r.IdPergunta   = Int32.Parse(Request.Cookies["idPergunta"].Values[i.ToString()]);
                        r.DataResposta = DateTime.Now;

                        //string t = "";
                        rd.Inserir(r);
                    }
                }

                Response.Redirect("http://tanis.com.br");
            }
            catch (Exception ex)
            {
                lblMensagem.Text = ex.Message;
            }
        }