Пример #1
0
        public async Task <IActionResult> GridSessao()
        {
            try
            {
                ClientService client = new ClientService();

                DadosSessaoViewModel resultado = await client.GetAsync <DadosSessaoViewModel>(_config["UrlApi"] + "/Sessao/listar-sessao/"
                                                                                              , User.Claims.Where(s => s.Type == "AccessToken").Select(s => s.Value).First(), null);

                return(PartialView("_GridSessao", resultado.Resultado));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
Пример #2
0
        public async Task <IActionResult> Index()
        {
            try
            {
                ClientService client = new ClientService();

                DadosSessaoViewModel resultado = await client.GetAsync <DadosSessaoViewModel>(_config["UrlApi"] + "/Sessao/listar-sessao/",
                                                                                              User.Claims.Where(s => s.Type == "AccessToken").Select(s => s.Value).First(), null);

                return(View(resultado.Resultado));
            }
            catch (Exception ex)
            {
                return(Json(new JsonModel()
                {
                    success = false, message = ex.Message
                }));
            }
        }