Ejemplo n.º 1
0
        public async Task <IActionResult> Index()
        {
            if (HttpContext.Session.GetString("Admin") == null || HttpContext.Session.GetString("Admin") == String.Empty)
            {
                return(RedirectToAction("Login", "Admin"));
            }

            using (var client = new HttpClient())
            {
                try
                {
                    return(View(await UserVM.GetAllUserAsync(client)));
                }
                catch (Exception)
                {
                    return(BadRequest(Lang.LANG_CONNECTION_PROBLEM));
                }
            }
        }