Mercurial > altnet-hispano
diff Agendas/trunk/src/Agendas.Web/Controllers/EventoController.cs @ 82:c8897b1c6f49
Manejo de excepciones en sitio web
author | nelopauselli |
---|---|
date | Tue, 24 May 2011 19:31:10 -0300 |
parents | 2adf55ea9199 |
children | 24e9488ac152 |
line wrap: on
line diff
--- a/Agendas/trunk/src/Agendas.Web/Controllers/EventoController.cs Tue May 24 19:21:20 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Web/Controllers/EventoController.cs Tue May 24 19:31:10 2011 -0300 @@ -49,22 +49,18 @@ { var agenda = AgendaFactory.GetAgenda(); var evento = agenda.GetEvento(new Guid(id)); - if (evento!=null) - { - var model = new EventoEditModel - { - Id = id, - Titulo = evento.Titulo, - Ponente = evento.Ponente != null ? evento.Ponente.Nombre : string.Empty, - Fecha = evento.Fecha - }; - return View(model); - } - ModelState.AddModelError("error","No se encontrĂ³ el evento que quiere modificar"); - return View(); + + var model = new EventoEditModel + { + Id = id, + Titulo = evento.Titulo, + Ponente = evento.Ponente != null ? evento.Ponente.Nombre : string.Empty, + Fecha = evento.Fecha + }; + return View(model); } - [HttpPost] + [HttpPost] [Authorize] public ActionResult Edit(EventoEditModel model) {