comparison Agendas/trunk/src/Agendas.Web/Controllers/EventoController.cs @ 167:ea85bd893247

Ajustes menores de UI
author nelopauselli
date Sat, 06 Aug 2011 02:51:07 -0300
parents fae2feae499e
children 5c94b052d838
comparison
equal deleted inserted replaced
166:fae2feae499e 167:ea85bd893247
53 53
54 var r = agenda.Agendar(model.Titulo, model.Ponente, model.Fecha, 54 var r = agenda.Agendar(model.Titulo, model.Ponente, model.Fecha,
55 model.UrlInvitacion, (TipoEvento)model.TipoEvento); 55 model.UrlInvitacion, (TipoEvento)model.TipoEvento);
56 if (r.Succeful) 56 if (r.Succeful)
57 { 57 {
58 this.AddNotification("Datos guardados"); 58 this.AddNotification("Evento creado");
59 return RedirectToAction("Index"); 59 return RedirectToAction("Index");
60 } 60 }
61 ModelState.AddModelError("error", r.ToString()); 61 ModelState.AddModelError("error", r.ToString());
62 } 62 }
63 return View("Defaulteditor", model); 63 return View("Defaulteditor", model);
65 65
66 [Authorize] 66 [Authorize]
67 public ActionResult Confirmar(string id) 67 public ActionResult Confirmar(string id)
68 { 68 {
69 var agenda = AgendaFactory.GetAgenda(); 69 var agenda = AgendaFactory.GetAgenda();
70 agenda.Confirmar(new Guid(id)); 70
71 71 var r = agenda.Confirmar(new Guid(id));
72 this.AddNotification("Evento confirmado"); 72 if (r.Succeful)
73 this.AddNotification("Evento confirmado");
74 else
75 this.AddError("Evento confirmado");
76
73 return RedirectToAction("Index"); 77 return RedirectToAction("Index");
74 } 78 }
75 79
76 [Authorize] 80 [Authorize]
77 public ActionResult Publicar(string id) 81 public ActionResult Publicar(string id)
78 { 82 {
79 var agenda = AgendaFactory.GetAgenda(); 83 var agenda = AgendaFactory.GetAgenda();
80 var evento = agenda.GetEvento(new Guid(id)); 84 var evento = agenda.GetEvento(new Guid(id));
81 85
135 var agenda = AgendaFactory.GetAgenda(); 139 var agenda = AgendaFactory.GetAgenda();
136 140
137 var r = agenda.ModificarEvento(new Guid(model.Id), model.Titulo, model.Ponente, model.Fecha.Value, model.UrlInvitacion); 141 var r = agenda.ModificarEvento(new Guid(model.Id), model.Titulo, model.Ponente, model.Fecha.Value, model.UrlInvitacion);
138 if (r.Succeful) 142 if (r.Succeful)
139 { 143 {
140 this.AddNotification("datos guardados"); 144 this.AddNotification("evento modificado");
141 return RedirectToAction("Index"); 145 return RedirectToAction("Index");
142 } 146 }
143 ModelState.AddModelError("error", r.ToString()); 147 ModelState.AddModelError("error", r.ToString());
144 } 148 }
145 return View("Defaulteditor", model); 149 return View("Defaulteditor", model);
196 { 200 {
197 var agenda = AgendaFactory.GetAgenda(); 201 var agenda = AgendaFactory.GetAgenda();
198 202
199 var r = agenda.Proponer(model.Titulo, model.Ponente, model.UrlInvitacion, (TipoEvento)model.TipoEvento); 203 var r = agenda.Proponer(model.Titulo, model.Ponente, model.UrlInvitacion, (TipoEvento)model.TipoEvento);
200 if (r.Succeful) 204 if (r.Succeful)
201 return RedirectToAction("Index"); 205 {
206 this.AddNotification("Evento propuesto");
207 return RedirectToAction("Index");
208 }
202 ModelState.AddModelError("error", r.ToString()); 209 ModelState.AddModelError("error", r.ToString());
203 } 210 }
204 return View("Defaulteditor", model); 211 return View("Defaulteditor", model);
205 } 212 }
206 213