예제 #1
0
        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;
            }
        }
예제 #2
0
        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);
        }
예제 #3
0
        public int ObtenerDedicación(string asignatura)
        {
            DBManager.DBManager db = new DBManager.DBManager();
            db.Conectar();
            int hmedias = db.getHorasMediasPorAsignatura(asignatura);

            db.CerrarConexion();
            return(hmedias);
        }
예제 #4
0
        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;
            }
        }
예제 #5
0
        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];
        }
예제 #6
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];
        }
예제 #7
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();
 }