示例#1
0
 public ActionResult GetPeriodos()
 {
     PeriodoBL periodoBL = new PeriodoBL();
     var periodos = periodoBL.getPeriodosEnEmpresa(getCurrentUser().IdEmpresa);
     return Json(periodos, JsonRequestBehavior.AllowGet);
 }
示例#2
0
        public ActionResult Periodos(bool inactivos = false)
        {
            if (!this.currentUser()) { return RedirectToAction("Ingresar"); }
            if (!isAdministrator()) { return RedirectToAction("Index"); }
            ViewBag.Title = "Periodos";
            MenuNavBarSelected(8, 1);

            UsuarioDTO currentUser = getCurrentUser();

            PeriodoBL objBL = new PeriodoBL();
            List<PeriodoDTO> listaPeriodos = new List<PeriodoDTO>();
            ViewBag.vbInactivos = inactivos;

            if (currentUser.IdEmpresa > 0)
            {
                if (!inactivos)
                { listaPeriodos = objBL.getPeriodosActivosEnEmpresa(currentUser.IdEmpresa); }
                else
                { listaPeriodos = objBL.getPeriodosEnEmpresa(currentUser.IdEmpresa); }
            }
            return View(listaPeriodos);
        }