Listado de participantes
This commit is contained in:
41
Universidad/listar.aspx.cs
Normal file
41
Universidad/listar.aspx.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using DAL;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
public partial class listar : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
Entities entities = new Entities();
|
||||
var participantes = from p in entities.Participantes select new {
|
||||
Id = p.id,
|
||||
Nombre = p.nombre,
|
||||
FechaInscripcion = p.fechaInscripcion,
|
||||
PGA = p.pga,
|
||||
Universidad = p.carrera.universidad.nombre,
|
||||
Carrera = p.carrera.nombre,
|
||||
Seminario = p.seminario.nombre
|
||||
};
|
||||
participantes_grid.DataSource = participantes.ToList();
|
||||
participantes_grid.DataBind();
|
||||
}
|
||||
|
||||
protected void ParticipantesRowDataBound(object sender, GridViewRowEventArgs e)
|
||||
{
|
||||
if(e.Row.RowType == DataControlRowType.Header)
|
||||
{
|
||||
e.Row.Cells[0].Text = "#";
|
||||
e.Row.Cells[1].Text = "Nombre";
|
||||
e.Row.Cells[2].Text = "Fecha de Inscripcion";
|
||||
e.Row.Cells[3].Text = "PGA";
|
||||
e.Row.Cells[4].Text = "Universidad";
|
||||
e.Row.Cells[5].Text = "Carrera";
|
||||
e.Row.Cells[6].Text = "Seminario";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user