protected void ButtonEnviar_Click(object sender, EventArgs e) { try { SqlComite com = new SqlComite(); DataSet dsVal = new DataSet(); dsVal = com.GetEstado(idUsuario); contadorEstado = Convert.ToInt32(dsVal.Tables[0].Rows[0].ItemArray[0].ToString()); if (contadorEstado >= 1) { alertaEstado = "<br/><p>Estimado(a): Ya posee una respuesta registrada.</p>"; divAlert.Visible = true; } else { SqlComite con = new SqlComite(); DataSet ds = new DataSet(); usuario = lblUserID.Text.ToString(); nombre = TextBoxNombre.Text.ToString(); correo = TextBoxCorreo.Text.ToString(); id_planta = Int32.Parse(DropDownListPlanta.SelectedValue.ToString()); comentario = TextOpinion.InnerText.ToString(); ds = con.GetInsertaEncuesta(usuario, nombre, correo, id_planta, comentario.ToUpper()); DataSet ds1 = new DataSet(); ds1 = com.GetDatosMail(idUsuario); planta = ds1.Tables["Tabla"].Rows[0].ItemArray[0].ToString();; fecha = ds1.Tables["Tabla"].Rows[0].ItemArray[1].ToString(); hora = ds1.Tables["Tabla"].Rows[0].ItemArray[2].ToString(); if (correo != "") { fnEnviaCorreos(usuario, nombre, correo, planta, fecha, hora); } HttpContext.Current.Response.Redirect("confirmacion.aspx", true); } lblAlerta.Text = alertaEstado.ToString(); } catch (Exception ex) { Console.Write(ex); } }