Mercurial > altnet-hispano
diff Agendas/trunk/src/Agendas.Web/Controllers/EventoController.cs @ 27:29b8a8893ba3
Mejoras menores en UI
author | nelo@MTEySS.neluz.int |
---|---|
date | Tue, 15 Mar 2011 09:14:52 -0300 |
parents | 71b02443450a |
children | 475be11edf56 |
line wrap: on
line diff
--- a/Agendas/trunk/src/Agendas.Web/Controllers/EventoController.cs Tue Mar 15 08:45:00 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Web/Controllers/EventoController.cs Tue Mar 15 09:14:52 2011 -0300 @@ -11,19 +11,15 @@ { public ActionResult Index() { - var model = GetIndexModel(); - return View(model); - } + var agenda = AgendaFactory.GetAgenda(); - private static EventoIndexModel GetIndexModel() - { - var agenda = AgendaFactory.GetAgenda(); - - return new EventoIndexModel - { - ProximosEventos = from e in agenda.GetEventosPublicados() - select new EventoDto {Id = e.Id.ToString(), Titulo = e.Titulo} - }; + var model = new EventoIndexModel + { + ProximosEventos = from e in agenda.GetEventosPublicados() + select new EventoDto { Id = e.Id.ToString(), Titulo = e.Titulo } + }; + + return View(model); } [Authorize] @@ -44,7 +40,7 @@ { agenda.Publicar(model.Titulo, model.Ponente, model.Fecha); - return View("Index", GetIndexModel()); + return RedirectToAction("Index"); } catch (ValidationException ex) { @@ -86,7 +82,7 @@ { agenda.ModificarEvento(new Guid(model.Id), model.Titulo, model.Ponente, model.Fecha); - return View("Index", GetIndexModel()); + return RedirectToAction("Index"); } catch (ValidationException ex) {