comparison Agendas/trunk/src/Agendas.Web/Controllers/EventoController.cs @ 75:96d7609f2e08

Agendar evento propuesto
author nelopauselli
date Mon, 23 May 2011 20:43:01 -0300
parents bc46e7426c80
children 2adf55ea9199
comparison
equal deleted inserted replaced
74:bc46e7426c80 75:96d7609f2e08
12 { 12 {
13 var agenda = AgendaFactory.GetAgenda(); 13 var agenda = AgendaFactory.GetAgenda();
14 14
15 var model = new EventoIndexModel 15 var model = new EventoIndexModel
16 { 16 {
17 ProximosEventos = from e in agenda.GetEventosPublicados() 17 ProximosEventos = from e in agenda.GetEventosAgendados()
18 select new EventoDto { Id = e.Id.ToString(), Titulo = e.Titulo } 18 select new EventoDto { Id = e.Id.ToString(), Titulo = e.Titulo }
19 }; 19 };
20 20
21 return View(model); 21 return View(model);
22 } 22 }
70 { 70 {
71 if (ModelState.IsValid) 71 if (ModelState.IsValid)
72 { 72 {
73 var agenda = AgendaFactory.GetAgenda(); 73 var agenda = AgendaFactory.GetAgenda();
74 74
75 var r =agenda.ModificarEvento(new Guid(model.Id), model.Titulo, model.Ponente, model.Fecha); 75 var r =agenda.ModificarEvento(new Guid(model.Id), model.Titulo, model.Ponente, model.Fecha.Value , model.UrlInvitacion);
76 if (r.Succeful) 76 if (r.Succeful)
77 return RedirectToAction("Index"); 77 return RedirectToAction("Index");
78 ModelState.AddModelError("error", r.ToString()); 78 ModelState.AddModelError("error", r.ToString());
79 } 79 }
80 return View(model); 80 return View(model);