Esempio n. 1
0
        private ExistenceVerification parseJson(string json)
        {
            ExistenceVerification existence = new ExistenceVerification();

            try
            {
                existence = JsonConvert.DeserializeObject <ExistenceVerification>(json);
            }
            catch
            {
                this.ShowToast("No se pudo leer el JSON de respuesta de verificacion de equipo");
            }
            return(existence);
        }
Esempio n. 2
0
        private async Task <bool> VerifyEquipmentExistence()
        {
            var client = new HttpClient();

            client.BaseAddress = new Uri(Constants.URL_VerifyExistence);

            HttpResponseMessage response = await client.GetAsync($"{Constants.Endpoints_ExistenceVerification}?name={codigoDeEquipo}");

            if (response.IsSuccessStatusCode)
            {
                var result = await response.Content.ReadAsStringAsync();

                existenceVerification = parseJson(result);
            }
            else
            {
                return(false);
            }
            return(true);
        }