annotate Agendas/trunk/src/Agendas.Web/Controllers/HistoricoController.cs @ 225:f23ee59ef1bd

Otros ponentes
author nelopauselli
date Mon, 26 Sep 2011 08:47:01 -0300
parents 85ddae313408
children 11545cc95491
rev   line source
119
8fa58a79656a Historico
Nelo@Kenia.neluz.int
parents:
diff changeset
1 using System.Linq;
8fa58a79656a Historico
Nelo@Kenia.neluz.int
parents:
diff changeset
2 using System.Web.Mvc;
8fa58a79656a Historico
Nelo@Kenia.neluz.int
parents:
diff changeset
3 using AltNetHispano.Agendas.Factories;
8fa58a79656a Historico
Nelo@Kenia.neluz.int
parents:
diff changeset
4 using AltNetHispano.Agendas.Web.Models;
8fa58a79656a Historico
Nelo@Kenia.neluz.int
parents:
diff changeset
5
8fa58a79656a Historico
Nelo@Kenia.neluz.int
parents:
diff changeset
6 namespace AltNetHispano.Agendas.Web.Controllers
8fa58a79656a Historico
Nelo@Kenia.neluz.int
parents:
diff changeset
7 {
8fa58a79656a Historico
Nelo@Kenia.neluz.int
parents:
diff changeset
8 public class HistoricoController : Controller
8fa58a79656a Historico
Nelo@Kenia.neluz.int
parents:
diff changeset
9 {
8fa58a79656a Historico
Nelo@Kenia.neluz.int
parents:
diff changeset
10 public ActionResult Index()
8fa58a79656a Historico
Nelo@Kenia.neluz.int
parents:
diff changeset
11 {
8fa58a79656a Historico
Nelo@Kenia.neluz.int
parents:
diff changeset
12 var agenda = AgendaFactory.GetAgenda();
8fa58a79656a Historico
Nelo@Kenia.neluz.int
parents:
diff changeset
13
215
85ddae313408 Se soluciona ticket #178. Se resuelve ordenar Historico de Eventos solamente por NumeroOrden de forma descendente.
alabra
parents: 185
diff changeset
14 var model = new HistoricoIndexModel
119
8fa58a79656a Historico
Nelo@Kenia.neluz.int
parents:
diff changeset
15 {
215
85ddae313408 Se soluciona ticket #178. Se resuelve ordenar Historico de Eventos solamente por NumeroOrden de forma descendente.
alabra
parents: 185
diff changeset
16 Items = from e in agenda.GetHistorico()
85ddae313408 Se soluciona ticket #178. Se resuelve ordenar Historico de Eventos solamente por NumeroOrden de forma descendente.
alabra
parents: 185
diff changeset
17 orderby e.NumeroOrden descending
119
8fa58a79656a Historico
Nelo@Kenia.neluz.int
parents:
diff changeset
18 select new HistoricoDto
8fa58a79656a Historico
Nelo@Kenia.neluz.int
parents:
diff changeset
19 {
8fa58a79656a Historico
Nelo@Kenia.neluz.int
parents:
diff changeset
20 Id = e.Id.ToString(),
8fa58a79656a Historico
Nelo@Kenia.neluz.int
parents:
diff changeset
21 Titulo = e.Titulo,
185
2d02adb79322 Se agrega fecha de termino de un Evento y se incluye la hora a la fecha de inicio.
alabra
parents: 171
diff changeset
22 Fecha = e.FechaInicio.HasValue ? e.FechaInicio.Value.ToShortDateString() : string.Empty,
119
8fa58a79656a Historico
Nelo@Kenia.neluz.int
parents:
diff changeset
23 Wiki = e.UrlWiki,
148
c99636fbdc5f Ticket 155: Agregar Nro de Orden, Tipo y Duración real en la pantalla de Histórico, similar a como es la página actual en altnethispano.org.
juanjose.montesdeocaarbos
parents: 119
diff changeset
24 Ponente = e.Ponente.Nombre,
c99636fbdc5f Ticket 155: Agregar Nro de Orden, Tipo y Duración real en la pantalla de Histórico, similar a como es la página actual en altnethispano.org.
juanjose.montesdeocaarbos
parents: 119
diff changeset
25 Numero = e.NumeroOrden.ToString(),
c99636fbdc5f Ticket 155: Agregar Nro de Orden, Tipo y Duración real en la pantalla de Histórico, similar a como es la página actual en altnethispano.org.
juanjose.montesdeocaarbos
parents: 119
diff changeset
26 Tipo = e.Tipo.ToString(),
171
4e4b758ab744 Ticket 155: Se carga la Duración correcta, formateada en HH:MM
juanjose.montesdeocaarbos
parents: 161
diff changeset
27 Duracion = e.Duracion.ToString(@"hh\:mm")
119
8fa58a79656a Historico
Nelo@Kenia.neluz.int
parents:
diff changeset
28 }
8fa58a79656a Historico
Nelo@Kenia.neluz.int
parents:
diff changeset
29 };
8fa58a79656a Historico
Nelo@Kenia.neluz.int
parents:
diff changeset
30 return View(model);
8fa58a79656a Historico
Nelo@Kenia.neluz.int
parents:
diff changeset
31 }
8fa58a79656a Historico
Nelo@Kenia.neluz.int
parents:
diff changeset
32 }
8fa58a79656a Historico
Nelo@Kenia.neluz.int
parents:
diff changeset
33 }