Ejemplo n.º 1
0
        public async Task <ActionResult> GetPrevisaoTempo(string estadoEscolhido, string municipioEscolhido)
        {
            PrevisaoTempoAtualService service = new PrevisaoTempoAtualService();
            string parametros = service.MontarParametros(estadoEscolhido, municipioEscolhido);

            var retorno = await ApiHelper.GetPrevisaoTempoAtual(parametros);

            if (retorno.Sucesso)
            {
                string painel = RazorUtil.GetTemplate(retorno.Resultado);

                return(Json(new { OK = retorno.Sucesso, stringHtml = painel }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json(new { OK = false, Mensagem = retorno.Mensagem, }, JsonRequestBehavior.AllowGet));
            }
        }