private async Task LoadAll()
        {
            try
            {
                IsCardBusy        = true;
                IsRequestsBusy    = true;
                IsCardholdersBusy = true;

                await Task.Run(() =>
                {
                    Cards                   = cardService.GetAll();
                    CardRequests            = sCardRequests.GetAll();
                    Cardholders             = cardholderService.GetAll();
                    ReplacementRequests     = cardReplacements.GetAll();
                    PersonalizationRequests = sPersonalization.GetAll();

                    ProcessCards();
                    ProcessCardholders();

                    IsRequestsBusy = false;
                });
            }
            catch (Exception ex)
            {
                toaster.ShowErrorToast(Toaster.ErrorTitle, ex.Message);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// This method Loads all the objects to display in the List
 /// </summary>
 protected virtual async Task LoadAll()
 {
     try
     {
         await RunMethodAsync(() =>
         {
             var allrequests = service.GetAll() ?? new List <T>();
             AllObjects      = new ObservableCollection <T>(allrequests);
         }, () => IsBusy);
     }
     catch (Exception e)
     {
         toaster.ShowErrorToast(Toaster.ErrorTitle, e.Message);
     }
 }