Exemple #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            LogicaNegocio.LogicaNegocio ln = new LogicaNegocio.LogicaNegocio();
            cnn = ln.getConection();
            if (!this.IsPostBack)
            {
                dataSetDDList = new DataSet();
                adapterDDList = new SqlDataAdapter("SELECT codigoasig FROM EstudiantesGrupo INNER JOIN GruposClase ON EstudiantesGrupo.Grupo = GruposClase.codigo WHERE EstudiantesGrupo.Email ='" + Session["email"].ToString() + "'", cnn);
                adapterDDList.Fill(dataSetDDList, "Asignaturas");
                dataTableDDList                = dataSetDDList.Tables["Asignaturas"];
                asignaturasList.DataSource     = dataSetDDList.Tables[0];
                asignaturasList.DataTextField  = "codigoasig";
                asignaturasList.DataValueField = "codigoasig";
                asignaturasList.DataBind();
            }

            Label7.Text  = "";
            dataSetDgrid = new DataSet();
            adapterDgrid = new SqlDataAdapter("SELECT Codigo, Descripcion, HEstimadas, TipoTarea FROM TareasGenericas WHERE  Explotacion = 1 AND CodAsig = '" + asignaturasList.SelectedValue + "' AND Codigo NOT IN (Select CodTarea FROM EstudiantesTareas WHERE Email ='" + Session["email"].ToString() + "' )  ", cnn);
            adapterDgrid.Fill(dataSetDgrid, "Tareas");
            dataTableDgrid = dataSetDgrid.Tables["Tareas"];

            table.DataSource = dataTableDgrid;
            table.DataBind();
            if (dataTableDgrid.Rows.Count == 0)
            {
                Label7.Text = "NO HAY TAREAS";
            }
        }
Exemple #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.IsPostBack)
     {
         cnn     = ln.getConection();
         dataSet = new DataSet();
         adapter = new SqlDataAdapter("SELECT * FROM EstudiantesTareas ", cnn);
         SqlCommandBuilder cmdbuilder = new SqlCommandBuilder(adapter);
         adapter.Fill(dataSet, "Tareas");
         table                = dataSet.Tables["Tareas"];
         view                 = new DataView(table);
         view.RowFilter       = "Email ='" + Session["email"].ToString() + "'";
         GridView1.DataSource = view;
         GridView1.DataBind();
         Session["datos"]   = dataSet;
         Session["adapter"] = adapter;
     }
     else
     {
         dataSet         = (DataSet)Session["datos"];
         Button1.Enabled = false;
     }
     TextBox1.Text = Session["email"].ToString();
     TextBox2.Text = Request["tarea"];
     TextBox4.Text = ln.getHorasEstimadas(Request["tarea"]).ToString();
 }
Exemple #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.IsPostBack)
     {
         cnn     = ln.getConection();
         dataSet = new DataSet();
         adapter = new SqlDataAdapter("SELECT * FROM TareasGenericas ", cnn);
         SqlCommandBuilder cmdbuilder = new SqlCommandBuilder(adapter);
         adapter.Fill(dataSet, "Tareas");
         table              = dataSet.Tables["Tareas"];
         Session["datos"]   = dataSet;
         Session["adapter"] = adapter;
     }
     else
     {
         dataSet = (DataSet)Session["datos"];
     }
 }