public ActionResult Borrar(string nombreIndicador = null) { RefreshUserID(); if (nombreIndicador != null) { Indicador.Get(nombreIndicador).Borrar(); TempData["Info"] = "Se borró exitosamente al indicador de nombre \"" + nombreIndicador + '"'; return(RedirectToAction("Menú", "Indicadores")); } ViewBag.NombresIndicadores = Indicador.GetNombres(usuarioID); return(View()); }
public ActionResult Modificar(string nombreIndicador = null, string fórmula = null) { RefreshUserID(); ViewBag.NombresIndicadores = Indicador.GetNombres(usuarioID); ViewBag.NombreIndicador = ViewBag.Fórmula = ""; if (nombreIndicador != null) { ViewBag.NombreIndicador = nombreIndicador; Indicador i = Indicador.Get(nombreIndicador); ViewBag.Fórmula = i.Fórmula; if (fórmula != null) { i.Fórmula = fórmula; i.Save(); TempData["Info"] = "Se modificó exitosamente al indicador de nombre \"" + nombreIndicador + '"'; return(RedirectToAction("Menú", "Indicadores")); } } return(View()); }
public ActionResult Aplicar(string nombreIndicador = null, string nombreEmpresa = null, int período = 0, bool esComparativo = false, bool esHistórico = false) { RefreshUserID(); ViewBag.NombreIndicador = nombreIndicador; ViewBag.NombresIndicadores = Indicador.GetNombres(usuarioID); ViewBag.NombreEmpresa = nombreEmpresa; ViewBag.NombresEmpresas = Empresa.GetNombres(); ViewBag.Período = período; ViewBag.Períodos = Empresa.GetPeríodos(); filas = new List <Tuple <string, int, string> >(); if (nombreIndicador != null) { Indicador i = Indicador.Get(nombreIndicador); if (i != null) { if (esComparativo) { foreach (Empresa e in Empresa.GetEmpresas()) { AgregarTuplas(i, e, período, esHistórico); } } else if (nombreEmpresa != null) { Empresa e = Empresa.Get(nombreEmpresa); if (e != null && período != 0) { AgregarTuplas(i, e, período, esHistórico); } } } } if (filas.Count > 0) { ViewBag.Filas = filas; } return(View()); }