comparison Agendas/trunk/src/Agendas.Web/Controllers/PersonaController.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 a2b14da4902f
children f17252543cbf
comparison
equal deleted inserted replaced
154:2233039ac2eb 155:23aaf98b8377
17 return View(model); 17 return View(model);
18 } 18 }
19 19
20 public ActionResult Nueva() 20 public ActionResult Nueva()
21 { 21 {
22 return View(); 22 var model = new PersonaNewModel();
23 return View("Defaulteditor", model);
23 } 24 }
24 25
25 [HttpPost] 26 [HttpPost]
26 public ActionResult Nueva(PersonaNewModel model) 27 public ActionResult Nueva(PersonaNewModel model)
27 { 28 {
36 } 37 }
37 else 38 else
38 this.AddError(r.Message); 39 this.AddError(r.Message);
39 } 40 }
40 41
41 return View(model); 42 return View("Defaulteditor", model);
42 } 43 }
43 44
44 public ActionResult Modificar(string id) 45 public ActionResult Modificar(string id)
45 { 46 {
46 var personas = AgendaFactory.GetPersonaService(); 47 var personas = AgendaFactory.GetPersonaService();
52 return RedirectToAction("Index"); 53 return RedirectToAction("Index");
53 } 54 }
54 55
55 var model = new PersonaEditModel 56 var model = new PersonaEditModel
56 {Id = persona.Id.ToString(), Nombre = persona.Nombre, Twitter = persona.Twitter, EMail = persona.Mail}; 57 {Id = persona.Id.ToString(), Nombre = persona.Nombre, Twitter = persona.Twitter, EMail = persona.Mail};
57 58
58 return View(model); 59 return View("Defaulteditor", model);
59 } 60 }
60 61
61 [HttpPost] 62 [HttpPost]
62 public ActionResult Modificar(PersonaEditModel model) 63 public ActionResult Modificar(PersonaEditModel model)
63 { 64 {
72 } 73 }
73 else 74 else
74 this.AddError(r.Message); 75 this.AddError(r.Message);
75 } 76 }
76 77
77 return View(model); 78 return View("Defaulteditor", model);
78 } 79 }
79 } 80 }
80 } 81 }