Exemplo n.º 1
0
        async Task SyncHours()
        {
            if (!IsBusy)
            {
                Exception Error = null;

                Hours.Clear();
                try
                {
                    IsBusy = true;
                    var Repository = new Repository();
                    var Items      = await Repository.GetHours();

                    foreach (var Hour in Items)
                    {
                        Hours.Add(Hour.Hour);
                        HoursAvaliable.Add(Hour);
                    }
                }
                catch (Exception ex)
                {
                    Error = ex;
                }
                finally
                {
                    IsBusy = false;
                }
                if (Error != null)
                {
                    await _pageDialogService.DisplayAlertAsync("Erro", Error.Message, "OK");
                }
                return;
            }
        }