コード例 #1
0
        private async void SelectClient(Client selectedClient)
        {
            // _dialogService.Alert("Downloads are currently not enabled !");


            if (null == selectedClient)
            {
                return;
            }
            IsBusy = true;
            _dialogService.ShowWait($"Downloading,Please wait...");
            RemoteClientDTO remoteData = null;

            try
            {
                remoteData = await _clientSyncService.DownloadClient(Address, selectedClient.Id);
            }
            catch (Exception e)
            {
                _dialogService.Alert($"Could not download! {e.Message}");
            }

            if (null != remoteData)
            {
                SelectedClient = remoteData.Client;
                var encounters = remoteData.Encounters;
                try
                {
                    await _registryService.Download(SelectedClient, encounters);
                }
                catch (Exception e)
                {
                    _dialogService.Alert($"Could not save! {e.Message}");
                }
            }

            _dialogService.HideWait();
            IsBusy = false;
            if (null != remoteData)
            {
                ShowViewModel <DashboardViewModel>(new { id = SelectedClient.Id });
            }
        }
コード例 #2
0
        private async void SelectClient(Client selectedClient)
        {
            if (null == selectedClient)
            {
                return;
            }
            IsBusy = true;
            _dialogService.ShowWait($"Downloading,Please wait...");
            var remoteData = await _clientSyncService.DownloadClient(Address, selectedClient.Id);

            if (null != remoteData)
            {
                SelectedClient = remoteData.Client;
                var encounters = remoteData.Encounters;
                await _registryService.Download(SelectedClient, encounters);
            }
            _dialogService.HideWait();
            IsBusy = false;
            ShowViewModel <DashboardViewModel>(new { id = SelectedClient.Id });
        }