protected void Page_Load(object sender, EventArgs e) { System.Threading.Thread.Sleep(2000); /*if (!string.IsNullOrEmpty(Session["usuario"] as string)) * { * if (Session["tipo"].ToString() != "profesor") * { * Server.Transfer("~/Alumno/Alumno.aspx", true); * } * } * else * { * Response.Redirect("../Inicio.aspx"); * }*/ if (!IsPostBack) { dBManager = new DBManager.DBManager(); dBManager.Conectar(); ds = new DataSet(); da = dBManager.getTareasGenericas(); da.Fill(ds, "TareasGenericas"); cb = new SqlCommandBuilder(da); dt = ds.Tables[0]; DataView dv = new DataView(dt); GridView1.DataSource = dv; GridView1.DataBind(); Session["dataview"] = dv; } }
protected void Page_Load(object sender, EventArgs e) { db.Conectar(); db.borrarConectado(Session["usuario"].ToString()); System.Web.Security.FormsAuthentication.SignOut(); Session.Abandon(); Server.Transfer("Inicio.aspx", true); }
public int ObtenerDedicación(string asignatura) { DBManager.DBManager db = new DBManager.DBManager(); db.Conectar(); int hmedias = db.getHorasMediasPorAsignatura(asignatura); db.CerrarConexion(); return(hmedias); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Session["in"] = null; } log.Text += "PostBack" + IsPostBack + " -- " + IsCallback; /*if (!string.IsNullOrEmpty(Session["usuario"] as string)) * { * if (Session["tipo"].ToString() != "alumno") * { * Server.Transfer("../Profesor/Profesor.aspx", true); * } * } * else * { * Response.Redirect("../Inicio.aspx"); * }*/ dBManager.Conectar(); if (!HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority).Contains("localhost")) { log.Visible = false; } log.Text += Session["cod"].ToString(); txtBoxTarea.Text = Session["cod"].ToString(); txtBoxUsuario.Text = Session["usuario"].ToString(); txtBoxEst.Text = Session["horas"].ToString(); da = dBManager.getTareasAlumno(Session["usuario"].ToString()); ds = new System.Data.DataSet(); da.Fill(ds, "EstudiantesTareas"); cb = new SqlCommandBuilder(da); dt = ds.Tables[0]; GVTareas.DataSource = dt; GVTareas.DataBind(); if (IsPostBack) { Button1.Enabled = false; txtBoxReales.Enabled = false; } }
protected void Page_Load(object sender, EventArgs e) { /*if (!string.IsNullOrEmpty(Session["usuario"] as string)) * { * if (Session["tipo"].ToString() != "profesor") * { * Server.Transfer("~/Alumno/Alumno.aspx", true); * } * } * else * { * Response.Redirect("../Inicio.aspx"); * }*/ //Button1.Attributes.Add("onclick", "return window.confirm('¿Desea rellenar la base de datos con " + DropDownList2.SelectedValue.ToString() + ".xml?');"); dBManager = new DBManager.DBManager(); dBManager.Conectar(); ds = new DataSet(); da = dBManager.getTareasGenericas(); da.Fill(ds, "TareasGenericas"); cb = new SqlCommandBuilder(da); dt = ds.Tables[0]; }
protected void Page_Load(object sender, EventArgs e) { Page.UnobtrusiveValidationMode = System.Web.UI.UnobtrusiveValidationMode.None; //Para evitar errores que surgían en validación. /* if (!string.IsNullOrEmpty(Session["usuario"] as string)) * { * if (Session["tipo"].ToString() != "profesor") * { * Server.Transfer("~/Alumno/Alumno.aspx", true); * } * } * else * { * Response.Redirect("Inicio.aspx"); * }*/ dBManager = new DBManager.DBManager(); dBManager.Conectar(); ds = new DataSet(); da = dBManager.getTareasGenericas(); da.Fill(ds, "TareasGenericas"); cb = new SqlCommandBuilder(da); dt = ds.Tables[0]; }
protected void Page_Load(object sender, EventArgs e) { Page.UnobtrusiveValidationMode = System.Web.UI.UnobtrusiveValidationMode.None; //Para evitar errores que surgían en validación. db.Conectar(); }