-
Notifications
You must be signed in to change notification settings - Fork 0
/
periodo.aspx.cs
59 lines (49 loc) · 1.65 KB
/
periodo.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ProyectoAsp.Clases;
namespace ProyectoAsp
{
public partial class Formulario_web111 : System.Web.UI.Page
{
static string curso_id;
protected void Page_Load(object sender, EventArgs e)
{
//verificamos la sesion si esta activa en dado caso no exista ira al inicio (LOGIN)
try
{
var sesion_c = Session.Count;
if (sesion_c <= 0)
{
Response.Redirect("Login.aspx", true);
return;
}
}
catch { }
curso_id = Request.QueryString["id"].ToString();
curso_id = Encriptador.Desencriptar_Md5(curso_id);
string p = Session["perfil"].ToString();
int perfil = Convert.ToInt32(p);
if(!(perfil >= 1))
{
Response.Redirect("Index.aspx" ,true);
}
}
protected void cmdcrear_Click(object sender, EventArgs e)
{
Tutor Tutor = new Tutor();
bool ok = Tutor.CrearPeriodo(curso_id, txtnombre.Text, txtactivo.Checked);
if (!ok)
{
lblerror.InnerText = "Error al procesar la solicitud de agregar periodo puede que el servidor este ocupado";
}
else
{
lblerror.InnerHtml = "periodo agregado con exito <br /><a href='curso.aspx?id=" + Request.QueryString["id"].ToString() + "'>Regresar al curso</a>";
}
}
}
}