public async Task <List <DispensadorModelo> > Lista_Dispensadores(UsuarioModelo usuario) { Dispensador = new List <DispensadorModelo>(); try { var gm = new GetMaker(); var url = GlobalSettings.BASE_URL + GlobalSettings.DISPENSADORES_URL; string[] contenido = new string[1]; //contenido[0] = usuario.Id_Empresa.ToString(); string finalurl = gm.Replace(url, contenido); var httpResponse = await client.GetAsync(finalurl); if (httpResponse.IsSuccessStatusCode) { var responseContent = await httpResponse.Content.ReadAsStringAsync(); Dispensador = JsonConvert.DeserializeObject <List <DispensadorModelo> >(responseContent); } } catch (Exception e) { } return(Dispensador); }
public async Task <List <ElementoModelo> > Lista_Elementos(DispensadorModelo dispensador) { Elementos = new List <ElementoModelo>(); try { var gm = new GetMaker(); var url = GlobalSettings.BASE_URL + GlobalSettings.EQUIPOS_DISPENSADOR_URL; string[] contenido = new string[1]; contenido[0] = dispensador.Id_Dispensador.ToString(); string finalurl = gm.Replace(url, contenido); var httpResponse = await client.GetAsync(finalurl); if (httpResponse.IsSuccessStatusCode) { var responseContent = await httpResponse.Content.ReadAsStringAsync(); Elementos = JsonConvert.DeserializeObject <List <ElementoModelo> >(responseContent); } } catch (Exception e) { } return(Elementos); }
public async Task <List <ElementoModelo> > Lista_Equipos_Tipo_Equipo(TipoElementoModelo tipo) { Elementos = new List <ElementoModelo>(); try { var gm = new GetMaker(); var url = GlobalSettings.BASE_URL + GlobalSettings.LISTADO_EQUIPOS_TIPO_EQUIPO; string[] contenido = new string[1]; //contenido[0] = tipo.Id_Tipo_Elemento.ToString(); string finalurl = gm.Replace(url, contenido); var httpResponse = await client.GetAsync(finalurl); if (httpResponse.IsSuccessStatusCode) { var responseContent = await httpResponse.Content.ReadAsStringAsync(); Elementos = JsonConvert.DeserializeObject <List <ElementoModelo> >(responseContent); } } catch (Exception e) { } return(Elementos); }