From ecfe04e1b8c00011b3386b8e5e6f7d5198d373cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Cort=C3=A9s?= Date: Thu, 12 Dec 2019 14:48:02 -0300 Subject: [PATCH] Listado de participantes --- Universidad/base_page.master | 2 +- Universidad/listar.aspx | 12 +++++++++++ Universidad/listar.aspx.cs | 41 ++++++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 Universidad/listar.aspx create mode 100644 Universidad/listar.aspx.cs diff --git a/Universidad/base_page.master b/Universidad/base_page.master index 9554732..f62ccfc 100644 --- a/Universidad/base_page.master +++ b/Universidad/base_page.master @@ -22,7 +22,7 @@ diff --git a/Universidad/listar.aspx b/Universidad/listar.aspx new file mode 100644 index 0000000..3b02b24 --- /dev/null +++ b/Universidad/listar.aspx @@ -0,0 +1,12 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/base_page.master" AutoEventWireup="true" CodeFile="listar.aspx.cs" Inherits="listar" %> + + + Listar Participantes + + +

Participantes

+ +
+ + + diff --git a/Universidad/listar.aspx.cs b/Universidad/listar.aspx.cs new file mode 100644 index 0000000..a05db69 --- /dev/null +++ b/Universidad/listar.aspx.cs @@ -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"; + } + + } +} \ No newline at end of file