annotate Agendas/trunk/src/Agendas.Web/Controllers/HistoricoController.cs @ 119:8fa58a79656a

Historico
author Nelo@Kenia.neluz.int
date Wed, 22 Jun 2011 09:49:07 -0300
parents
children c99636fbdc5f
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,
8fa58a79656a Historico
Nelo@Kenia.neluz.int
parents:
diff changeset
24 Ponente = e.Ponente.Nombre
8fa58a79656a Historico
Nelo@Kenia.neluz.int
parents:
diff changeset
25 }
8fa58a79656a Historico
Nelo@Kenia.neluz.int
parents:
diff changeset
26 };
8fa58a79656a Historico
Nelo@Kenia.neluz.int
parents:
diff changeset
27 return View(model);
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 }