comparison Agendas/trunk/src/Agendas.Web/Controllers/EventoController.cs @ 155:23aaf98b8377

Generalizando editores en EditorDefault basando los textos en recursos
author Nelo@Guinea.neluz.int
date Wed, 03 Aug 2011 09:38:23 -0300
parents e6e6bfb1da9e
children 557c386fcecc
comparison
equal deleted inserted replaced
154:2233039ac2eb 155:23aaf98b8377
37 } 37 }
38 38
39 [Authorize] 39 [Authorize]
40 public ActionResult Nuevo() 40 public ActionResult Nuevo()
41 { 41 {
42 var eventoModel = new EventoNewModel {Fecha = DateTime.Now}; 42 var model = new EventoNewModel {Fecha = DateTime.Now};
43 return View(eventoModel); 43 return View("Defaulteditor", model);
44 } 44 }
45 45
46 [HttpPost] 46 [HttpPost]
47 [Authorize] 47 [Authorize]
48 public ActionResult Nuevo(EventoNewModel model) 48 public ActionResult Nuevo(EventoNewModel model)
58 this.AddNotification("Datos guardados"); 58 this.AddNotification("Datos guardados");
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(model); 63 return View("Defaulteditor", model);
64 } 64 }
65 65
66 [Authorize] 66 [Authorize]
67 public ActionResult Confirmar(string id) 67 public ActionResult Confirmar(string id)
68 { 68 {
95 Titulo = evento.Titulo, 95 Titulo = evento.Titulo,
96 Ponente = evento.Ponente != null ? evento.Ponente.Id : Guid.Empty, 96 Ponente = evento.Ponente != null ? evento.Ponente.Id : Guid.Empty,
97 Fecha = evento.Fecha, 97 Fecha = evento.Fecha,
98 UrlInvitacion = evento.UrlInvitacion 98 UrlInvitacion = evento.UrlInvitacion
99 }; 99 };
100 return View(model); 100 return View("Defaulteditor", model);
101 } 101 }
102 102
103 [HttpPost] 103 [HttpPost]
104 [Authorize] 104 [Authorize]
105 public ActionResult Modificar(EventoEditModel model) 105 public ActionResult Modificar(EventoEditModel model)
114 this.AddNotification("datos guardados"); 114 this.AddNotification("datos guardados");
115 return RedirectToAction("Index"); 115 return RedirectToAction("Index");
116 } 116 }
117 ModelState.AddModelError("error", r.ToString()); 117 ModelState.AddModelError("error", r.ToString());
118 } 118 }
119 return View(model); 119 return View("Defaulteditor", model);
120 } 120 }
121 121
122 [Authorize] 122 [Authorize]
123 public ActionResult Agendar(string id) 123 public ActionResult Agendar(string id)
124 { 124 {
131 Titulo = evento.Titulo, 131 Titulo = evento.Titulo,
132 Ponente = evento.Ponente != null ? evento.Ponente.Id : Guid.Empty, 132 Ponente = evento.Ponente != null ? evento.Ponente.Id : Guid.Empty,
133 Fecha = evento.Fecha, 133 Fecha = evento.Fecha,
134 UrlInvitacion = evento.UrlInvitacion 134 UrlInvitacion = evento.UrlInvitacion
135 }; 135 };
136 return View(model); 136 return View("Defaulteditor", model);
137 } 137 }
138 138
139 [HttpPost] 139 [HttpPost]
140 [Authorize] 140 [Authorize]
141 public ActionResult Agendar(EventoAgendarModel model) 141 public ActionResult Agendar(EventoAgendarModel model)
150 this.AddNotification("evento agendado"); 150 this.AddNotification("evento agendado");
151 return RedirectToAction("Index"); 151 return RedirectToAction("Index");
152 } 152 }
153 ModelState.AddModelError("error", r.ToString()); 153 ModelState.AddModelError("error", r.ToString());
154 } 154 }
155 return View(model); 155 return View("Defaulteditor", model);
156 } 156 }
157 157
158 [Authorize] 158 [Authorize]
159 public ActionResult Proponer() 159 public ActionResult Proponer()
160 { 160 {
161 return View(new PropuestaNewModel()); 161 var model = new PropuestaNewModel();
162 return View("Defaulteditor", model);
162 } 163 }
163 164
164 [HttpPost] 165 [HttpPost]
165 [Authorize] 166 [Authorize]
166 public ActionResult Proponer(PropuestaNewModel model) 167 public ActionResult Proponer(PropuestaNewModel model)
172 var r = agenda.Proponer(model.Titulo, model.Ponente, model.UrlInvitacion, (TipoEvento)model.TipoEvento); 173 var r = agenda.Proponer(model.Titulo, model.Ponente, model.UrlInvitacion, (TipoEvento)model.TipoEvento);
173 if (r.Succeful) 174 if (r.Succeful)
174 return RedirectToAction("Index"); 175 return RedirectToAction("Index");
175 ModelState.AddModelError("error", r.ToString()); 176 ModelState.AddModelError("error", r.ToString());
176 } 177 }
177 return View(model); 178 return View("Defaulteditor", model);
178 } 179 }
179 180
180 [Authorize] 181 [Authorize]
181 public ActionResult Cancelar(string id) 182 public ActionResult Cancelar(string id)
182 { 183 {