Ejemplo n.º 1
0
        public async Task <List <Building> > GetBuildingsAsync(valInfo Id)
        {
            //Buildings = new List<Building>();
            Uri uri  = new Uri(string.Format(Constants.RestUrl1, Id.valString));
            var uri1 = Constants.RestUrl1.ToString() + Id.valString;
            var test = "here now";

            try
            {
                var response = await client.GetAsync(uri1);

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

                    Buildings = JsonConvert.DeserializeObject <List <Building> >(content);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(@"ERROR {0}", ex.Message);
                List <Building> BuildingsError = new List <Building>();
                BuildingsError.Add(new Building()
                {
                    buildingPrimaryName = null, buildingStatus = "NO BUILDINGS"
                });
                return(BuildingsError);
            }
            return(Buildings);
        }
Ejemplo n.º 2
0
        protected async override void OnAppearing()
        {
            base.OnAppearing();

            valInfo input = new valInfo();

            input.valString = "0d5f4879-8290-413d-ab78-2a471813c7be";
            List <Building> FirstCheck = await App.BuildManager.GetTasksAsync(input);

            if (FirstCheck[0].buildingStatus == "NO BUILDINGS")
            {
                listText.IsVisible = true;
                listView.IsVisible = false;
            }
            else
            {
                listText.IsVisible   = false;
                listView.ItemsSource = FirstCheck;//await App.BuildManager.GetTasksAsync(input);
                listView.IsVisible   = true;
            }
            //listView.ItemsSource = await App.BuildManager.GetTasksAsync(input);
            //listView.IsVisible = true;
        }
Ejemplo n.º 3
0
 public Task <List <Building> > GetTasksAsync(valInfo ID)
 {
     return(restService.GetBuildingsAsync(ID));
 }