view 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
line wrap: on
line source

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,
                                                    Numero = e.NumeroOrden.ToString(),
                                                    Tipo = e.Tipo.ToString(),
                                                    Duracion = "0:00" //TODO: e.GetEvento()
			            		               	}
			            	};
			return View(model);
		}
	}
}