protected void sendSuscribirse_Click(object sender, EventArgs e) { bool Insertado = false; if (string.IsNullOrEmpty(email.Text.Trim())) { Response.Write("<script>alert('¡Debe ingresar un email!')</script>"); } if (!CheckOfertas.Checked) { if (!CheckEventos.Checked) { if (!CheckNoticias.Checked) { Response.Write("<script>alert('¡Debe elegir al menos una categoría!')</script>"); } } } if (CheckOfertas.Checked) { if (CheckEventos.Checked) { if (CheckNoticias.Checked) { Insertado = GestorSuscripcion.Agregar( email.Text.Trim(), "", "Activo", true, true, true); } else { Insertado = GestorSuscripcion.Agregar( email.Text.Trim(), "", "Activo", true, true, false); } } else if (CheckNoticias.Checked) { Insertado = GestorSuscripcion.Agregar( email.Text.Trim(), "", "Activo", true, false, true); } } else if (CheckEventos.Checked) { if (CheckNoticias.Checked) { Insertado = GestorSuscripcion.Agregar( email.Text.Trim(), "", "Activo", false, true, true); } else { Insertado = GestorSuscripcion.Agregar( email.Text.Trim(), "", "Activo", false, true, false); } } else if (CheckNoticias.Checked) { Insertado = GestorSuscripcion.Agregar( email.Text.Trim(), "", "Activo", false, false, true); } if (Insertado) { Response.Write("<script>alert('¡Suscripción realizada con éxito!')</script>"); email.Text = ""; CheckOfertas.Checked = false; CheckEventos.Checked = false; CheckNoticias.Checked = false; suscribirse.Visible = false; return; } }