Example #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;
            }
        }
Example #2
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];
        }
Example #3
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];
        }