Ejemplo n.º 1
0
        public async Task Load()
        {
            try
            {
                IsAsynchronousOperationInProgress = true;
                var clientId = Client.Id;
                var clientDetailsResponse =
                    await restService.Execute <IClientApi, ClientDetails>
                        (api => api.GetClientDetails(clientId, default(CancellationToken)));

                if (clientDetailsResponse.IsSuccess)
                {
                    Properties = clientDetailsResponse.Results.Properties;
                }
                else
                {
                    MessengingHelper.RequestToast(this, clientDetailsResponse.FormattedErrorMessages);
                }
            }
            catch (Exception e)
            {
                MessengingHelper.RequestToast(this, e);
            } finally {
                IsAsynchronousOperationInProgress = false;
            }
        }
Ejemplo n.º 2
0
        public async Task Load()
        {
            try
            {
                IsAsynchronousOperationInProgress = true;

                var getClientsResponse =
                    await restService.Execute <IClientApi, IEnumerable <Client> >(api => api.GetClients(default(System.Threading.CancellationToken)));

                if (!getClientsResponse.IsSuccess)
                {
                    MessengingHelper.RequestToast(this, getClientsResponse.FormattedErrorMessages);
                    return;
                }

                foreach (var item in getClientsResponse.Results)
                {
                    item.ImagePath = item.ImagePath + "#" + Guid.NewGuid().ToString("N"); // prevent caching of image
                    Clients.Add(item);
                }
            }
            catch (Exception e)
            {
                MessengingHelper.RequestToast(this, e);
            }
            finally
            {
                IsAsynchronousOperationInProgress = false;
            }
        }