Exemplo n.º 1
0
        async Task <ObservableCollection <Faci> > GetSpeakers()
        {
            ObservableCollection <Faci> speakers = new ObservableCollection <Faci>();

            try
            {
                Loader.IsVisible = true;
                Loader.IsRunning = true;

                var service = new AzureService();
                var items   = await service.GetFacis();

                speakers.Clear();
                foreach (var item in items)
                {
                    speakers.Add(item);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine("Error: " + ex);
                await Application.Current.MainPage.DisplayAlert("Error!", ex.Message, "OK");
            }
            finally
            {
                Loader.IsVisible = false;
                Loader.IsRunning = false;
            }

            return(speakers);
        }
Exemplo n.º 2
0
 //Add a New User
 async Task AddUser()
 {
     try
     {
         Loader.IsVisible = true;
         Loader.IsRunning = true;
         var service = new AzureService();
         await service.AddFaci(Faci);
     }
     catch (Exception ex)
     {
         await Application.Current.MainPage.DisplayAlert("Error", ex.Message, "OK");
     }
     finally
     {
         Loader.IsVisible = false;
         Loader.IsRunning = false;
     }
 }