annotate Agendas/trunk/src/Agendas.Web/Controllers/HistoricoController.cs @ 161:c1062de96845

Al publicar una agenda el nroOrden debe ser mayor a cero y urlWiki no vacio.
author juanjose.montesdeocaarbos
date Fri, 05 Aug 2011 21:54:43 -0300
parents c99636fbdc5f
children 4e4b758ab744
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
8fa58a79656a Historico
Nelo@Kenia.neluz.int
parents:
diff changeset
14 var model = new HistoricoIndexModel
8fa58a79656a Historico
Nelo@Kenia.neluz.int
parents:
diff changeset
15 {
8fa58a79656a Historico
Nelo@Kenia.neluz.int
parents:
diff changeset
16 Items = from e in agenda.GetHistorico()
8fa58a79656a Historico
Nelo@Kenia.neluz.int
parents:
diff changeset
17 orderby e.Fecha
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,
8fa58a79656a Historico
Nelo@Kenia.neluz.int
parents:
diff changeset
22 Fecha = e.Fecha.HasValue ? e.Fecha.Value.ToShortDateString() : string.Empty,
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(),
161
c1062de96845 Al publicar una agenda el nroOrden debe ser mayor a cero y urlWiki no vacio.
juanjose.montesdeocaarbos
parents: 148
diff changeset
27 Duracion = "0:00" //TODO: e.GetEvento()
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 }