Example #1
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;
            }
        }