diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Agendas/trunk/src/Agendas.Web/Controllers/HistoricoController.cs	Wed Jun 22 09:49:07 2011 -0300
@@ -0,0 +1,30 @@
+using System.Linq;
+using System.Web.Mvc;
+using AltNetHispano.Agendas.Factories;
+using AltNetHispano.Agendas.Web.Models;
+
+namespace AltNetHispano.Agendas.Web.Controllers
+{
+	public class HistoricoController : Controller
+	{
+		public ActionResult Index()
+		{
+			var agenda = AgendaFactory.GetAgenda();
+
+			var model = new HistoricoIndexModel
+			            	{
+			            		Items = from e in agenda.GetHistorico()
+			            		        orderby e.Fecha
+			            		        select new HistoricoDto
+			            		               	{
+			            		               		Id = e.Id.ToString(),
+			            		               		Titulo = e.Titulo,
+			            		               		Fecha = e.Fecha.HasValue ? e.Fecha.Value.ToShortDateString() : string.Empty,
+			            		               		Wiki = e.UrlWiki,
+													Ponente = e.Ponente.Nombre
+			            		               	}
+			            	};
+			return View(model);
+		}
+	}
+}
\ No newline at end of file