public ActionResult Votar(Votacion votacion, string ciudad, string fileNameShow) { //seteo ViewBags ViewBag.ciudades = GetCiudadesParaMostrar(); ViewBag.fileNameShow = fileNameShow; if (fileNameShow == "sanata") { ViewBag.image = "sanata.png"; ViewBag.show = "Sanata Stand Up"; ViewBag.color = "#1cadc3"; } else if (fileNameShow == "nicolasdetracy") { ViewBag.image = "nicolasdetracy.png"; ViewBag.show = "Nicolas de Tracy"; ViewBag.color = "brown"; } else if (fileNameShow == "lailaygonzo") { ViewBag.image = "lailaygonzo.png"; ViewBag.show = "Laila y Gonzo"; ViewBag.color = "#b10959"; } else if (fileNameShow == "elinnombrable") { ViewBag.image = "losotros.png"; ViewBag.show = "El Innombrable"; ViewBag.color = "#b10959"; } else if (fileNameShow == "magalitajes") { ViewBag.image = "magalitajes.png"; ViewBag.show = "#LOSOTROS Magalà Tajes"; ViewBag.color = "#9f0f81"; } else if (fileNameShow == "danilachepi") { ViewBag.image = "danilachepi.jpg"; ViewBag.show = "Dani La Chepi"; ViewBag.color = "#9f0f81"; } else if (fileNameShow == "darioorsi") { ViewBag.image = "darioorsi.jpg"; ViewBag.show = "Dario Orsi"; ViewBag.color = "#9f0f81"; } else { ViewBag.mensaje = "Esta url no existe :("; ViewBag.show = ""; ViewBag.image = ""; ViewBag.color = "black"; return(View()); } var ciudadObtenida = GetCiudadByName(ciudad.Split('-')[0].Trim()); if (ciudadObtenida == null) { ViewBag.mensaje = "No pudimos reconocer tu ciudad"; return(View()); } try { var service = new VotacionService(); votacion.Ciudad = ciudadObtenida; votacion.Fecha = DateTime.Now; if (votacion.Notificaciones == null) { votacion.Notificaciones = "off"; } if (votacion.Descuentos == null) { votacion.Descuentos = "off"; } votacion.Ip = Request.UserHostAddress; service.AddVotacion(votacion); return(RedirectToAction("Ranking", new { show = fileNameShow })); } catch (Exception ex) { new LogService().FormatAndSaveLog("Votacion", ex.Message, JsonConvert.SerializeObject(votacion)); var mensaje = ""; if (ex.Message == "voto_ya_registrado_error") { mensaje = "Ya tenemos registrado tu voto!"; } else { mensaje = "No pudimos registrar tu voto. Intentá nuevamente"; } ViewBag.mensaje = mensaje; } return(View()); }