-
Notifications
You must be signed in to change notification settings - Fork 0
/
cultivos2014.aspx.cs
78 lines (68 loc) · 2.72 KB
/
cultivos2014.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class cultivos2014 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnContinuar_Click(object sender, EventArgs e)
{
lblHiddenMensaje.Text =
"- " + lblDatosPersonales.Text + '\n' +
'\n' +
lblNombres.Text + " " + txtNombres.Text + '\n' +
lblApellidos.Text + " " + txtApellidos.Text + '\n' +
lblCorreo.Text + " " + txtCorreo.Text + '\n' +
lblInstitucion.Text + " " + txtInstitucion.Text + '\n' +
'\n' +
'\n' +
"- " + lblInformacionAdicional.Text + '\n' +
'\n' +
lblComentarios.Text + " " + txtComentarios.Text;
lblHiddenMensaje.Text = lblHiddenMensaje.Text.Replace("\n", "<br />");
//metemos el mensaje en una label y confirmamos el mensaje
lblConfirmacion.Text = lblHiddenMensaje.Text;
pnlDatos.Visible = false;
pnlConfirmacion.Visible = true;
}
protected void btnRegresar_Click(object sender, EventArgs e)
{
pnlDatos.Visible = true;
pnlConfirmacion.Visible = false;
}
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("cultivos@cibnor.mx", txtCorreo.Text, "cultivos@cibnor.mx", "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, "jcollins@cibnor.mx", "-", origen + ex.Message, Convert.ToString(Session["mensajeConfirmacion"]));
}
Response.Redirect("~/RegistroOk.aspx?evento=cultivos2014");
}
}