protected void btnEnviar_Click(object sender, EventArgs e)
    {
        SqlDSregistro.InsertCommand = "INSERT INTO ogmforo2014 VALUES ('" + txtNombres.Text +
            "', '" + txtApellidos.Text +
            "', '" + txtCorreo.Text +
            "', '" + txtInstitucion.Text +

            "', '" + txtComentarios.Text +
            "')";
        SqlDSregistro.Insert();

        //ARMAR CUERPO DEL MENSAJE
        string mensaje = "Estimado(a) " + txtNombres.Text + ", usted ha sido registrado(a)." + '\n' +
            '\n' +
            lblHiddenMensaje.Text + '\n' +
            '\n' +
            '\n' +
            "Gracias," + '\n' + "Comite Organizador" + '\n' + "CIBNOR, S.C.";

        mensaje = mensaje.Replace("\n", "<br />");

        //Mandamos el correo(de,                para,           copia oculta,           asunto,                 mensaje)
        OperacionesBasicas Opb = new OperacionesBasicas();
        try
        {
            Opb.enviarCorreo("*****@*****.**", txtCorreo.Text, "*****@*****.**", "Registro en Linea - Foro OGMs 2014", mensaje);
        }
        catch (Exception ex)
        {
            lblStatusEnvio.Text = "El registro no ha podido ser entregado, intentelo de nuevo mas tarde." + ex.Message;
            //enviarCorreo(origen, "*****@*****.**", "-", origen + ex.Message, Convert.ToString(Session["mensajeConfirmacion"]));
        }

        Response.Redirect("~/RegistroOk.aspx?evento=ogmforo2014");
    }
    protected void btnEnviar_Click(object sender, EventArgs e)
    {
        OperacionesBasicas OpbCorreo = new OperacionesBasicas();

        SqlDSregistro.InsertCommand = "INSERT INTO anivkayak VALUES ('" + txtNombres.Text +
                                      "', '" + txtApellidos.Text +
                                      "', '" + txtCorreo.Text +
                                      "', '" + txtTelefono.Text +

                                      "', '" + txtComentarios.Text +

                                      "', GetDate())";

        //Armamos el mensaje
        lblHiddenMensaje.Text =
            "- Datos personales" + '\n' +
            "------------------------------------------------" + '\n' +
            '\n' +
            "Nombre(s): " + txtNombres.Text + '\n' +
            "Apellido(s): " + txtApellidos.Text + '\n' +
            "Correo electronico: " + txtCorreo.Text + '\n' +
            "Telefono: " + txtTelefono.Text + '\n' +
            '\n' +
            "Comentarios: " + txtComentarios.Text;

        string mensaje = "Estimado(a) " + txtNombres.Text.Trim() + ", usted ha sido registrado(a)." + '\n' +
                         '\n' +
                         lblHiddenMensaje.Text + '\n' +
                         '\n' +
                         '\n' +
                         "Gracias," + '\n' +
                         '\n' +
                         "Comite Organizador" + '\n' + "CIBNOR, S.C.";

        mensaje = mensaje.Replace("\n", "<br />");

        int registroOk = 1; // Para validar si el registro se ejecuto en el server

        try
        {
            SqlDSregistro.Insert();
            //    // Mandamos correo(from, password, to, [cc | "-"], [cco | "-"], subject, msg, priority) Se le pone "-" al from y password para que use las crendenciales de eventos.cibnor@
            OpbCorreo.enviarCorreo("-", "-", txtCorreo.Text, "*****@*****.**", "*****@*****.**", "Kayak - Registro web", mensaje, "normal");
        }
        catch (Exception ex)
        {
            OpbCorreo.enviarCorreo("-", "-", "*****@*****.**", "-", "-",
                                   "Error domino", "ex.Message: " + ex.Message + " - " + txtCorreo.Text + " - ex.InnerException.Message: " + ex.InnerException.Message, "normal");

            registroOk     = 0;
            lblStatus.Text = "Hubo un problema al procesar su registro, favor de intentarlo de nuevo mas tarde. El webmaster ya ha sido notificado.";
        }
        if (registroOk == 1)
        {
            Response.Redirect("~/RegistroOk.aspx?evento=anivkayak");
        }
    }
    protected void btnEnviar_Click(object sender, EventArgs e)
    {
        //Crear el comando para el UPDATE
        SqlDSregistro.InsertCommand = "INSERT INTO desertfishes2014 VALUES ('" +
                                      txtNombres.Text + "', '" +
                                      txtApellidos.Text + "', '" +
                                      txtCorreo.Text + "', '" +
                                      txtTelefono.Text + "', '" +
                                      txtDireccion.Text + "', '" +
                                      txtCodigo.Text + "', '" +
                                      txtCiudad.Text + "', '" +
                                      txtEstado.Text + "', '" +
                                      txtPais.Text + "', '" +
                                      ddlRegistro.SelectedValue + "', '" +
                                      ddlTalla.SelectedValue + "', '" +
                                      txtHotel.Text + "', '" +
                                      rblFactura.SelectedValue + "', '" +
                                      txtFacturaNombre.Text + "', '" +
                                      txtFacturaRFC.Text + "', '" +
                                      txtFacturaDireccion.Text + "', '" +
                                      txtComentarios.Text + "', '" +

                                      "1" + "', GetDate())";

        int registroOk         = 1;
        OperacionesBasicas Opb = new OperacionesBasicas();

        try
        {
            SqlDSregistro.Insert();
            //ARMAR CUERPO DEL MENSAJE
            string mensaje = "Estimado(a) participante, el registro ha sido completado con exíto." + '\n' +
                             '\n' +
                             lblHiddenMensaje.Text + '\n' +
                             '\n' +
                             '\n' +
                             "Gracias," + '\n' + "Comite Organizador" + '\n' + "CIBNOR, S.C.";

            mensaje = mensaje.Replace("\n", "<br />");

            //Mandamos el correo( de,                para,           copia oculta,           asunto,                 mensaje )
            Opb.enviarCorreo("*****@*****.**", txtCorreo.Text, "*****@*****.**", "Peces del desierto 2014 - Registro web", mensaje);
        }
        catch (Exception ex)
        {
            Opb.enviarCorreo("*****@*****.**", "*****@*****.**", "-", "Error", ex.Message + " - " + ex.StackTrace);
            registroOk     = 0;
            lblStatus.Text = "Hubo un problema al procesar su registro, favor de intentarlo de nuevo mas tarde. El webmaster ya ha sido notificado.";
        }
        if (registroOk == 1)
        {
            Response.Redirect("~/RegistroOk.aspx?evento=desertfishes2014");
        }
    }
    protected void btnEnviar_Click(object sender, EventArgs e)
    {
        //Crear el comando para el UPDATE
        SqlDSregistro.InsertCommand = "INSERT INTO desertfishes2014 VALUES ('" +
            txtNombres.Text + "', '" +
            txtApellidos.Text + "', '" +
            txtCorreo.Text + "', '" +
            txtTelefono.Text + "', '" +
            txtDireccion.Text + "', '" +
            txtCodigo.Text + "', '" +
            txtCiudad.Text + "', '" +
            txtEstado.Text + "', '" +
            txtPais.Text + "', '" +
            ddlRegistro.SelectedValue + "', '" +
            ddlTalla.SelectedValue + "', '" +
            txtHotel.Text + "', '" +
            rblFactura.SelectedValue + "', '" +
            txtFacturaNombre.Text + "', '" +
            txtFacturaRFC.Text + "', '" +
            txtFacturaDireccion.Text + "', '" +
            txtComentarios.Text + "', '" +

            "1" + "', GetDate())";

        int registroOk = 1;
        OperacionesBasicas Opb = new OperacionesBasicas();
        try
        {
            SqlDSregistro.Insert();
            //ARMAR CUERPO DEL MENSAJE
            string mensaje = "Estimado(a) participante, el registro ha sido completado con exíto." + '\n' +
                '\n' +
                lblHiddenMensaje.Text + '\n' +
                    '\n' +
                    '\n' +
                "Gracias," + '\n' + "Comite Organizador" + '\n' + "CIBNOR, S.C.";

            mensaje = mensaje.Replace("\n", "<br />");

            //Mandamos el correo( de,                para,           copia oculta,           asunto,                 mensaje )
            Opb.enviarCorreo("*****@*****.**", txtCorreo.Text, "*****@*****.**", "Peces del desierto 2014 - Registro web", mensaje);
        }
        catch (Exception ex)
        {
            Opb.enviarCorreo("*****@*****.**", "*****@*****.**", "-", "Error", ex.Message + " - " + ex.StackTrace);
            registroOk = 0;
            lblStatus.Text = "Hubo un problema al procesar su registro, favor de intentarlo de nuevo mas tarde. El webmaster ya ha sido notificado.";
        }
        if (registroOk == 1)
        {
            Response.Redirect("~/RegistroOk.aspx?evento=desertfishes2014");
        }
    }
Ejemplo n.º 5
0
    protected void btnEnviar_Click(object sender, EventArgs e)
    {
        //Crear el comando para el UPDATE
        SqlDSregistro.InsertCommand = "INSERT INTO administradores2014 VALUES ('" +
                                      txtNombres.Text + "', '" +
                                      txtApellidos.Text + "', '" +
                                      txtCorreo.Text + "', '" +
                                      txtInstitucion.Text + "', '" +
                                      lblHiddenTalleres.Text + "', '" +
                                      lblHiddenHotel.Text + "', '" +
                                      txtComentarios.Text + "', '" +
                                      "1" + "', GetDate())";

        int registroOk         = 1; // Para validar si el registro se ejecuto en el server
        OperacionesBasicas Opb = new OperacionesBasicas();

        try
        {
            SqlDSregistro.Insert();
            //ARMAR CUERPO DEL MENSAJE
            string mensaje = "Estimado(a) participante, el registro ha sido completado con exíto." + '\n' +
                             '\n' +
                             lblHiddenMensaje.Text + '\n' +
                             '\n' +
                             '\n' +
                             "Gracias," + '\n' + "Comite Organizador" + '\n' + "CIBNOR, S.C.";

            mensaje = mensaje.Replace("\n", "<br />");

            //Mandamos el correo( de,                para,           copia oculta,           asunto,                 mensaje )
            Opb.enviarCorreo("*****@*****.**", txtCorreo.Text, "*****@*****.**", "Administradores CPIs - Registro web", mensaje);
        }
        catch (Exception ex)
        {
            Opb.enviarCorreo("*****@*****.**", "*****@*****.**", "-", "Error", ex.Message + " - " + txtCorreo.Text + " - " + ex.StackTrace);
            registroOk     = 0;
            lblStatus.Text = "Hubo un problema al procesar su registro, favor de intentarlo de nuevo mas tarde. El webmaster ya ha sido notificado.";
        }
        if (registroOk == 1)
        {
            Response.Redirect("~/RegistroOk.aspx?evento=administradores2014");
        }
    }
    protected void btnContinuar_Click(object sender, EventArgs e)
    {
        OperacionesBasicas Opb = new OperacionesBasicas();
        int numRegistros       = Opb.numRegistros("pace2014", "correo", txtCorreo.Text);

        if (numRegistros > 0) // Ya existe?
        {
            lblStatusExiste.Text = "El correo que ingresaste ya se encuentra registrado, por favor utiliza otro.";
            txtCorreo.Focus();
        }
        else // No existe, adelante
        {
            lblStatusExiste.Text = "";
            numRegistros         = Opb.numRegistros("pace2014", "area", ddlArea.SelectedItem.Text);
            lblHiddenClave.Text  = ddlArea.SelectedValue + Convert.ToString(numRegistros + 1);
            //lblHiddenClave.Visible = true;

            btnContinuar.Visible    = false;
            pnlConfirmacion.Visible = true;
            confirmarDatos(1);
        }
    }
Ejemplo n.º 7
0
    protected void btnEnviar_Click(object sender, EventArgs e)
    {
        SqlDSregistro.InsertCommand = "INSERT INTO cultivos2014 VALUES ('" +
                                      txtNombres.Text + "', '" +
                                      txtApellidos.Text + "', '" +
                                      txtCorreo.Text + "', '" +
                                      txtInstitucion.Text + "', '" +
                                      txtComentarios.Text + "', '" +
                                      "1" + "', GetDate())";
        SqlDSregistro.Insert();

        //ARMAR CUERPO DEL MENSAJE
        string mensaje = "Estimado(a) " + txtNombres.Text + ", usted ha sido registrado(a)." + '\n' +
                         '\n' +
                         lblHiddenMensaje.Text + '\n' +
                         '\n' +
                         '\n' +
                         "Gracias," + '\n' + "Comite Organizador" + '\n' + "CIBNOR, S.C.";


        mensaje = mensaje.Replace("\n", "<br />");

        //Mandamos el correo(de,                para,           copia oculta,           asunto,                 mensaje)
        OperacionesBasicas Opb = new OperacionesBasicas();

        try
        {
            Opb.enviarCorreo("*****@*****.**", txtCorreo.Text, "*****@*****.**", "Registro en Linea - Cultivos 2014", mensaje);
        }
        catch (Exception ex)
        {
            lblStatusEnvio.Text = "El registro no ha podido ser entregado, intentelo de nuevo mas tarde." + ex.Message;
            //enviarCorreo(origen, "*****@*****.**", "-", origen + ex.Message, Convert.ToString(Session["mensajeConfirmacion"]));
        }

        Response.Redirect("~/RegistroOk.aspx?evento=cultivos2014");
    }
Ejemplo n.º 8
0
        public static OperandosViewModel DeterminarOperacion(OperandosViewModel model, OperacionesBasicas op)
        {
            model.Resultado = null;
            if (model.Num1.HasValue && model.Num2.HasValue)
            {
                switch (op)
                {
                case OperacionesBasicas.Suma:
                    model.Resultado = model.Num1.Value + model.Num2.Value;
                    break;

                case OperacionesBasicas.Resta:
                    model.Resultado = model.Num1.Value - model.Num2.Value;
                    break;

                case OperacionesBasicas.Multiplicacion:
                    model.Resultado = model.Num1.Value * model.Num2.Value;
                    break;

                case OperacionesBasicas.Division:
                    model.Resultado = model.Num1.Value / model.Num2.Value;
                    break;
                }
                model.Resultado = (Math.Round((double)model.Resultado * 10000)) / 10000;
                return(model);
            }
            return(model);
        }
    protected void btnEnviar_Click(object sender, EventArgs e)
    {
        OperacionesBasicas Opb = new OperacionesBasicas(); // Inicializamos el objeto para enviar correo

        // Inicializamos los estilos para las cajas de respuestas en el correo
        string pOpenTag  = "<p style='border:1px solid black; width:370px; padding:4px; background-color:#ddd;'>";
        string pCloseTag = "</p>";

        // Obtenemos el valor del radio por medio del atributo "name"
        string traslado     = (Request.Form["traslado"] != null) ? traslado = Request.Form["traslado"].ToString() : "";
        string msgTraslado  = "";
        string typeTraslado = "Me trasladar&eacute; en autob&uacute;s";

        switch (traslado)
        {
        case "cuenta":
            typeTraslado = "Por cuenta propia";
            msgTraslado  = pOpenTag + "Me trasladar&eacute; por cuenta propia" + pCloseTag;
            break;

        case "aereo":
            typeTraslado = "Aéreo";
            msgTraslado  = pOpenTag + "Requiero traslado aéreo" + pCloseTag +
                           "# Viaje de ida #" + '\n' +
                           "> > Vuelo inicial" + pOpenTag +
                           salidaRuta1.Attributes["placeholder"] + ": " + salidaRuta1.Value + " - " +
                           salidaAerolinea1.Attributes["placeholder"] + ": " + salidaAerolinea1.Value + " - " +
                           salidaVuelo1.Attributes["placeholder"] + ": " + salidaVuelo1.Value + " - " +
                           salidaFecha1.Attributes["placeholder"] + ": " + salidaFecha1.Value + " - " +
                           salidaHora1.Attributes["placeholder"] + ": " + salidaHora1.Value + " - " +
                           salidaHoraLlegada1.Attributes["placeholder"] + ": " + salidaHoraLlegada1.Value + pCloseTag +
                           "> > Vuelo escala" + pOpenTag +
                           salidaRuta2.Attributes["placeholder"] + ": " + salidaRuta2.Value + " - " +
                           salidaAerolinea2.Attributes["placeholder"] + ": " + salidaAerolinea2.Value + " - " +
                           salidaVuelo2.Attributes["placeholder"] + ": " + salidaVuelo2.Value + " - " +
                           salidaFecha2.Attributes["placeholder"] + ": " + salidaFecha2.Value + " - " +
                           salidaHora2.Attributes["placeholder"] + ": " + salidaHora2.Value + " - " +
                           salidaHoraLlegada2.Attributes["placeholder"] + ": " + salidaHoraLlegada2.Value + pCloseTag +
                           "# Viaje de regreso #" + '\n' +
                           "> > Vuelo inicial" + pOpenTag +
                           regresoRuta1.Attributes["placeholder"] + ": " + regresoRuta1.Value + " - " +
                           regresoAerolinea1.Attributes["placeholder"] + ": " + regresoAerolinea1.Value + " - " +
                           regresoVuelo1.Attributes["placeholder"] + ": " + regresoVuelo1.Value + " - " +
                           regresoFecha1.Attributes["placeholder"] + ": " + regresoFecha1.Value + " - " +
                           regresoHora1.Attributes["placeholder"] + ": " + regresoHora1.Value + " - " +
                           regresoHoraLlegada1.Attributes["placeholder"] + ": " + regresoHoraLlegada1.Value + pCloseTag +
                           "> > Vuelo escala" + pOpenTag +
                           regresoRuta2.Attributes["placeholder"] + ": " + regresoRuta2.Value + " - " +
                           regresoAerolinea2.Attributes["placeholder"] + ": " + regresoAerolinea2.Value + " - " +
                           regresoVuelo2.Attributes["placeholder"] + ": " + regresoVuelo2.Value + " - " +
                           regresoFecha2.Attributes["placeholder"] + ": " + regresoFecha2.Value + " - " +
                           regresoHora2.Attributes["placeholder"] + ": " + regresoHora2.Value + " - " +
                           regresoHoraLlegada2.Attributes["placeholder"] + ": " + regresoHoraLlegada2.Value + pCloseTag;
            break;

        case "autobus":
            msgTraslado = pOpenTag + "En autobús" + pCloseTag +
                          rutaOrigen.Attributes["placeholder"] + ": " + pOpenTag + rutaOrigen.Value + " - " +
                          rutaLlegada.Attributes["placeholder"] + ": " + rutaLlegada.Value + pCloseTag;
            break;

        default: break;
        }
        // Obtenemos el valor del checkbox "chkRequiereHospedaje" por medio del atributo "name"
        string hospedaje = (Request.Form["chkRequiereHospedaje"] != null) ? traslado = Request.Form["chkRequiereHospedaje"].ToString() : "NO";


        string msgBody =
            "- DATOS GENERALES" + '\n' +
            '\n' +
            "Nombre completo: " + pOpenTag + nombres.Value + " " + apellidos.Value + pCloseTag +
            "Correo electr&oacute;nico: " + pOpenTag + correo.Value + pCloseTag +
            institucion.Attributes["placeholder"] + ": " + pOpenTag + institucion.Value + pCloseTag +
            '\n' +
            "- ITINERARIO" + msgTraslado +
            '\n' +
            "Hospedaje: " + pOpenTag + hospedaje + pCloseTag +
            comentarios.Attributes["placeholder"] + ": " + pOpenTag + comentarios.Value + pCloseTag;

        // ACTUALIZAR CON BOOTSTRAP "RegistroOk.aspx"

        #region Crear el comando para el UPDATE
        SqlDSregistro.InsertCommand = "INSERT INTO redesclim VALUES ('" +
                                      nombres.Value + "', '" +
                                      apellidos.Value + "', '" +
                                      correo.Value + "', '" +
                                      institucion.Value + "', '" +
                                      typeTraslado + "', '" +
                                      rutaOrigen.Value + "', '" +
                                      rutaLlegada.Value + "', '" +

                                      salidaRuta1.Value + "', '" +
                                      salidaAerolinea1.Value + "', '" +
                                      salidaVuelo1.Value + "', '" +
                                      salidaFecha1.Value + "', '" +
                                      salidaHora1.Value + "', '" +
                                      salidaHoraLlegada1.Value + "', '" +
                                      salidaRuta2.Value + "', '" +
                                      salidaAerolinea2.Value + "', '" +
                                      salidaVuelo2.Value + "', '" +
                                      salidaFecha2.Value + "', '" +
                                      salidaHora2.Value + "', '" +
                                      salidaHoraLlegada2.Value + "', '" +

                                      regresoRuta1.Value + "', '" +
                                      regresoAerolinea1.Value + "', '" +
                                      regresoVuelo1.Value + "', '" +
                                      regresoFecha1.Value + "', '" +
                                      regresoHora1.Value + "', '" +
                                      regresoHoraLlegada1.Value + "', '" +
                                      regresoRuta2.Value + "', '" +
                                      regresoAerolinea2.Value + "', '" +
                                      regresoVuelo2.Value + "', '" +
                                      regresoFecha2.Value + "', '" +
                                      regresoHora2.Value + "', '" +
                                      regresoHoraLlegada2.Value + "', '" +

                                      hospedaje + "', '" +
                                      comentarios.Value + "', GetDate())";
        SqlDSregistro.Insert();
        #endregion

        string mensaje = "Gracias, el registro ha sido completado con &eacute;xito." + '\n' +
                         '\n' +
                         msgBody + '\n' +
                         '\n' +
                         "Atentamente," + '\n' + "Comit&eacute; Organizador" + '\n' + "CIBNOR, S.C.";

        mensaje = mensaje.Replace("\n", "<br />");

        // MANDAMOS EL CORREO
        Opb.enviarCorreo("-", "-", correo.Value, "-", "*****@*****.**", "REDESClim 2017 - Registro en linea", mensaje, "normal");
        //Opb.enviarCorreo("-", "-", correo.Value, "-", "*****@*****.**", "REDESClim 2017 - Registro", mensaje, "normal"); // PRUEBAS

        Response.Redirect("~/RegistroOk.aspx?evento=redesclim");
    }
Ejemplo n.º 10
0
    protected void btnEnviar_Click(object sender, EventArgs e)
    {
        OperacionesBasicas OpbCorreo = new OperacionesBasicas();

        string factura = "NO";

        if (chkFactura.Checked)
        {
            factura = "SI";
        }

        // Subimos el comprobante de pago, si regresa 0 hubo un error
        var fileUpload = adjuntarArchivo();

        if (fileUpload != "ok")
        {
            lblStatus.Text = fileUpload;
        }
        else
        {
            // Insertamos en la tabla
            SqlDSregistro.InsertCommand = "INSERT INTO genetica2016 VALUES ('" + txtNombres.Text +
                                          "', '" + txtApellidos.Text +
                                          "', '" + txtCorreo.Text +
                                          "', '" + txtInstitucion.Text +
                                          "', '" + factura +
                                          "', '" + txtFacturaRfc.Text +
                                          "', '" + txtFacturaNombre.Text +
                                          "', '" + txtDomicilio.Text +
                                          "', '" + txtComentarios.Text +
                                          "', GetDate())";
            SqlDSregistro.Insert();

            //Armamos el mensaje
            lblHiddenMensaje.Text =
                "Nombre(s): " + txtNombres.Text + '\n' +
                "Apellido(s): " + txtApellidos.Text + '\n' +
                '\n' +
                "Correo electr&oacute;nico: " + txtCorreo.Text + '\n' +
                "Instituci&oacute;n: " + txtInstitucion.Text + '\n' +
                '\n' +
                "Requiero factura: " + factura + '\n' +
                "Datos para facturaci&oacute;n --- " + '\n' +
                "RFC: " + txtFacturaRfc.Text + '\n' +
                "Nombre: " + txtFacturaNombre.Text + '\n' +
                "Domicilio: " + txtDomicilio.Text + '\n' +
                '\n' +
                "Comentarios: " + txtComentarios.Text;

            string mensaje = "Estimado(a), " + txtNombres.Text.Trim() + ", usted ha sido registrado(a)." + '\n' +
                             '\n' +
                             lblHiddenMensaje.Text + '\n' +
                             '\n' +
                             '\n' +
                             "Gracias," + '\n' +
                             '\n' +
                             "Comite Organizador" + '\n' + "CIBNOR, S.C.";
            mensaje = mensaje.Replace("\n", "<br />");


            //// Mandamos correo(from, psswd, to, [cc | "-"], [cco | "-"], subject, msg, priority)
            OpbCorreo.enviarCorreo("-", "-", txtCorreo.Text, "*****@*****.**", "*****@*****.**", "genetica2016 - Registro en linea", mensaje, "normal");

            Response.Redirect("~/RegistroOk.aspx?evento=genetica2016");
        }
    }
    protected void btnEnviar_Click(object sender, EventArgs e)
    {
        //Crear el comando para el UPDATE
        SqlDSregistro.InsertCommand = "INSERT INTO administradores2014 VALUES ('" +
            txtNombres.Text + "', '" +
            txtApellidos.Text + "', '" +
            txtCorreo.Text + "', '" +
            txtInstitucion.Text + "', '" +
            lblHiddenTalleres.Text + "', '" +
            lblHiddenHotel.Text + "', '" +
            txtComentarios.Text + "', '" +
            "1" + "', GetDate())";

        int registroOk = 1; // Para validar si el registro se ejecuto en el server
        OperacionesBasicas Opb = new OperacionesBasicas();
        try
        {
            SqlDSregistro.Insert();
            //ARMAR CUERPO DEL MENSAJE
            string mensaje = "Estimado(a) participante, el registro ha sido completado con exíto." + '\n' +
                '\n' +
                lblHiddenMensaje.Text + '\n' +
                    '\n' +
                    '\n' +
                "Gracias," + '\n' + "Comite Organizador" + '\n' + "CIBNOR, S.C.";

            mensaje = mensaje.Replace("\n", "<br />");

            //Mandamos el correo( de,                para,           copia oculta,           asunto,                 mensaje )
            Opb.enviarCorreo("*****@*****.**", txtCorreo.Text, "*****@*****.**", "Administradores CPIs - Registro web", mensaje);
        }
        catch (Exception ex)
        {
            Opb.enviarCorreo("*****@*****.**", "*****@*****.**", "-", "Error", ex.Message + " - " + txtCorreo.Text + " - " + ex.StackTrace);
            registroOk = 0;
            lblStatus.Text = "Hubo un problema al procesar su registro, favor de intentarlo de nuevo mas tarde. El webmaster ya ha sido notificado.";
        }
        if (registroOk == 1)
        {
            Response.Redirect("~/RegistroOk.aspx?evento=administradores2014");
        }
    }
Ejemplo n.º 12
0
    protected void btnEnviar_Click(object sender, EventArgs e)
    {
        string tipoRegistro = "";

        if (rblTipoIndividual.Checked)
        {
            tipoRegistro = "Individual";
        }
        else
        {
            tipoRegistro = "Equipo";
        }

        lblHiddenMensaje.Text =
            "Nombres: " + txtNombres.Text + '\n' +
            "Apellidos: " + txtApellidos.Text + '\n' +
            "Correo electronico: " + txtCorreo.Text + '\n' +
            "Edad: " + txtEdad.Text + '\n' +
            "Sexo: " + ddlSexo.SelectedValue + '\n' +
            "Tipo de registro: " + tipoRegistro;

        if (tipoRegistro == "Equipo")
        {
            lblHiddenMensaje.Text = lblHiddenMensaje.Text + '\n' +
                                    '\n' +
                                    "Nombre del equipo: " + txtNombreEquipo.Text + '\n' +
                                    '\n' +
                                    "-- PARTICIPANTES" + '\n' +
                                    "- " + txtNombreParticipante2.Text + ", edad: " + txtEdadParticipante2.Text + " años, Sexo: " + ddlSexoParticipante2.SelectedValue + '\n' +
                                    "- " + txtNombreParticipante3.Text + ", edad: " + txtEdadParticipante3.Text + " años, Sexo: " + ddlSexoParticipante3.SelectedValue + '\n' +
                                    "- " + txtNombreParticipante4.Text + ", edad: " + txtEdadParticipante4.Text + " años, Sexo: " + ddlSexoParticipante4.SelectedValue;

            // Dar de alta en las tablas de Prude - equipo
            SqlDSregweb2.InsertCommand = "INSERT INTO [dbo].[Teams] ([YearId],[Nombre],[Num],[RegWebId]) " +
                                         "VALUES ('2015','" + txtNombreEquipo.Text + "','0','0')";
            SqlDSregweb2.Insert();                               // Insertamos el registro del equipo

            SqlDSregweb3.DataBind();                             // Obtenemos el id del equipo recien registrado
            var currentTeamId = GridView1.Rows[0].Cells[0].Text; // y lo guardamos en currentTeamId

            // Insertamos el registro de quien registra al equipo
            SqlDSregweb2.InsertCommand = "INSERT INTO [dbo].[TeamMembers] ([TeamId],[Nombre],[Apellidos],[Edad],[Sexo],[Correo]) " +
                                         "VALUES ('" + currentTeamId + "','" +
                                         txtNombres.Text + "','" +
                                         txtApellidos.Text + "','" +
                                         txtEdad.Text + "','" +
                                         ddlSexo.Text.Substring(0, 1) + "','" +
                                         txtCorreo.Text +
                                         "')";
            SqlDSregweb2.Insert();

            // Insertamos el registro del participante2
            SqlDSregweb2.InsertCommand = "INSERT INTO [dbo].[TeamMembers] ([TeamId],[Nombre],[Edad],[Sexo],[Correo]) " +
                                         "VALUES ('" + currentTeamId + "','" +
                                         txtNombreParticipante2.Text + "','" +
                                         txtEdadParticipante2.Text + "','" +
                                         ddlSexoParticipante2.Text.Substring(0, 1) + "','" +
                                         txtCorreo.Text +
                                         "')";
            SqlDSregweb2.Insert();

            // Insertamos el registro del participante3
            SqlDSregweb2.InsertCommand = "INSERT INTO [dbo].[TeamMembers] ([TeamId],[Nombre],[Edad],[Sexo],[Correo]) " +
                                         "VALUES ('" + currentTeamId + "','" +
                                         txtNombreParticipante3.Text + "','" +
                                         txtEdadParticipante3.Text + "','" +
                                         ddlSexoParticipante3.Text.Substring(0, 1) + "','" +
                                         txtCorreo.Text +
                                         "')";
            SqlDSregweb2.Insert();

            // Insertamos el registro del participante4
            SqlDSregweb2.InsertCommand = "INSERT INTO [dbo].[TeamMembers] ([TeamId],[Nombre],[Edad],[Sexo],[Correo]) " +
                                         "VALUES ('" + currentTeamId + "','" +
                                         txtNombreParticipante4.Text + "','" +
                                         txtEdadParticipante4.Text + "','" +
                                         ddlSexoParticipante4.Text.Substring(0, 1) + "','" +
                                         txtCorreo.Text +
                                         "')";
            SqlDSregweb2.Insert();
        }
        else
        {
            // Dar de alta en las tablas de Prude - individual
            SqlDSregweb2.InsertCommand = "INSERT INTO [dbo].[Runners] ([YearId],[Num],[Sexo],[Nombres],[Apellidos],[Correo],[Edad],[Comentarios],[RegWebId]) " +
                                         "VALUES ('2015','0','" +
                                         ddlSexo.Text.Substring(0, 1) + "','" +
                                         txtNombres.Text + "','" +
                                         txtApellidos.Text + "','" +
                                         txtCorreo.Text + "','" +
                                         txtEdad.Text + "','" +
                                         txtComentarios.Text +
                                         "','0')";
            SqlDSregweb2.Insert();
        }

        // agregamos lo ultimo que aplica para los dos tipos de registros
        lblHiddenMensaje.Text = lblHiddenMensaje.Text +
                                '\n' +
                                '\n' +
                                "Comentarios: " + txtComentarios.Text;

        string mensaje = "Estimado(a) " + txtNombres.Text.Trim() + ", su registro ha sido completado." + '\n' +
                         '\n' +
                         lblHiddenMensaje.Text + '\n' +
                         '\n' +
                         '\n' +
                         "Gracias," + '\n' +
                         '\n' +
                         "Comite Organizador" + '\n' + "CIBNOR, S.C.";

        mensaje = mensaje.Replace("\n", "<br />");

        SqlDSregistro.InsertCommand = "INSERT INTO anivatletica VALUES ('" +
                                      txtNombres.Text + "', '" +
                                      txtApellidos.Text + "', '" +
                                      txtCorreo.Text + "', '" +
                                      txtEdad.Text + "', '" +
                                      ddlSexo.SelectedValue + "', '" +
                                      tipoRegistro + "', '" +
                                      txtNombreEquipo.Text + "', '" +
                                      txtNombreParticipante2.Text + "', '" +
                                      txtEdadParticipante2.Text + "', '" +
                                      ddlSexoParticipante2.SelectedValue + "', '" +
                                      txtNombreParticipante3.Text + "', '" +
                                      txtEdadParticipante3.Text + "', '" +
                                      ddlSexoParticipante3.SelectedValue + "', '" +
                                      txtNombreParticipante4.Text + "', '" +
                                      txtEdadParticipante4.Text + "', '" +
                                      ddlSexoParticipante4.SelectedValue + "', '" +
                                      txtComentarios.Text +
                                      "', GetDate())";

        // esto al final de todo
        OperacionesBasicas OpbCorreo = new OperacionesBasicas();

        int registroOk = 1; // Para validar si el registro se ejecuto en el server

        try
        {
            SqlDSregistro.Insert();
            // Mandamos correo(from, password, to, [cc | "-"], [cco | "-"], subject, msg, priority) Se le pone "-" al from y password para que use las crendenciales de eventos.cibnor@
            OpbCorreo.enviarCorreo("-", "-", txtCorreo.Text, "*****@*****.**", "*****@*****.**", "Carrera atletica - Registro web", mensaje, "normal");
        }
        catch (Exception ex)
        {
            OpbCorreo.enviarCorreo("-", "-", "*****@*****.**", "-", "-",
                                   "Error atletica", "ex.Message: " + ex.Message + " - " + txtCorreo.Text + " - ex.InnerException.Message: " + ex.InnerException.Message, "normal");

            registroOk     = 0;
            lblStatus.Text = "Hubo un problema al procesar su registro, favor de intentarlo de nuevo mas tarde. El webmaster ya ha sido notificado.";
        }
        if (registroOk == 1)
        {
            Response.Redirect("~/RegistroOk.aspx?evento=anivatletica");
        }
    }
Ejemplo n.º 13
0
    protected void btnEnviar_Click(object sender, EventArgs e)
    {
        OperacionesBasicas Opb = new OperacionesBasicas();
        int numRegistros       = Opb.numRegistros("jovenespace", "correo", txtCorreo.Text);

        if (numRegistros > 0) // Ya existe?
        {
            lblStatus.Text = "El correo que ingresaste ya se encuentra registrado, por favor utiliza otro.";
            txtCorreo.Focus();
        }
        else // No existe, adelante
        {
            string fileUpload = "";
            fileUpload = Opb.adjuntarArchivo(fuArchivo, "~/jovenespace/uploads", txtCorreo.Text); // adjuntarArchivo();
            if (fileUpload == "ok")                                                               // Se adjunto el archivo? entonces genera la clave y registralo
            {
                //lblStatus.Text = "NO existe";
                lblStatus.Text      = "";
                numRegistros        = Opb.numRegistros("jovenespace", "area", ddlArea.SelectedItem.Text);
                lblHiddenClave.Text = ddlArea.SelectedValue + Convert.ToString(numRegistros + 1);
                //lblHiddenClave.Visible = true;

                // CREAR EL MENSAJE A ENVIAR POR CORREO
                lblHiddenMensaje.Text = "Estimado(a) participante, el registro ha sido completado con exito." + '\n' +
                                        '\n' +
                                        "- datos generales del autor --" + '\n' +
                                        '\n' +
                                        "Nombre completo: " + txtNombres.Text + " " + txtApellidos.Text + '\n' +
                                        "Correo: " + txtCorreo.Text + '\n' +
                                        "Telefono: " + txtTelefono.Text + '\n' +
                                        "Sexo: " + ddlSexo.SelectedValue + '\n' +
                                        "Edad: " + txtEdad.Text + '\n' +
                                        "Institucion: " + txtInstitucion.Text + '\n' +
                                        "Domicilio: " + txtDomicilioOficial.Text + '\n' +
                                        "Municipio: " + txtMunicipio.Text + '\n' +
                                        "Carrera: " + txtCarrera.Text + '\n' +
                                        "Egresado: " + ddlEgresado.SelectedValue + '\n' +
                                        "Fecha de egreso: " + txtFechaEgreso.Text + '\n' +
                                        "Semestre: " + txtSemestre.Text + '\n' +
                                        "Titulado: " + ddlTitulado.SelectedValue + '\n' +
                                        "Fecha de titulacion: " + txtFechaTitulacion.Text + '\n' +
                                        '\n' +
                                        "- datos del proyecto --" + '\n' +
                                        '\n' +
                                        "Nombre del proyecto: " + txtNombreProyecto.Text + '\n' +
                                        "Area: " + ddlArea.SelectedItem.Text + '\n' +
                                        '\n' +
                                        "- informacion adicional --" + '\n' +
                                        '\n' +
                                        "Nombre completo del quien requiere hospedaje: " + txtNombreHuesped.Text + '\n' +
                                        "Justificacion: " + txtJustificacion.Text + '\n' +
                                        '\n' +
                                        "Clave de registro: " + lblHiddenClave.Text + '\n' +
                                        '\n' +
                                        "NOTA: FAVOR DE LEER LA CONVOCATORIA EXTENSA Y ESTAR PENDIENTES DE SU CORREO, RECIBIRAN INFORMACION,  EN CASO DE SER SELECCIONADOS O NO. " +
                                        "SI RESULTAS SELECCIONADO DEBERAN CUMPLIR CON TODAS LAS ESPECIFICACIONES REQUERIDAS AL MOMENTO DEL REGISTRO EL DIA DEL EVENTO. " +
                                        "(ESTAN EN LA CONVOCATORIA EXTENSA, POR SI NO LA TIENES LA RECIBIRAS A TU CORREO ELECTRONICO)" + '\n' +
                                        '\n' +
                                        '\n' +
                                        "Gracias," + '\n' + "Comite Organizador" + '\n' + "CIBNOR, S.C." + '\n' +
                                        '\n' +
                                        '\n' +
                                        "PD: Este mensaje ha sido redactado sin acentos.";

                lblHiddenMensaje.Text = lblHiddenMensaje.Text.Replace("\n", "<br />");

                //Crear el comando para el INSERT
                SqlDSregistro.InsertCommand = "INSERT INTO jovenespace VALUES ('" +
                                              txtNombres.Text + "', '" +
                                              txtApellidos.Text + "', '" +
                                              txtCorreo.Text + "', '" +
                                              txtTelefono.Text + "', '" +
                                              ddlSexo.SelectedValue + "', '" +
                                              txtEdad.Text + "', '" +

                                              txtInstitucion.Text + "', '" +
                                              txtDomicilioOficial.Text + "', '" +
                                              txtMunicipio.Text + "', '" +
                                              txtCarrera.Text + "', '" +
                                              ddlEgresado.SelectedValue + "', '" +
                                              txtFechaEgreso.Text + "', '" +
                                              txtSemestre.Text + "', '" +
                                              ddlTitulado.SelectedValue + "', '" +
                                              txtFechaTitulacion.Text + "', '" +

                                              txtNombreProyecto.Text + "', '" +
                                              ddlArea.SelectedItem.Text + "', '" +

                                              txtNombreHuesped.Text + "', '" +
                                              txtJustificacion.Text + "', '" +
                                              lblHiddenClave.Text + "', '" +
                                              "1" + "', GetDate())";

                OperacionesBasicas OpbCorreo = new OperacionesBasicas();

                int registroOk = 1; // Para validar si el registro se ejecuto en el server
                try
                {
                    SqlDSregistro.Insert();
                    // Mandamos correo(from, password, to, [cc | "-"], [cco | "-"], subject, msg, priority) Con "-" en from y password usa las crendenciales de eventos.cibnor@
                    //OpbCorreo.enviarCorreo("-", "-", txtCorreo.Text, "-", "*****@*****.**", "Jovenes PACE - Registro web", lblHiddenMensaje.Text, "normal"); // para pruebas
                    OpbCorreo.enviarCorreo("-", "-", txtCorreo.Text, "-", "*****@*****.**", "Jovenes PACE - Registro web", lblHiddenMensaje.Text, "normal");
                }
                catch (Exception ex)
                {
                    OpbCorreo.enviarCorreo("-", "-", "*****@*****.**", "-", "-", "Error_jovenesPACE",
                                           "ex.Message: " + ex.Message + " - " + txtCorreo.Text + " - ex.InnerException.Message: " + ex.InnerException.Message, "normal");

                    registroOk     = 0;
                    lblStatus.Text = "Hubo un problema al procesar su registro, favor de intentarlo de nuevo mas tarde. El webmaster ya ha sido notificado.";
                }
                if (registroOk == 1)
                {
                    Response.Redirect("~/RegistroOk.aspx?evento=jovenespace");
                }
            }
            else  // No se pudo adjuntar el archivo, muestra el error
            {
                lblStatus.Text = fileUpload;
                lblStatus.Focus();
            }
        }

        //

        //// se cumplen todos los requisitos para un registro exitoso?
        //if ((adjuntarArchivo() == "ok"))
        //{

        //}
        //else {
        //    lblStatus.Text = fileUpload;
        //    lblStatus.Focus();
        //}

        //    string factura = "NO";
        //    if (chkFactura.Checked) {
        //        factura = "SI";
        //        // Subimos el comprobante de pago, si regresa 0 hubo un error


        //    }

        //    // Insertamos en la tabla
        //    SqlDSregistro.InsertCommand = "INSERT INTO jovenespace VALUES ('" + txtNombres.Text +
        //    "', '" + txtApellidos.Text +
        //    "', '" + txtCorreo.Text +
        //    "', '" + txtInstitucion.Text +
        //    "', '" + factura +
        //    "', '" + txtFacturaRfc.Text +
        //    "', '" + txtFacturaNombre.Text +
        //    "', '" + txtDomicilio.Text +
        //    "', '" + txtComentarios.Text +
        //    "', GetDate())";
        //    SqlDSregistro.Insert();

        //    //Armamos el mensaje
        //    lblHiddenMensaje.Text =
        //        "Nombre(s): " + txtNombres.Text + '\n' +
        //        "Apellido(s): " + txtApellidos.Text + '\n' +
        //        '\n' +
        //        "Correo electrónico: " + txtCorreo.Text + '\n' +
        //        "Institución: " + txtInstitucion.Text + '\n' +
        //        '\n' +
        //        "Requiero factura: " + factura + '\n' +
        //        "Datos para facturación --- " + '\n' +
        //        "RFC: " + txtFacturaRfc.Text + '\n' +
        //        "Nombre: " + txtFacturaNombre.Text + '\n' +
        //        "Domicilio: " + txtDomicilio.Text + '\n' +
        //        '\n' +
        //        "Comentarios: " + txtComentarios.Text;

        //    string mensaje = "Estimado(a), " + txtNombres.Text.Trim() + ", usted ha sido registrado(a)." + '\n' +
        //        '\n' +
        //        lblHiddenMensaje.Text + '\n' +
        //        '\n' +
        //        '\n' +
        //        "Gracias," + '\n' +
        //        '\n' +
        //        "Comite Organizador" + '\n' + "CIBNOR, S.C.";
        //    mensaje = mensaje.Replace("\n", "<br />");

        //    // Mandamos correo(from, to, [cc | "-"], [cco | "-"], subject, msg)
        //    if (factura == "SI")
        //    {
        //        enviarCorreo("*****@*****.**", txtCorreo.Text, "*****@*****.**", "*****@*****.**", "jovenespace - Registro en linea", mensaje, "normal");
        //    }
        //    else
        //    {
        //        enviarCorreo("*****@*****.**", txtCorreo.Text, "-", "*****@*****.**", "jovenespace - Registro en linea", mensaje, "normal");
        //    }

        //    Response.Redirect("~/RegistroOk.aspx?evento=jovenespace");
    }
Ejemplo n.º 14
0
    protected void btnEnviar_Click(object sender, EventArgs e)
    {
        SqlDSott2014.InsertCommand = "INSERT INTO OTT2014 VALUES ('" + txtNombres.Text +
                                     "', '" + txtApellidos.Text +
                                     "', '" + txtCorreo.Text +
                                     "', '" + txtTelefono.Text +
                                     "', '" + txtInstitucion.Text +
                                     "', '" + rblPatrocinio.SelectedValue +

                                     "', '" + txtSalidaCiudad1.Text +
                                     "', '" + txtSalidaAerolinea1.Text +
                                     "', '" + txtSalidaNoVuelo1.Text +
                                     "', '" + txtSalidaFecha1.Text +
                                     "', '" + txtSalidaHora1.Text +

                                     "', '" + txtSalidaCiudad2.Text +
                                     "', '" + txtSalidaAerolinea2.Text +
                                     "', '" + txtSalidaNoVuelo2.Text +
                                     "', '" + txtSalidaFecha2.Text +
                                     "', '" + txtSalidaHora2.Text +

                                     "', '" + txtSalidaCiudad3.Text +
                                     "', '" + txtSalidaAerolinea3.Text +
                                     "', '" + txtSalidaNoVuelo3.Text +
                                     "', '" + txtSalidaFecha3.Text +
                                     "', '" + txtSalidaHora3.Text +

                                     "', '" + txtRegresoCiudad1.Text +
                                     "', '" + txtRegresoAerolinea1.Text +
                                     "', '" + txtRegresoNoVuelo1.Text +
                                     "', '" + txtRegresoFecha1.Text +
                                     "', '" + txtRegresoHora1.Text +

                                     "', '" + txtRegresoCiudad2.Text +
                                     "', '" + txtRegresoAerolinea2.Text +
                                     "', '" + txtRegresoNoVuelo2.Text +
                                     "', '" + txtRegresoFecha2.Text +
                                     "', '" + txtRegresoHora2.Text +

                                     "', '" + txtRegresoCiudad3.Text +
                                     "', '" + txtRegresoAerolinea3.Text +
                                     "', '" + txtRegresoNoVuelo3.Text +
                                     "', '" + txtRegresoFecha3.Text +
                                     "', '" + txtRegresoHora3.Text +

                                     "', '" + txtHotel.Text +

                                     "', '" + rblAlergico.SelectedValue +
                                     "', '" + rblMedicamento.SelectedValue +
                                     "', '" + txtEspecifique.Text +
                                     "', '" + txtContactoNombre.Text +
                                     "', '" + txtContactoTelefono.Text +

                                     "', '" + txtComentarios.Text +
                                     "')";
        SqlDSott2014.Insert();

        //ARMAR CUERPO DEL MENSAJE
        string mensaje = "Estimado(a) " + txtNombres.Text + ", usted ha sido registrado(a)." + '\n' +
                         '\n' +
                         lblHiddenMensaje.Text + '\n' + '\n' +
                         "Gracias," + '\n' + "Comite Organizador" + '\n' + "CIBNOR, S.C.";

        mensaje = mensaje.Replace("\n", "<br />");

        //Mandamos el correo(de,                para,           copia oculta,           asunto,                 mensaje)
        OperacionesBasicas Opb = new OperacionesBasicas();

        try
        {
            Opb.enviarCorreo("*****@*****.**", txtCorreo.Text, "-", "Registro en Linea - Red OTT 2014", mensaje);
        }
        catch (Exception ex)
        {
            lblStatus.Text = "El registro no ha podido ser entregado, intentelo de nuevo mas tarde." + ex.Message;
            //enviarCorreo(origen, "*****@*****.**", "-", origen + ex.Message, Convert.ToString(Session["mensajeConfirmacion"]));
        }

        Response.Redirect("~/RegistroOk.aspx?evento=ott2014");
    }
    protected void btnEnviar_Click(object sender, EventArgs e)
    {
        // CREAR EL MENSAJE A ENVIAR POR CORREO
        lblHiddenMensaje.Text = "Estimado(a) participante, el registro ha sido completado con exíto." + '\n' +
                                '\n' +
                                "- " + lblDatosGenerales.Text + '\n' +
                                '\n' +
                                lblNombre.Text + " " + txtNombre.Text + '\n' +
                                lblCorreo.Text + " " + txtCorreo.Text + '\n' +
                                lblTelefono.Text + " " + txtTelefono.Text + '\n' +
                                lblSexo.Text + " " + ddlSexo.SelectedValue + '\n' +
                                lblEdad.Text + " " + txtEdad.Text + '\n' +
                                lblInstitucion.Text + " " + txtInstitucion.Text + '\n' +
                                lblDomicilio.Text + " " + txtDomicilio.Text + '\n' +
                                lblMunicipio.Text + " " + txtMunicipio.Text + '\n' +
                                '\n' +
                                "- " + lblDatosProyecto.Text + '\n' +
                                '\n' +
                                lblProyecto.Text + " " + txtProyecto.Text + '\n' +
                                lblArea.Text + " " + ddlArea.SelectedItem.Text + '\n' +
                                '\n' +
                                "- " + lblInfoAdicional.Text + '\n' +
                                '\n' +
                                lblNombreHuesped.Text + " " + txtNombreHuesped.Text + '\n' +
                                lblJustificacion.Text + " " + txtJustificacion.Text + '\n' +
                                '\n' +
                                '\n' +
                                "Clave de registro: " + lblHiddenClave.Text + '\n' +
                                '\n' +
                                '\n' +
                                "Gracias," + '\n' + "Comite Organizador" + '\n' + "CIBNOR, S.C.";

        lblHiddenMensaje.Text = lblHiddenMensaje.Text.Replace("\n", "<br />");

        //Crear el comando para el INSERT
        SqlDSregistro.InsertCommand = "INSERT INTO pace2014 VALUES ('" +
                                      txtNombre.Text + "', '" +
                                      txtCorreo.Text + "', '" +
                                      txtTelefono.Text + "', '" +
                                      ddlSexo.SelectedValue + "', '" +
                                      txtEdad.Text + "', '" +

                                      txtInstitucion.Text + "', '" +
                                      txtDomicilio.Text + "', '" +
                                      txtMunicipio.Text + "', '" +

                                      txtProyecto.Text + "', '" +
                                      ddlArea.SelectedItem.Text + "', '" +

                                      txtNombreHuesped.Text + "', '" +
                                      txtJustificacion.Text + "', '" +
                                      lblHiddenClave.Text + "', '" +
                                      "1" + "', GetDate())";

        int registroOk = 1; // Para validar si el registro se ejecuto en el server
        OperacionesBasicas OpbCorreo = new OperacionesBasicas();

        try
        {
            SqlDSregistro.Insert();
            //Mandamos el correo( de,                para,           copia oculta,           asunto,                 mensaje )
            OpbCorreo.enviarCorreo("*****@*****.**", txtCorreo.Text, "*****@*****.**", "pace2014 - Registro web", lblHiddenMensaje.Text);
        }
        catch (Exception ex)
        {
            OpbCorreo.enviarCorreo("*****@*****.**", "*****@*****.**", "-", "Error", "ex.Message: " + ex.Message + " - " + txtCorreo.Text + " - ex.InnerException.Message: " + ex.InnerException.Message);
            registroOk          = 0;
            lblStatusEnvio.Text = "Hubo un problema al procesar su registro, favor de intentarlo de nuevo mas tarde. El webmaster ya ha sido notificado.";
        }
        if (registroOk == 1)
        {
            Response.Redirect("~/RegistroOk.aspx?evento=pace2014");
        }
    }
    protected void btnEnviar_Click(object sender, EventArgs e)
    {
        //Crear el comando para el UPDATE
        SqlDSregistro.InsertCommand = "INSERT INTO waterbirds2014 VALUES ('" +

            txtApellidos.Text + "', '" +
            txtNombres.Text + "', '" +
            ddlSexo.SelectedValue + "', '" +
            txtCorreo.Text + "', '" +
            txtCelular.Text + "', '" +
            txtTelefono.Text + "', '" +
            txtInstitucion.Text + "', '" +
            txtDomicilio.Text + "', '" +

            rblFactura.SelectedValue + "', '" +
            txtFacturaNombre.Text + "', '" +
            txtFacturaRFC.Text + "', '" +
            txtFacturaDireccion.Text + "', '" +

            ddlCongresoLlegada.SelectedValue + "', '" +
            ddlCongresoAsistir.SelectedValue + "', '" +
            txtRequerimientosEspeciales.Text + "', '" +
            lblHiddenSociedades.Text + "', '" +
            txtNombresPersonas.Text + "', '" +
            txtCamisetas.Text + "', '" +
            txtCamisetasTallas.Text + "', '" +
            ddlPlatillo.SelectedValue + "', '" +
            ddlSalidaCampo.SelectedValue + "', '" +

            txtComentarios.Text + "', '" +
            "1" + "', GetDate())";

        int registroOk = 1; // Para validar si el registro se ejecuto en el server
        OperacionesBasicas Opb = new OperacionesBasicas();
        try
        {
            SqlDSregistro.Insert();
            //ARMAR CUERPO DEL MENSAJE
            string mensaje = lblHiddenEstimado.Text + " " + txtNombres.Text.Trim() + ", " + lblHiddenRegistrado.Text + '\n' +
                '\n' +
                lblHiddenMensaje.Text + '\n' +
                    '\n' +
                    '\n' +
                lblHiddenGracias.Text +", " + '\n' + lblHiddenComite.Text + '\n' + "CIBNOR, S.C.";

            mensaje = mensaje.Replace("\n", "<br />");

            //Mandamos el correo( de,                para,           copia oculta,           asunto,                 mensaje )
            Opb.enviarCorreo("*****@*****.**", txtCorreo.Text, "*****@*****.**", "Waterbirds2014 - Registro web", mensaje);
        }
        catch (Exception ex)
        {
            Opb.enviarCorreo("*****@*****.**", "*****@*****.**", "*****@*****.**", "Error", "ex.Message: " + ex.Message + " - " + txtCorreo.Text + " - ex.InnerException.Message: " + ex.InnerException.Message);
            registroOk = 0;
            lblStatusEnvio.Text = "Hubo un problema al procesar su registro, favor de intentarlo de nuevo mas tarde. El webmaster ya ha sido notificado.";
        }
        if (registroOk == 1)
        {
            Response.Redirect("~/RegistroOk.aspx?evento=waterbirds2014");
        }
    }
    protected void btnEnviar_Click(object sender, EventArgs e)
    {
        OperacionesBasicas          Opb = new OperacionesBasicas();
        Dictionary <string, string> filesUploadErrors = new Dictionary <string, string>();

        lblStatus.Text = "";
        var correoAlias   = "";
        var correoSubject = "";

        if (txtComentarios.Text.Length > 999)
        {
            txtComentarios.Text = txtComentarios.Text.Substring(0, 999);
        }

        //lblStatus.Text += txtType.Text;
        //lblStatus.Text += "-antes del switch.";
        switch (txtType.Text)
        {
            #region Taller en Julio
        case "1a":
            lblHiddenMensaje.Text =
                "- DATOS GENERALES" + '\n' +
                '\n' +
                "Nombre completo: " + txtNombre.Text + '\n' +
                "Correo electr&oacute;nico: " + txtCorreo.Text + '\n' +
                "Instituci&oacute;n: " + txtInstitucion.Text + '\n' +
                '\n' +
                "- ITINERARIO" + '\n' +
                "Traslado: " + rblTraslado.SelectedItem.Text + '\n' +
                '\n';

            var datosTraslado =
                "-- VIAJE DE IDA --" + '\n' + '\n' +
                lblVueloSalida1.Text + '\n' +
                txtSalidaOrigen1.Attributes["placeholder"] + txtSalidaOrigen1.Text + " - " +
                txtSalidaDestino1.Attributes["placeholder"] + txtSalidaDestino1.Text + " - " +
                txtSalidaAerolinea1.Attributes["placeholder"] + txtSalidaAerolinea1.Text + " - " +
                txtSalidaNoVuelo1.Attributes["placeholder"] + txtSalidaNoVuelo1.Text + '\n' +
                txtSalidaFecha1.Attributes["placeholder"] + txtSalidaFecha1.Text + " - " +
                txtSalidaHora1.Attributes["placeholder"] + txtSalidaHora1.Text + " - " +
                txtSalidaHoraLlegada1.Attributes["placeholder"] + txtSalidaHoraLlegada1.Text + '\n' +
                '\n' +
                lblVueloSalida2.Text + '\n' +
                txtSalidaOrigen2.Attributes["placeholder"] + txtSalidaOrigen2.Text + " - " +
                txtSalidaDestino2.Attributes["placeholder"] + txtSalidaDestino2.Text + " - " +
                txtSalidaAerolinea2.Attributes["placeholder"] + txtSalidaAerolinea2.Text + " - " +
                txtSalidaNoVuelo2.Attributes["placeholder"] + txtSalidaNoVuelo2.Text + '\n' +
                txtSalidaFecha2.Attributes["placeholder"] + txtSalidaFecha2.Text + " - " +
                txtSalidaHora2.Attributes["placeholder"] + txtSalidaHora2.Text + " - " +
                txtSalidaHoraLlegada2.Attributes["placeholder"] + txtSalidaHoraLlegada2.Text + '\n' +
                '\n' +
                "-- VIAJE DE REGRESO --" + '\n' + '\n' +
                lblVueloRegreso1.Text + '\n' +
                txtRegresoOrigen1.Attributes["placeholder"] + txtRegresoOrigen1.Text + " - " +
                txtRegresoDestino1.Attributes["placeholder"] + txtRegresoDestino1.Text + " - " +
                txtRegresoAerolinea1.Attributes["placeholder"] + txtRegresoAerolinea1.Text + " - " +
                txtRegresoNoVuelo1.Attributes["placeholder"] + txtRegresoNoVuelo1.Text + '\n' +
                txtRegresoFecha1.Attributes["placeholder"] + txtRegresoFecha1.Text + " - " +
                txtRegresoHora1.Attributes["placeholder"] + txtRegresoHora1.Text + " - " +
                txtRegresoHoraLlegada1.Attributes["placeholder"] + txtRegresoHoraLlegada1.Text + '\n' +
                '\n' +
                lblVueloRegreso2.Text + '\n' +
                txtRegresoOrigen2.Attributes["placeholder"] + txtRegresoOrigen2.Text + " - " +
                txtRegresoDestino2.Attributes["placeholder"] + txtRegresoDestino2.Text + " - " +
                txtRegresoAerolinea2.Attributes["placeholder"] + txtRegresoAerolinea2.Text + " - " +
                txtRegresoNoVuelo2.Attributes["placeholder"] + txtRegresoNoVuelo2.Text + '\n' +
                txtRegresoFecha2.Attributes["placeholder"] + txtRegresoFecha2.Text + " - " +
                txtRegresoHora2.Attributes["placeholder"] + txtRegresoHora2.Text + " - " +
                txtRegresoHoraLlegada2.Attributes["placeholder"] + txtRegresoHoraLlegada2.Text + '\n' +
                '\n';

            if (rblTraslado.SelectedValue == "si")
            {
                lblHiddenMensaje.Text += datosTraslado;
            }

            lblHiddenMensaje.Text +=
                "- INFORMACI&Oacute;N ADICIONAL" + '\n' +
                '\n' +
                "Comentarios: " + txtComentarios.Text;
            lblHiddenMensaje.Text = lblHiddenMensaje.Text.Replace("\n", "<br />");

            //Crear el comando para el UPDATE
            SqlDSregistro.InsertCommand = "INSERT INTO renanpTaller VALUES ('" +
                                          txtNombre.Text + "', '" +
                                          txtCorreo.Text + "', '" +
                                          txtInstitucion.Text + "', '" +
                                          rblTraslado.SelectedItem.Text + "', '" +
                                          txtSalidaOrigen1.Text + "', '" +
                                          txtSalidaDestino1.Text + "', '" +
                                          txtSalidaAerolinea1.Text + "', '" +
                                          txtSalidaNoVuelo1.Text + "', '" +
                                          txtSalidaFecha1.Text + "', '" +
                                          txtSalidaHora1.Text + "', '" +
                                          txtSalidaHoraLlegada1.Text + "', '" +
                                          txtSalidaOrigen2.Text + "', '" +
                                          txtSalidaDestino2.Text + "', '" +
                                          txtSalidaAerolinea2.Text + "', '" +
                                          txtSalidaNoVuelo2.Text + "', '" +
                                          txtSalidaFecha2.Text + "', '" +
                                          txtSalidaHora2.Text + "', '" +
                                          txtSalidaHoraLlegada2.Text + "', '" +

                                          txtRegresoOrigen1.Text + "', '" +
                                          txtRegresoDestino1.Text + "', '" +
                                          txtRegresoAerolinea1.Text + "', '" +
                                          txtRegresoNoVuelo1.Text + "', '" +
                                          txtRegresoFecha1.Text + "', '" +
                                          txtRegresoHora1.Text + "', '" +
                                          txtRegresoHoraLlegada1.Text + "', '" +
                                          txtRegresoOrigen2.Text + "', '" +
                                          txtRegresoDestino2.Text + "', '" +
                                          txtRegresoAerolinea2.Text + "', '" +
                                          txtRegresoNoVuelo2.Text + "', '" +
                                          txtRegresoFecha2.Text + "', '" +
                                          txtRegresoHora2.Text + "', '" +
                                          txtRegresoHoraLlegada2.Text + "', '" +

                                          txtComentarios.Text + "', GetDate())";

            correoAlias   = "*****@*****.**";
            correoSubject = "Taller RENANP 2016 - Registro en linea.";

            break;
            #endregion

            #region Curso en Septiembre
        case "2a":
            lblHiddenMensaje.Text =
                "- DATOS GENERALES" + '\n' +
                '\n' +
                "Nombre completo: " + txtNombre.Text + '\n' +
                "Correo electr&oacute;nico: " + txtCorreo.Text + '\n' +
                "Instituci&oacute;n: " + txtInstitucion.Text + '\n' +
                '\n' +
                "- ITINERARIO" + '\n' +
                "Traslado: " + rblCTraslado.SelectedItem.Text + '\n' +
                '\n';

            var datosCTraslado = "";
            if (rblCTraslado.SelectedValue == "si")
            {
                datosCTraslado =
                    "-- VIAJE DE IDA --" + '\n' + '\n' +
                    lblCVueloSalida1.Text + '\n' +
                    txtCSalidaOrigen1.Attributes["placeholder"] + txtCSalidaOrigen1.Text + " - " +
                    txtCSalidaDestino1.Attributes["placeholder"] + txtCSalidaDestino1.Text + " - " +
                    txtCSalidaAerolinea1.Attributes["placeholder"] + txtCSalidaAerolinea1.Text + " - " +
                    txtCSalidaNoVuelo1.Attributes["placeholder"] + txtCSalidaNoVuelo1.Text + '\n' +
                    txtCSalidaFecha1.Attributes["placeholder"] + txtCSalidaFecha1.Text + " - " +
                    txtCSalidaHora1.Attributes["placeholder"] + txtCSalidaHora1.Text + " - " +
                    txtCSalidaHoraLlegada1.Attributes["placeholder"] + txtCSalidaHoraLlegada1.Text + '\n' +
                    '\n' +
                    lblCVueloSalida2.Text + '\n' +
                    txtCSalidaOrigen2.Attributes["placeholder"] + txtCSalidaOrigen2.Text + " - " +
                    txtCSalidaDestino2.Attributes["placeholder"] + txtCSalidaDestino2.Text + " - " +
                    txtCSalidaAerolinea2.Attributes["placeholder"] + txtCSalidaAerolinea2.Text + " - " +
                    txtCSalidaNoVuelo2.Attributes["placeholder"] + txtCSalidaNoVuelo2.Text + '\n' +
                    txtCSalidaFecha2.Attributes["placeholder"] + txtCSalidaFecha2.Text + " - " +
                    txtCSalidaHora2.Attributes["placeholder"] + txtCSalidaHora2.Text + " - " +
                    txtCSalidaHoraLlegada2.Attributes["placeholder"] + txtCSalidaHoraLlegada2.Text + '\n' +
                    '\n' +
                    "-- VIAJE DE REGRESO --" + '\n' + '\n' +
                    lblCVueloRegreso1.Text + '\n' +
                    txtCRegresoOrigen1.Attributes["placeholder"] + txtCRegresoOrigen1.Text + " - " +
                    txtCRegresoDestino1.Attributes["placeholder"] + txtCRegresoDestino1.Text + " - " +
                    txtCRegresoAerolinea1.Attributes["placeholder"] + txtCRegresoAerolinea1.Text + " - " +
                    txtCRegresoNoVuelo1.Attributes["placeholder"] + txtCRegresoNoVuelo1.Text + '\n' +
                    txtCRegresoFecha1.Attributes["placeholder"] + txtCRegresoFecha1.Text + " - " +
                    txtCRegresoHora1.Attributes["placeholder"] + txtCRegresoHora1.Text + " - " +
                    txtCRegresoHoraLlegada1.Attributes["placeholder"] + txtCRegresoHoraLlegada1.Text + '\n' +
                    '\n' +
                    lblCVueloRegreso2.Text + '\n' +
                    txtCRegresoOrigen2.Attributes["placeholder"] + txtCRegresoOrigen2.Text + " - " +
                    txtCRegresoDestino2.Attributes["placeholder"] + txtCRegresoDestino2.Text + " - " +
                    txtCRegresoAerolinea2.Attributes["placeholder"] + txtCRegresoAerolinea2.Text + " - " +
                    txtCRegresoNoVuelo2.Attributes["placeholder"] + txtCRegresoNoVuelo2.Text + '\n' +
                    txtCRegresoFecha2.Attributes["placeholder"] + txtCRegresoFecha2.Text + " - " +
                    txtCRegresoHora2.Attributes["placeholder"] + txtCRegresoHora2.Text + " - " +
                    txtCRegresoHoraLlegada2.Attributes["placeholder"] + txtCRegresoHoraLlegada2.Text + '\n' +
                    '\n';
            }
            if (rblCTraslado.SelectedValue == "sb")
            {
                datosCTraslado =
                    "-- VIAJE EN AUTOBUS --" + '\n' + '\n' +
                    lblRuta.Text + '\n' +
                    txtCRutaOrigen.Attributes["placeholder"] + txtCRutaOrigen.Text + " - " +
                    txtCRutaHoraLlegada.Attributes["placeholder"] + txtCRutaHoraLlegada.Text + '\n' +
                    '\n';
            }

            if (rblCTraslado.SelectedValue != "no")
            {
                lblHiddenMensaje.Text += datosCTraslado;
            }

            lblHiddenMensaje.Text +=
                "- INFORMACI&Oacute;N ADICIONAL" + '\n' +
                '\n' +
                "Comentarios: " + txtComentarios.Text;
            lblHiddenMensaje.Text = lblHiddenMensaje.Text.Replace("\n", "<br />");

            //Crear el comando para el UPDATE
            SqlDSregistro.InsertCommand = "INSERT INTO renanpCurso VALUES ('" +
                                          txtNombre.Text + "', '" +
                                          txtCorreo.Text + "', '" +
                                          txtInstitucion.Text + "', '" +
                                          rblCTraslado.SelectedItem.Text + "', '" +
                                          txtCRutaOrigen.Text + "', '" +
                                          txtCRutaHoraLlegada.Text + "', '" +
                                          txtCSalidaOrigen1.Text + "', '" +
                                          txtCSalidaDestino1.Text + "', '" +
                                          txtCSalidaAerolinea1.Text + "', '" +
                                          txtCSalidaNoVuelo1.Text + "', '" +
                                          txtCSalidaFecha1.Text + "', '" +
                                          txtCSalidaHora1.Text + "', '" +
                                          txtCSalidaHoraLlegada1.Text + "', '" +
                                          txtCSalidaOrigen2.Text + "', '" +
                                          txtCSalidaDestino2.Text + "', '" +
                                          txtCSalidaAerolinea2.Text + "', '" +
                                          txtCSalidaNoVuelo2.Text + "', '" +
                                          txtCSalidaFecha2.Text + "', '" +
                                          txtCSalidaHora2.Text + "', '" +
                                          txtCSalidaHoraLlegada2.Text + "', '" +

                                          txtCRegresoOrigen1.Text + "', '" +
                                          txtCRegresoDestino1.Text + "', '" +
                                          txtCRegresoAerolinea1.Text + "', '" +
                                          txtCRegresoNoVuelo1.Text + "', '" +
                                          txtCRegresoFecha1.Text + "', '" +
                                          txtCRegresoHora1.Text + "', '" +
                                          txtCRegresoHoraLlegada1.Text + "', '" +
                                          txtCRegresoOrigen2.Text + "', '" +
                                          txtCRegresoDestino2.Text + "', '" +
                                          txtCRegresoAerolinea2.Text + "', '" +
                                          txtCRegresoNoVuelo2.Text + "', '" +
                                          txtCRegresoFecha2.Text + "', '" +
                                          txtCRegresoHora2.Text + "', '" +
                                          txtCRegresoHoraLlegada2.Text + "', '" +

                                          txtComentarios.Text + "', GetDate())";

            correoAlias   = "*****@*****.**";
            correoSubject = "Curso RENANP 2016 - Registro en linea";

            break;
            #endregion

            #region Congreso en Noviembre, participantes que pagan (3a)
        case "3a":
        default:
//                lblStatus.Text += "-dentro 3a.";
            string fileUploadPago       = "";
            string fileUploadCredencial = "";

            string estudiante = "NO";
            if (chkEstudiante.Checked)
            {
                estudiante = "SI";
            }
            string factura = "NO";
            if (chkFactura.Checked)
            {
                factura = "SI";
            }

            if (fuAdjuntoPago.Value.Length > 3)
            {
                fileUploadPago = Opb.adjuntarArchivo(fuAdjuntoPago, "~/renanp2016/uploads", txtCorreo.Text);
                if (fileUploadPago != "ok")
                {
                    filesUploadErrors.Add("Factura", fileUploadPago);
                }
            }

            if ((fuAdjuntoCredencial.Value.Length > 3) && (estudiante == "SI"))
            {
                fileUploadCredencial = Opb.adjuntarArchivo(fuAdjuntoCredencial, "~/renanp2016/uploads", txtCorreo.Text + "_credencial");
                if (fileUploadCredencial != "ok")
                {
                    filesUploadErrors.Add("Credencial", fileUploadPago);
                }
            }

//                if (fileUploadPago != "ok" || fileUploadCredencial != "ok") {
//                    lblStatus.Text += "-error al subir algun archivo.";
//                    break;
//                }

            lblHiddenMensaje.Text =
                "Nombre completo: " + txtNombre.Text + '\n' +
                "Correo electr&oacute;nico: " + txtCorreo.Text + '\n' +
                "Instituci&oacute;n: " + txtInstitucion.Text + '\n' +
                '\n' +
                "Modalidad: " + ddlModalidad.SelectedItem.Text + '\n' +
                "Es estudiante: " + estudiante + '\n' +
                "Titulo del resumen: " + txtTituloResumen.Text + '\n' +
                "Autor(es): " + txtAutores.Text + '\n' +
                "Co autor(es): " + txtCoAutores.Text + '\n' +
                '\n' +
                "Opcion de pago: " + ddlPago.SelectedItem.Text + '\n' +
                "- Datos para facturaci&oacute;n ---" + '\n' +
                "Requiere factura: " + factura + '\n' +
                "RFC: " + txtFacturaRfc.Text + '\n' +
                "Nombre: " + txtFacturaNombre.Text + '\n' +
                "Domicilio: " + txtDomicilio.Text + '\n' +
                '\n' +
                "Comentarios: " + txtComentarios.Text;

            //Crear el comando para el UPDATE
            SqlDSregistro.InsertCommand = "INSERT INTO renanpCongreso3a VALUES ('" +
                                          txtNombre.Text + "', '" +
                                          txtCorreo.Text + "', '" +
                                          txtInstitucion.Text + "', '" +

                                          ddlModalidad.SelectedItem.Text + "', '" +
                                          estudiante + "', '" +
                                          txtTituloResumen.Text + "', '" +
                                          txtAutores.Text + "', '" +
                                          txtCoAutores.Text + "', '" +

                                          ddlPago.SelectedItem.Text + "', '" +
                                          factura + "', '" +
                                          txtFacturaRfc.Text + "', '" +
                                          txtFacturaNombre.Text + "', '" +
                                          txtDomicilio.Text + "', '" +

                                          txtComentarios.Text + "', GetDate())";

            correoAlias   = "*****@*****.**";
            correoSubject = "Congreso RENANP 2016 - Registro en linea";
            break;
            #endregion

            #region Congreso en Nov, invitados y staff (3b)
        case "3b":
            lblHiddenMensaje.Text =
                "- DATOS GENERALES" + '\n' +
                '\n' +
                "Nombre completo: " + txtNombre.Text + '\n' +
                "Correo electr&oacute;nico: " + txtCorreo.Text + '\n' +
                "Instituci&oacute;n: " + txtInstitucion.Text + '\n' +
                '\n' +
                "- ITINERARIO" + '\n' +
                "Traslado: " + rblCOTraslado.SelectedItem.Text + '\n' +
                '\n';

            var datosCOTraslado = "";
            if (rblCOTraslado.SelectedValue == "si")
            {
                datosCOTraslado =
                    "-- VIAJE DE IDA --" + '\n' + '\n' +
                    lblCOVueloSalida1.Text + '\n' +
                    txtCOSalidaOrigen1.Attributes["placeholder"] + txtCOSalidaOrigen1.Text + " - " +
                    txtCOSalidaDestino1.Attributes["placeholder"] + txtCOSalidaDestino1.Text + " - " +
                    txtCOSalidaAerolinea1.Attributes["placeholder"] + txtCOSalidaAerolinea1.Text + " - " +
                    txtCOSalidaNoVuelo1.Attributes["placeholder"] + txtCOSalidaNoVuelo1.Text + '\n' +
                    txtCOSalidaFecha1.Attributes["placeholder"] + txtCOSalidaFecha1.Text + " - " +
                    txtCOSalidaHora1.Attributes["placeholder"] + txtCOSalidaHora1.Text + " - " +
                    txtCOSalidaHoraLlegada1.Attributes["placeholder"] + txtCOSalidaHoraLlegada1.Text + '\n' +
                    '\n' +
                    lblCOVueloSalida2.Text + '\n' +
                    txtCOSalidaOrigen2.Attributes["placeholder"] + txtCOSalidaOrigen2.Text + " - " +
                    txtCOSalidaDestino2.Attributes["placeholder"] + txtCOSalidaDestino2.Text + " - " +
                    txtCOSalidaAerolinea2.Attributes["placeholder"] + txtCOSalidaAerolinea2.Text + " - " +
                    txtCOSalidaNoVuelo2.Attributes["placeholder"] + txtCOSalidaNoVuelo2.Text + '\n' +
                    txtCOSalidaFecha2.Attributes["placeholder"] + txtCOSalidaFecha2.Text + " - " +
                    txtCOSalidaHora2.Attributes["placeholder"] + txtCOSalidaHora2.Text + " - " +
                    txtCOSalidaHoraLlegada2.Attributes["placeholder"] + txtCOSalidaHoraLlegada2.Text + '\n' +
                    '\n' +
                    "-- VIAJE DE REGRESO --" + '\n' + '\n' +
                    lblCOVueloRegreso1.Text + '\n' +
                    txtCORegresoOrigen1.Attributes["placeholder"] + txtCORegresoOrigen1.Text + " - " +
                    txtCORegresoDestino1.Attributes["placeholder"] + txtCORegresoDestino1.Text + " - " +
                    txtCORegresoAerolinea1.Attributes["placeholder"] + txtCORegresoAerolinea1.Text + " - " +
                    txtCORegresoNoVuelo1.Attributes["placeholder"] + txtCORegresoNoVuelo1.Text + '\n' +
                    txtCORegresoFecha1.Attributes["placeholder"] + txtCORegresoFecha1.Text + " - " +
                    txtCORegresoHora1.Attributes["placeholder"] + txtCORegresoHora1.Text + " - " +
                    txtCORegresoHoraLlegada1.Attributes["placeholder"] + txtCORegresoHoraLlegada1.Text + '\n' +
                    '\n' +
                    lblCOVueloRegreso2.Text + '\n' +
                    txtCORegresoOrigen2.Attributes["placeholder"] + txtCORegresoOrigen2.Text + " - " +
                    txtCORegresoDestino2.Attributes["placeholder"] + txtCORegresoDestino2.Text + " - " +
                    txtCORegresoAerolinea2.Attributes["placeholder"] + txtCORegresoAerolinea2.Text + " - " +
                    txtCORegresoNoVuelo2.Attributes["placeholder"] + txtCORegresoNoVuelo2.Text + '\n' +
                    txtCORegresoFecha2.Attributes["placeholder"] + txtCORegresoFecha2.Text + " - " +
                    txtCORegresoHora2.Attributes["placeholder"] + txtCORegresoHora2.Text + " - " +
                    txtCORegresoHoraLlegada2.Attributes["placeholder"] + txtCORegresoHoraLlegada2.Text + '\n' +
                    '\n';
            }
            if (rblCOTraslado.SelectedValue == "sb")
            {
                datosCOTraslado =
                    "-- VIAJE EN AUTOBUS --" + '\n' + '\n' +
                    lblCORuta.Text + '\n' +
                    txtCORutaOrigen.Attributes["placeholder"] + txtCORutaOrigen.Text + " - " +
                    txtCORutaHoraLlegada.Attributes["placeholder"] + txtCORutaHoraLlegada.Text + '\n' +
                    '\n';
            }

            if (rblCOTraslado.SelectedValue != "no")
            {
                lblHiddenMensaje.Text += datosCOTraslado;
            }

            lblHiddenMensaje.Text +=
                "- INFORMACI&Oacute;N ADICIONAL" + '\n' +
                '\n' +
                "Comentarios: " + txtComentarios.Text;
            lblHiddenMensaje.Text = lblHiddenMensaje.Text.Replace("\n", "<br />");

            //Crear el comando para el UPDATE
            SqlDSregistro.InsertCommand = "INSERT INTO renanpCongreso3b VALUES ('" +
                                          txtNombre.Text + "', '" +
                                          txtCorreo.Text + "', '" +
                                          txtInstitucion.Text + "', '" +
                                          rblCOTraslado.SelectedItem.Text + "', '" +
                                          txtCORutaOrigen.Text + "', '" +
                                          txtCORutaHoraLlegada.Text + "', '" +
                                          txtCOSalidaOrigen1.Text + "', '" +
                                          txtCOSalidaDestino1.Text + "', '" +
                                          txtCOSalidaAerolinea1.Text + "', '" +
                                          txtCOSalidaNoVuelo1.Text + "', '" +
                                          txtCOSalidaFecha1.Text + "', '" +
                                          txtCOSalidaHora1.Text + "', '" +
                                          txtCOSalidaHoraLlegada1.Text + "', '" +
                                          txtCOSalidaOrigen2.Text + "', '" +
                                          txtCOSalidaDestino2.Text + "', '" +
                                          txtCOSalidaAerolinea2.Text + "', '" +
                                          txtCOSalidaNoVuelo2.Text + "', '" +
                                          txtCOSalidaFecha2.Text + "', '" +
                                          txtCOSalidaHora2.Text + "', '" +
                                          txtCOSalidaHoraLlegada2.Text + "', '" +

                                          txtCORegresoOrigen1.Text + "', '" +
                                          txtCORegresoDestino1.Text + "', '" +
                                          txtCORegresoAerolinea1.Text + "', '" +
                                          txtCORegresoNoVuelo1.Text + "', '" +
                                          txtCORegresoFecha1.Text + "', '" +
                                          txtCORegresoHora1.Text + "', '" +
                                          txtCORegresoHoraLlegada1.Text + "', '" +
                                          txtCORegresoOrigen2.Text + "', '" +
                                          txtCORegresoDestino2.Text + "', '" +
                                          txtCORegresoAerolinea2.Text + "', '" +
                                          txtCORegresoNoVuelo2.Text + "', '" +
                                          txtCORegresoFecha2.Text + "', '" +
                                          txtCORegresoHora2.Text + "', '" +
                                          txtCORegresoHoraLlegada2.Text + "', '" +

                                          txtComentarios.Text + "', GetDate())";

            correoAlias   = "*****@*****.**";
            correoSubject = "Congreso RENANP 2016 - Registro en linea invitados";

            break;
            #endregion
        }

        //lblStatus.Text = "Prueba de correo realizada con exito!"; // para pruebas
        //lblStatus.Text += SqlDSregistro.InsertCommand;

        if (filesUploadErrors.Count == 0)   // Si no hubo errores al subir los archivos, procede...
        {
            SqlDSregistro.Insert();

            //ARMAR CUERPO DEL MENSAJE
            string mensaje = "Gracias, el registro ha sido completado con exito." + '\n' +
                             '\n' +
                             lblHiddenMensaje.Text + '\n' +
                             '\n' +
                             '\n' +
                             "Atentamente," + '\n' + "Comite Organizador" + '\n' + "CIBNOR, S.C.";

            mensaje = mensaje.Replace("\n", "<br />");

            // MANDAMOS EL CORREO
            Opb.enviarCorreo("-", "-", txtCorreo.Text, correoAlias, "-", correoSubject, mensaje, "normal");
            //Opb.enviarCorreo("-", "-", txtCorreo.Text, "*****@*****.**", "-", correoSubject, mensaje, "normal");

            Response.Redirect("~/RegistroOk.aspx?evento=renanp2016");
        }
        else   // ... de lo contrario envia el error a la etiqueta y no lo dejes pasar
        {
            lblStatus.Text = "Favor de revisar lo siguiente:";
            foreach (KeyValuePair <string, string> kvp in filesUploadErrors)
            {
                lblStatus.Text += "<br/>+ Error en: " + kvp.Key + " -- " + kvp.Value;
            }
        }
    }
Ejemplo n.º 18
0
    protected void btnEnviar_Click(object sender, EventArgs e)
    {
        OperacionesBasicas OpbCorreo = new OperacionesBasicas();

        SqlDScolorcamiseta.UpdateCommand = "UPDATE AnivColorCamiseta SET [selected] = 'ocupado' " +
                                           "WHERE [color] = '" + ddlColorCamiseta.SelectedValue + "'";
        SqlDScolorcamiseta.Update();


        SqlDSregistro.InsertCommand = "INSERT INTO anivvoleibol VALUES ('" + txtNombres.Text +
                                      "', '" + txtApellidos.Text +
                                      "', '" + txtCorreo.Text +
                                      "', '" + txtTelefono.Text +
                                      "', '" + txtNombreEquipo.Text +
                                      "', '" + ddlColorCamiseta.SelectedValue +

                                      "', '" + txtNombreI1.Text + "', '" + txtNombreI2.Text +
                                      "', '" + txtNombreI3.Text + "', '" + txtNombreI4.Text +
                                      "', '" + txtNombreI5.Text + "', '" + txtNombreI6.Text +
                                      "', '" + txtNombreI7.Text + "', '" + txtNombreI8.Text +
                                      "', '" + txtNombreI9.Text + "', '" + txtNombreI10.Text +
                                      "', '" + txtNombreI11.Text + "', '" + txtNombreI12.Text +
                                      "', '" + txtNombreI13.Text + "', '" + txtNombreI14.Text +
                                      "', '" + txtNombreI15.Text +

                                      "', '" + txtComentarios.Text +

                                      "', GetDate())";
//            SqlDSregistro.Insert();

        //Armamos el mensaje
        lblHiddenMensaje.Text =
            "- Datos del capitan" + '\n' +
            "------------------------------------------------" + '\n' +
            '\n' +
            "Nombre(s): " + txtNombres.Text + '\n' +
            "Apellido(s): " + txtApellidos.Text + '\n' +
            "Correo electronico: " + txtCorreo.Text + '\n' +
            "Telefono: " + txtTelefono.Text + '\n' +
            '\n' +
            "- Datos del equipo" + '\n' +
            "------------------------------------------------" + '\n' +
            '\n' +
            "Nombre del equipo: " + txtNombreEquipo.Text + '\n' +
            "Color de camiseta: " + ddlColorCamiseta.SelectedValue + '\n' +
            '\n' +
            "- Integrantes" + '\n' +
            "01: " + txtNombreI1.Text + '\n' +
            "02: " + txtNombreI2.Text + '\n' +
            "03: " + txtNombreI3.Text + '\n' +
            "04: " + txtNombreI4.Text + '\n' +
            "05: " + txtNombreI5.Text + '\n' +
            "06: " + txtNombreI6.Text + '\n' +
            "07: " + txtNombreI7.Text + '\n' +
            "08: " + txtNombreI8.Text + '\n' +
            "09: " + txtNombreI9.Text + '\n' +
            "10: " + txtNombreI10.Text + '\n' +
            "11: " + txtNombreI11.Text + '\n' +
            "12: " + txtNombreI12.Text + '\n' +
            "13: " + txtNombreI13.Text + '\n' +
            "14: " + txtNombreI14.Text + '\n' +
            "15: " + txtNombreI15.Text + '\n' +
            '\n' +
            "Comentarios: " + txtComentarios.Text;


        string mensaje = "Estimado(a) " + txtNombres.Text.Trim() + ", usted ha sido registrado(a)." + '\n' +
                         '\n' +
                         lblHiddenMensaje.Text + '\n' +
                         '\n' +
                         '\n' +
                         "Gracias," + '\n' +
                         '\n' +
                         "Comite Organizador" + '\n' + "CIBNOR, S.C.";

        mensaje = mensaje.Replace("\n", "<br />");

        int registroOk = 1;     // Para validar si el registro se ejecuto en el server

        try
        {
            SqlDSregistro.Insert();
            //    // Mandamos correo(from, password, to, [cc | "-"], [cco | "-"], subject, msg, priority) Se le pone "-" al from y password para que use las crendenciales de eventos.cibnor@
            OpbCorreo.enviarCorreo("-", "-", txtCorreo.Text, "*****@*****.**", "*****@*****.**", "Voleibol - Registro web", mensaje, "normal");
        }
        catch (Exception ex)
        {
            OpbCorreo.enviarCorreo("-", "-", "*****@*****.**", "-", "-",
                                   "Error voleibol", "ex.Message: " + ex.Message + " - " + txtCorreo.Text + " - ex.InnerException.Message: " + ex.InnerException.Message, "normal");

            registroOk     = 0;
            lblStatus.Text = "Hubo un problema al procesar su registro, favor de intentarlo de nuevo mas tarde. El webmaster ya ha sido notificado.";
        }
        if (registroOk == 1)
        {
            Response.Redirect("~/RegistroOk.aspx?evento=anivvoleibol");
        }


        //// Mandamos correo(from, to, [cc | "-"], [cco | "-"], subject, msg)
        //if (factura == "SI") {
        //    enviarCorreo("*****@*****.**", txtCorreo.Text, "*****@*****.**", "*****@*****.**", "anivvoleibol - Registro en linea", mensaje, "normal");
        //}
        //else {
        //    enviarCorreo("*****@*****.**", txtCorreo.Text, "-", "*****@*****.**", "anivvoleibol - Registro en linea", mensaje, "normal");
        //}

        //// Para pruebas
        ////enviarCorreo("*****@*****.**", txtCorreo.Text, "-", "-", "anivvoleibol - Registro en linea", mensaje, "normal");

        //Response.Redirect("~/RegistroOk.aspx?evento=anivvoleibol");


//        }
    }
    protected void btnEnviar_Click(object sender, EventArgs e)
    {
        // lblStatus.Text = Convert.ToString(numRegistros());
        OperacionesBasicas Opb = new OperacionesBasicas();

        if (Opb.numRegistros("expociencias", "correoEst1", txtCorreoEst1.Text) > 0)
        {
            lblStatus.Text = "El correo que ingresaste ya se encuentra registrado, por favor utiliza otro.";
            txtCorreoEst1.Focus();
        }
        else
        {
            if (fuArchivo.Value.Length > 3)
            {
                string fileUpload = "";
                fileUpload = Opb.adjuntarArchivo(fuArchivo, "~/expociencias/uploads", txtCorreoEst1.Text);
            }

            lblStatus.Text      = "";
            lblHiddenClave.Text = ddlCategoria.SelectedValue + ddlArea.SelectedValue + Convert.ToString(numRegistrosClave() + 1);

            string equipo = " " + '\n';
            if (rblNumeroEstudiantes.SelectedValue != "1")
            {
                equipo +=
                    "Nombre completo del estudiante 2: " + txtNombreEst2.Text + '\n' +
                    "Correo electr&oacute;nico: " + txtCorreoEst2.Text + '\n' +
                    "Talla playera unisex: " + ddlTallaEst2.SelectedValue + '\n' +
                    "Nombre completo del estudiante 3: " + txtNombreEst3.Text + '\n' +
                    "Correo electr&oacute;nico: " + txtCorreoEst3.Text + '\n' +
                    "Talla playera unisex: " + ddlTallaEst3.SelectedValue + '\n';
            }
            #region cuerpo del mensaje
            lblHiddenMensaje.Text =
                "- DATOS GENERALES DEL AUTOR(ES) Y ASESOR(ES)" + '\n' +
                '\n' +
                "Nombre completo del estudiante titular: " + txtNombreEst1.Text + '\n' +
                "Correo electr&oacute;nico: " + txtCorreoEst1.Text + '\n' +
                "Talla playera unisex: " + ddlTallaEst1.SelectedValue + '\n' +
                "Tel&eacute;fono: " + txtTelefonoEst1.Text + '\n' +
                "Sexo: " + ddlSexoEst1.SelectedValue + '\n' +
                "Edad: " + txtEdadEst1.Text + '\n' +

                "Individual o Equipo: " + rblNumeroEstudiantes.SelectedItem.Text +
                equipo +

                "Nombre de la instituci&oacute;n: " + txtInstitucion.Text + '\n' +
                "Domicilio oficial: " + txtDomicilio.Text + '\n' +
                "Municipio: " + txtMunicipio.Text + '\n' +

                "Nombre completo asesor(a): " + txtNombreAsesor.Text + '\n' +
                "Correo electr&oacute;nico: " + txtCorreoAsesor.Text + '\n' +
                "Tel&eacute;fono: " + txtTelefonoAsesor.Text + '\n' +
                '\n' +
                "- DATOS DEL PROYECTO Y PARTICIPACI&Oacute;N" + '\n' +
                '\n' +
                "Nombre del proyecto u obra: " + txtNombreProyecto.Text + '\n' +
                "Categor&iacute;a de participaci&oacute;n: " + ddlCategoria.SelectedItem.Text + '\n' +
                "&Aacute;rea de participaci&oacute;n: " + ddlArea.SelectedItem.Text + '\n' +
                '\n' +
                "Descripci&oacute;n del proyecto: " + '\n' + txtDescripcionProyecto.Text + '\n' +
                '\n' +
                "Forma de pago: " + rblTipoPago.SelectedValue + '\n' +
                '\n' +
                "- INFORMACI&Oacute;N ADICIONAL" + '\n' +
                '\n' +
                "Nombre completo de quien requiere el hospedaje: " + txtNombreHuesped.Text + '\n' +
                "Justificaci&oacute;n: " + txtJustificacion.Text + '\n' +
                '\n' +
                '\n' +
                "Clave de registro: " + lblHiddenClave.Text;
            lblHiddenMensaje.Text = lblHiddenMensaje.Text.Replace("\n", "<br />");
            #endregion

            #region InsertCommand
            //txtDescripcionProyecto.Text = txtDescripcionProyecto.Text.Replace("\n", "<br />");
            //Crear el comando para el UPDATE
            SqlDSregistro.InsertCommand = "INSERT INTO expociencias VALUES ('" +
                                          txtNombreEst1.Text + "', '" +
                                          txtCorreoEst1.Text + "', '" +
                                          ddlTallaEst1.SelectedValue + "', '" +
                                          txtTelefonoEst1.Text + "', '" +
                                          ddlSexoEst1.SelectedValue + "', '" +
                                          txtEdadEst1.Text + "', '" +
                                          rblNumeroEstudiantes.SelectedValue + "', '" +
                                          txtNombreEst2.Text + "', '" +
                                          txtCorreoEst2.Text + "', '" +
                                          ddlTallaEst2.SelectedValue + "', '" +
                                          txtNombreEst3.Text + "', '" +
                                          txtCorreoEst3.Text + "', '" +
                                          ddlTallaEst3.SelectedValue + "', '" +

                                          txtNombreAsesor.Text + "', '" +
                                          txtCorreoAsesor.Text + "', '" +
                                          txtTelefonoAsesor.Text + "', '" +
                                          txtInstitucion.Text + "', '" +
                                          txtDomicilio.Text + "', '" +
                                          txtMunicipio.Text + "', '" +

                                          txtNombreProyecto.Text + "', '" +
                                          ddlCategoria.SelectedItem.Text + "', '" +
                                          ddlArea.SelectedItem.Text + "', '" +
                                          txtDescripcionProyecto.Text + "', '" +
                                          txtNombreHuesped.Text + "', '" +
                                          txtJustificacion.Text + "', '" +
                                          lblHiddenClave.Text + "', '" +
                                          rblTipoPago.SelectedValue + "', GetDate())";
            #endregion

            SqlDSregistro.Insert();

            //ARMAR CUERPO DEL MENSAJE
            string mensaje = "Estimado(a) participante, el registro ha sido completado con exíto." + '\n' +
                             '\n' +
                             lblHiddenMensaje.Text + '\n' +
                             '\n' +
                             '\n' +
                             "Gracias," + '\n' + "Comite Organizador" + '\n' + "CIBNOR, S.C.";

            mensaje = mensaje.Replace("\n", "<br />");

            // MANDAMOS EL CORREO
            Opb.enviarCorreo("-", "-", txtCorreoEst1.Text, "*****@*****.**", "*****@*****.**", "Expociencias - Registro en linea", lblHiddenMensaje.Text, "normal");
            //Opb.enviarCorreo("-", "-", txtCorreoEst1.Text, "*****@*****.**", "-", "TEST_Expociencias - Registro en linea", lblHiddenMensaje.Text, "normal"); // para pruebas

            Response.Redirect("~/RegistroOk.aspx?evento=expociencias");
        }
    }
    protected void btnEnviar_Click(object sender, EventArgs e)
    {
        //Crear el comando para el UPDATE
        SqlDSregistro.InsertCommand = "INSERT INTO waterbirds2014 VALUES ('" +

                                      txtApellidos.Text + "', '" +
                                      txtNombres.Text + "', '" +
                                      ddlSexo.SelectedValue + "', '" +
                                      txtCorreo.Text + "', '" +
                                      txtCelular.Text + "', '" +
                                      txtTelefono.Text + "', '" +
                                      txtInstitucion.Text + "', '" +
                                      txtDomicilio.Text + "', '" +

                                      rblFactura.SelectedValue + "', '" +
                                      txtFacturaNombre.Text + "', '" +
                                      txtFacturaRFC.Text + "', '" +
                                      txtFacturaDireccion.Text + "', '" +

                                      ddlCongresoLlegada.SelectedValue + "', '" +
                                      ddlCongresoAsistir.SelectedValue + "', '" +
                                      txtRequerimientosEspeciales.Text + "', '" +
                                      lblHiddenSociedades.Text + "', '" +
                                      txtNombresPersonas.Text + "', '" +
                                      txtCamisetas.Text + "', '" +
                                      txtCamisetasTallas.Text + "', '" +
                                      ddlPlatillo.SelectedValue + "', '" +
                                      ddlSalidaCampo.SelectedValue + "', '" +

                                      txtComentarios.Text + "', '" +
                                      "1" + "', GetDate())";

        int registroOk         = 1; // Para validar si el registro se ejecuto en el server
        OperacionesBasicas Opb = new OperacionesBasicas();

        try
        {
            SqlDSregistro.Insert();
            //ARMAR CUERPO DEL MENSAJE
            string mensaje = lblHiddenEstimado.Text + " " + txtNombres.Text.Trim() + ", " + lblHiddenRegistrado.Text + '\n' +
                             '\n' +
                             lblHiddenMensaje.Text + '\n' +
                             '\n' +
                             '\n' +
                             lblHiddenGracias.Text + ", " + '\n' + lblHiddenComite.Text + '\n' + "CIBNOR, S.C.";

            mensaje = mensaje.Replace("\n", "<br />");

            //Mandamos el correo( de,                para,           copia oculta,           asunto,                 mensaje )
            Opb.enviarCorreo("*****@*****.**", txtCorreo.Text, "*****@*****.**", "Waterbirds2014 - Registro web", mensaje);
        }
        catch (Exception ex)
        {
            Opb.enviarCorreo("*****@*****.**", "*****@*****.**", "*****@*****.**", "Error", "ex.Message: " + ex.Message + " - " + txtCorreo.Text + " - ex.InnerException.Message: " + ex.InnerException.Message);
            registroOk          = 0;
            lblStatusEnvio.Text = "Hubo un problema al procesar su registro, favor de intentarlo de nuevo mas tarde. El webmaster ya ha sido notificado.";
        }
        if (registroOk == 1)
        {
            Response.Redirect("~/RegistroOk.aspx?evento=waterbirds2014");
        }
    }
    protected void btnEnviar_Click(object sender, EventArgs e)
    {
        OperacionesBasicas Opb = new OperacionesBasicas();

        lblStatus.Text = "";
        if (txtComentarios.Text.Length > 999)
        {
            txtComentarios.Text = txtComentarios.Text.Substring(0, 999);
        }

        lblHiddenMensaje.Text =
            "- DATOS GENERALES" + '\n' +
            '\n' +
            "Nombre completo: " + txtNombre.Text + '\n' +
            "Correo electr&oacute;nico: " + txtCorreo.Text + '\n' +
            "Instituci&oacute;n: " + txtInstitucion.Text + '\n' +
            '\n' +
            "- ITINERARIO" + '\n' +
            "Traslado: " + rblCTraslado.SelectedItem.Text + '\n' +
            '\n';

        var datosCTraslado = "";

        if (rblCTraslado.SelectedValue == "si")
        {
            datosCTraslado =
                "-- VIAJE DE IDA --" + '\n' + '\n' +
                lblCVueloSalida1.Text + '\n' +
                txtCSalidaOrigen1.Attributes["placeholder"] + txtCSalidaOrigen1.Text + " - " +
                txtCSalidaDestino1.Attributes["placeholder"] + txtCSalidaDestino1.Text + " - " +
                txtCSalidaAerolinea1.Attributes["placeholder"] + txtCSalidaAerolinea1.Text + " - " +
                txtCSalidaNoVuelo1.Attributes["placeholder"] + txtCSalidaNoVuelo1.Text + '\n' +
                txtCSalidaFecha1.Attributes["placeholder"] + txtCSalidaFecha1.Text + " - " +
                txtCSalidaHora1.Attributes["placeholder"] + txtCSalidaHora1.Text + " - " +
                txtCSalidaHoraLlegada1.Attributes["placeholder"] + txtCSalidaHoraLlegada1.Text + '\n' +
                '\n' +
                lblCVueloSalida2.Text + '\n' +
                txtCSalidaOrigen2.Attributes["placeholder"] + txtCSalidaOrigen2.Text + " - " +
                txtCSalidaDestino2.Attributes["placeholder"] + txtCSalidaDestino2.Text + " - " +
                txtCSalidaAerolinea2.Attributes["placeholder"] + txtCSalidaAerolinea2.Text + " - " +
                txtCSalidaNoVuelo2.Attributes["placeholder"] + txtCSalidaNoVuelo2.Text + '\n' +
                txtCSalidaFecha2.Attributes["placeholder"] + txtCSalidaFecha2.Text + " - " +
                txtCSalidaHora2.Attributes["placeholder"] + txtCSalidaHora2.Text + " - " +
                txtCSalidaHoraLlegada2.Attributes["placeholder"] + txtCSalidaHoraLlegada2.Text + '\n' +
                '\n' +
                "-- VIAJE DE REGRESO --" + '\n' + '\n' +
                lblCVueloRegreso1.Text + '\n' +
                txtCRegresoOrigen1.Attributes["placeholder"] + txtCRegresoOrigen1.Text + " - " +
                txtCRegresoDestino1.Attributes["placeholder"] + txtCRegresoDestino1.Text + " - " +
                txtCRegresoAerolinea1.Attributes["placeholder"] + txtCRegresoAerolinea1.Text + " - " +
                txtCRegresoNoVuelo1.Attributes["placeholder"] + txtCRegresoNoVuelo1.Text + '\n' +
                txtCRegresoFecha1.Attributes["placeholder"] + txtCRegresoFecha1.Text + " - " +
                txtCRegresoHora1.Attributes["placeholder"] + txtCRegresoHora1.Text + " - " +
                txtCRegresoHoraLlegada1.Attributes["placeholder"] + txtCRegresoHoraLlegada1.Text + '\n' +
                '\n' +
                lblCVueloRegreso2.Text + '\n' +
                txtCRegresoOrigen2.Attributes["placeholder"] + txtCRegresoOrigen2.Text + " - " +
                txtCRegresoDestino2.Attributes["placeholder"] + txtCRegresoDestino2.Text + " - " +
                txtCRegresoAerolinea2.Attributes["placeholder"] + txtCRegresoAerolinea2.Text + " - " +
                txtCRegresoNoVuelo2.Attributes["placeholder"] + txtCRegresoNoVuelo2.Text + '\n' +
                txtCRegresoFecha2.Attributes["placeholder"] + txtCRegresoFecha2.Text + " - " +
                txtCRegresoHora2.Attributes["placeholder"] + txtCRegresoHora2.Text + " - " +
                txtCRegresoHoraLlegada2.Attributes["placeholder"] + txtCRegresoHoraLlegada2.Text + '\n' +
                '\n';
        }
        if (rblCTraslado.SelectedValue == "sb")
        {
            datosCTraslado =
                "-- VIAJE EN AUTOBUS --" + '\n' + '\n' +
                lblRuta.Text + '\n' +
                txtCRutaOrigen.Attributes["placeholder"] + txtCRutaOrigen.Text + " - " +
                txtCRutaHoraLlegada.Attributes["placeholder"] + txtCRutaHoraLlegada.Text + '\n' +
                '\n';
        }

        if (rblCTraslado.SelectedValue != "no")
        {
            lblHiddenMensaje.Text += datosCTraslado;
        }

        lblHiddenMensaje.Text +=
            "- INFORMACI&Oacute;N ADICIONAL" + '\n' +
            '\n' +
            "Comentarios: " + txtComentarios.Text;
        lblHiddenMensaje.Text = lblHiddenMensaje.Text.Replace("\n", "<br />");

        //Crear el comando para el UPDATE
        SqlDSregistro.InsertCommand = "INSERT INTO renanpCursoProfesores VALUES ('" +
                                      txtNombre.Text + "', '" +
                                      txtCorreo.Text + "', '" +
                                      txtInstitucion.Text + "', '" +
                                      txtType.Text + "', '" +
                                      rblCTraslado.SelectedItem.Text + "', '" +
                                      txtCRutaOrigen.Text + "', '" +
                                      txtCRutaHoraLlegada.Text + "', '" +
                                      txtCSalidaOrigen1.Text + "', '" +
                                      txtCSalidaDestino1.Text + "', '" +
                                      txtCSalidaAerolinea1.Text + "', '" +
                                      txtCSalidaNoVuelo1.Text + "', '" +
                                      txtCSalidaFecha1.Text + "', '" +
                                      txtCSalidaHora1.Text + "', '" +
                                      txtCSalidaHoraLlegada1.Text + "', '" +
                                      txtCSalidaOrigen2.Text + "', '" +
                                      txtCSalidaDestino2.Text + "', '" +
                                      txtCSalidaAerolinea2.Text + "', '" +
                                      txtCSalidaNoVuelo2.Text + "', '" +
                                      txtCSalidaFecha2.Text + "', '" +
                                      txtCSalidaHora2.Text + "', '" +
                                      txtCSalidaHoraLlegada2.Text + "', '" +

                                      txtCRegresoOrigen1.Text + "', '" +
                                      txtCRegresoDestino1.Text + "', '" +
                                      txtCRegresoAerolinea1.Text + "', '" +
                                      txtCRegresoNoVuelo1.Text + "', '" +
                                      txtCRegresoFecha1.Text + "', '" +
                                      txtCRegresoHora1.Text + "', '" +
                                      txtCRegresoHoraLlegada1.Text + "', '" +
                                      txtCRegresoOrigen2.Text + "', '" +
                                      txtCRegresoDestino2.Text + "', '" +
                                      txtCRegresoAerolinea2.Text + "', '" +
                                      txtCRegresoNoVuelo2.Text + "', '" +
                                      txtCRegresoFecha2.Text + "', '" +
                                      txtCRegresoHora2.Text + "', '" +
                                      txtCRegresoHoraLlegada2.Text + "', '" +

                                      txtComentarios.Text + "', GetDate())";
        SqlDSregistro.Insert();

        string mensaje = "Gracias, el registro ha sido completado con exito." + '\n' +
                         '\n' +
                         lblHiddenMensaje.Text + '\n' +
                         '\n' +
                         '\n' +
                         "Atentamente," + '\n' + "Comite Organizador" + '\n' + "CIBNOR, S.C.";

        mensaje = mensaje.Replace("\n", "<br />");

        // MANDAMOS EL CORREO
        Opb.enviarCorreo("-", "-", txtCorreo.Text, "*****@*****.**", correoAlias, correoSubject, mensaje, "normal");
        //Opb.enviarCorreo("-", "-", txtCorreo.Text, "*****@*****.**", "*****@*****.**", correoSubject, mensaje, "normal"); // PRUEBAS

        Response.Redirect("~/RegistroOk.aspx?evento=renanpCurso");
    }