Listado de participantes

This commit is contained in:
Daniel Cortés
2019-12-12 14:48:02 -03:00
parent 46f0abf143
commit ecfe04e1b8
3 changed files with 54 additions and 1 deletions

View 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";
}
}
}