Exemple #1
0
        private async void SaveDataAsync()
        {
            if (sessionData.IsSessionTimedOut)
            {
                _ = await dialogCoordinator.ShowMessageAsync(this, "Alert!", "Your RPD session has expired please log in again.", MessageDialogStyle.Affirmative);

                ReturnToLogin();
                return;
            }

            DocumentIdList <String> idList = new DocumentIdList <String>(DocumentIDs);
            CommandResult           result = submitDocumentList.Execute(idList.ToString());

            if (result.IsError)
            {
                // Display error message
                _ = await dialogCoordinator.ShowMessageAsync(this, "Error!", result.ErorrMessage, MessageDialogStyle.Affirmative);

                return;
            }

            // Display success message
            _ = await dialogCoordinator.ShowMessageAsync(this, "Information!", $"Your data was succesfully transmitted to RPD", MessageDialogStyle.Affirmative);

            // Reset session timeout
            sessionData.UpdateTimeStamp();

            // Clear the list
            DocumentIDs.Clear();
        }
        private async void SaveDataAsync()
        {
            if (sessionData.IsSessionTimedOut)
            {
                _ = await dialogCoordinator.ShowMessageAsync(this, "Alert!", "Your RPD session has expired please log in again.", MessageDialogStyle.Affirmative);

                ReturnToLogin();
                return;
            }
            // Calls toString on each Range and separates each group with a newline character
            DocumentIdList <Range> idList = new DocumentIdList <Range>(Ranges);
            CommandResult          result = submitDocumentList.Execute(idList.ToString());

            if (result.IsError)
            {
                // Display error message
                _ = await dialogCoordinator.ShowMessageAsync(this, "Error!", result.ErorrMessage, MessageDialogStyle.Affirmative);

                return;
            }

            // Display success dialog
            _ = await dialogCoordinator.ShowMessageAsync(this, "Information!", $"The following ids were transmitted to RPD:\n{idList.ToString()}", MessageDialogStyle.Affirmative);

            // Reset session timeout
            sessionData.UpdateTimeStamp();

            // Clear list
            Ranges.Clear();

            // Set focus to next textbox
            IsRangeStartFocussed = true;
            IsRangeEndFocussed   = false;
        }