annotate Agendas/trunk/src/Agendas.Web/Controllers/PatrocinadorController.cs @ 284:79942e030118

#123: Patrocinadores de las vans: Se verifica que para publicar una Van, debe tener al menos un Patrocinador.
author juanjose.montesdeocaarbos
date Wed, 28 Dec 2011 09:35:27 -0300
parents 1e889a2e45c5
children 8c742d5ccf67
rev   line source
275
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
1 using System;
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
2 using System.Collections.Generic;
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
3 using System.IO;
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
4 using System.Linq;
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
5 using System.Web;
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
6 using System.Web.Mvc;
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
7 using AltNetHispano.Agendas.Domain;
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
8 using AltNetHispano.Agendas.Factories;
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
9 using AltNetHispano.Agendas.Web.Models;
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
10 using AltNetHispano.Agendas.Web.Services;
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
11
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
12
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
13 namespace AltNetHispano.Agendas.Web.Controllers
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
14 {
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
15 public class PatrocinadorController : Controller
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
16 {
278
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
17 private HttpServerUtilityBase _server;
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
18
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
19 public HttpServerUtilityBase HttpServer
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
20 {
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
21 get
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
22 {
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
23 if (_server == null)
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
24 {
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
25 var httpServer = HttpContext.Server;
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
26 _server = httpServer;
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
27 }
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
28
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
29 return _server;
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
30 }
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
31 }
275
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
32
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
33 public PatrocinadorController()
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
34 {
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
35 }
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
36
278
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
37 public PatrocinadorController(HttpServerUtilityBase server)
275
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
38 {
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
39 _server = server;
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
40 }
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
41
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
42 public ActionResult GetLogo(string id)
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
43 {
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
44 var patrocinadores = AgendaFactory.GetPatrocinadorRepository();
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
45
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
46 var patrocinador = patrocinadores.Get(new Guid(id));
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
47
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
48 return File(patrocinador.Logo, "image/jpg");
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
49 }
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
50
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
51 public ActionResult Index()
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
52 {
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
53 var patrocinadores = AgendaFactory.GetPatrocinadorRepository();
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
54
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
55 var model = new PatrocinadorIndexModel
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
56 {
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
57 Items = from p in patrocinadores.GetAll()
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
58 select new PatrocinadorDto
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
59 {
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
60 Id = p.Id,
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
61 Nombre = p.Nombre
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
62 }
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
63 };
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
64
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
65 return View(model);
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
66 }
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
67
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
68 [CustomAuthorize(Roles = Roles.Administrador)]
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
69 public ActionResult Nuevo()
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
70 {
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
71 var model = new PatrocinadorNewModel();
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
72 return View("DefaultEditor", model);
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
73 }
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
74
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
75 [HttpPost]
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
76 [CustomAuthorize(Roles = Roles.Administrador)]
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
77 public ActionResult Nuevo(PatrocinadorNewModel model)
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
78 {
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
79 if (ModelState.IsValid)
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
80 {
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
81 var patrocinadores = AgendaFactory.GetPatrocinadorRepository();
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
82
278
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
83 if (patrocinadores.GetByNombre(model.Nombre) == null)
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
84 {
279
1e889a2e45c5 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 278
diff changeset
85 var tempLogoFile = Path.Combine(HttpServer.MapPath("~/App_Data"),
1e889a2e45c5 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 278
diff changeset
86 model.Nombre +
1e889a2e45c5 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 278
diff changeset
87 model.Logo.FileName.Substring(model.Logo.FileName.LastIndexOf(".")));
1e889a2e45c5 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 278
diff changeset
88 model.Logo.SaveAs(tempLogoFile);
278
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
89 var patrocinador = new Patrocinador(model.Nombre);
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
90 patrocinador.LoadLogo(tempLogoFile);
275
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
91
278
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
92 patrocinadores.Save(patrocinador);
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
93
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
94 return RedirectToAction("Index");
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
95 }
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
96 this.AddError("El patrocinador ya existe.");
275
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
97 }
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
98
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
99 return View("DefaultEditor", model);
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
100 }
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
101
278
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
102 [CustomAuthorize(Roles = Roles.Administrador)]
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
103 public ActionResult Modificar(string id)
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
104 {
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
105 var patrocinadores = AgendaFactory.GetPatrocinadorRepository();
275
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
106
278
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
107 var patrocinador = patrocinadores.GetById(id);
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
108 if (patrocinador == null)
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
109 {
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
110 this.AddError("No se encontró el patrocinador que intenta modificar");
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
111 return RedirectToAction("Index");
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
112 }
279
1e889a2e45c5 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 278
diff changeset
113 var model = new PatrocinadorEditModel
1e889a2e45c5 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 278
diff changeset
114 {
1e889a2e45c5 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 278
diff changeset
115 Id = new Guid(id).ToString(),
1e889a2e45c5 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 278
diff changeset
116 Nombre = patrocinador.Nombre
1e889a2e45c5 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 278
diff changeset
117 };
278
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
118 return View("DefaultEditor", model);
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
119 }
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
120
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
121 [HttpPost]
275
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
122 [CustomAuthorize(Roles = Roles.Administrador)]
278
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
123 public ActionResult Modificar(PatrocinadorEditModel model)
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
124 {
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
125 if (ModelState.IsValid)
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
126 {
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
127 var patrocinadores = AgendaFactory.GetPatrocinadorRepository();
279
1e889a2e45c5 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 278
diff changeset
128 var patrocinador = patrocinadores.GetById(model.Id);
1e889a2e45c5 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 278
diff changeset
129 if (patrocinador != null)
278
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
130 {
279
1e889a2e45c5 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 278
diff changeset
131 var tempLogoFile = Path.Combine(HttpServer.MapPath("~/App_Data"),
1e889a2e45c5 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 278
diff changeset
132 model.Nombre +
1e889a2e45c5 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 278
diff changeset
133 model.Logo.FileName.Substring(model.Logo.FileName.LastIndexOf(".")));
1e889a2e45c5 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 278
diff changeset
134 model.Logo.SaveAs(tempLogoFile);
1e889a2e45c5 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 278
diff changeset
135 patrocinador.Nombre = model.Nombre;
278
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
136 patrocinador.LoadLogo(tempLogoFile);
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
137
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
138 patrocinadores.Save(patrocinador);
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
139
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
140 return RedirectToAction("Index");
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
141 }
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
142 this.AddError("No se encuentra el patrocinador.");
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
143 }
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
144 return View("DefaultEditor", model);
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 275
diff changeset
145 }
275
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
146
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
147 [CustomAuthorize(Roles = Roles.Administrador)]
279
1e889a2e45c5 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 278
diff changeset
148 public ActionResult Eliminar(string id)
275
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
149 {
279
1e889a2e45c5 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 278
diff changeset
150 if (!string.IsNullOrWhiteSpace(id))
1e889a2e45c5 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 278
diff changeset
151 {
1e889a2e45c5 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 278
diff changeset
152 var patrocinadores = AgendaFactory.GetPatrocinadorRepository();
1e889a2e45c5 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 278
diff changeset
153 var patrocinador = patrocinadores.GetById(id);
1e889a2e45c5 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 278
diff changeset
154
1e889a2e45c5 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 278
diff changeset
155 patrocinadores.Delete(patrocinador);
1e889a2e45c5 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 278
diff changeset
156 }
1e889a2e45c5 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 278
diff changeset
157 return RedirectToAction("Index");
1e889a2e45c5 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 278
diff changeset
158 }
275
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
159
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
160 }
bf993f99cee3 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
diff changeset
161 }