public async Task <IActionResult> Index() { List <Administrativo> items = new List <Administrativo>(); try { var token = _session.GetString("Token"); if (Seguridad.validarUsuarioAdministrativo(token)) { items = await _controladoraUsuarios.getAdministrativos(); return(View(items)); } else { return(RedirectToAction("Login", "Account")); } } catch (MensajeException msg) { TempData["Error"] = msg.Message; return(RedirectToAction("Index", "Home")); } catch (Exception) { TempData["Error"] = "Ha ocurrido un error inesperado, vuelva a intentarlo mas tarde"; return(RedirectToAction("Index", "Home")); } }