private async Task LoadDatas()
        {
            ThemeNombresModel model = new ThemeNombresModel();

            model.date   = date;
            model.nom    = nom;
            model.prenom = prenom;
            var response = await AstrologieServiceHttp.GetNombres(model);

            switch (response.StatusCode)
            {
            case HttpStatusCode.OK:
                string content = await response.Content.ReadAsStringAsync();

                //data = JsonConvert.DeserializeObject<ImportJson>(content);
                contentHtml = content;
                swLoaded    = true;
                break;

            default:
                MatToaster.Add("Impossible de recevoir les données du serveur", MatToastType.Danger, "Erreur http " + response.StatusCode, "danger");
                NavigationManager.NavigateTo("/");
                break;
            }
        }
Esempio n. 2
0
        private async Task LoadDatas()
        {
            var response = await AstrologieServiceHttp.GetThemeAstral(model);

            switch (response.StatusCode)
            {
            case HttpStatusCode.OK:
                string content = await response.Content.ReadAsStringAsync();

                data     = JsonConvert.DeserializeObject <ImportJson>(content);
                swLoaded = true;
                swLock   = true;
                break;

            default:
                MatToaster.Add("Impossible de recevoir les données du serveur", MatToastType.Danger, "Erreur http " + response.StatusCode, "danger");
                NavigationManager.NavigateTo("/");
                break;
            }
        }
Esempio n. 3
0
        private async void SearchCity()
        {
            swSearch = false;
            var response = await CityServiceHttp.GetCitys(_citySearch);

            switch (response.StatusCode)
            {
            case HttpStatusCode.OK:
                string content = await response.Content.ReadAsStringAsync();

                if (content != "[]")
                {
                    var data_city_filter = JsonConvert.DeserializeObject <CityFilter>(content);
                    var data_return      = new List <CityWithFlag>();
                    if (data_city_filter.filter != null)
                    {
                        foreach (var d in data_city_filter.filter)
                        {
                            swSearch = true;
                            data_return.Add(new CityWithFlag(d.id, d.name, d.lat, d.lng, d.country, ""));
                        }
                    }
                    search = data_return;
                }
                else
                {
                    search    = new List <CityWithFlag>();
                    model.lat = "46.20222";
                    model.lng = "6.14569";
                }
                StateHasChanged();
                break;

            default:
                MatToaster.Add("Impossible de recevoir les données des villes du serveur", MatToastType.Danger, "Erreur http " + response.StatusCode, "danger");
                NavigationManager.NavigateTo("/");
                search = null;
                StateHasChanged();
                break;
            }
        }