Esempio n. 1
0
        private async void SaveDataAsync()
        {
            // Confirm session is still active
            if (sessionData.IsSessionTimedOut)
            {
                _ = await dialogCoordinator.ShowMessageAsync(this, "Alert!", "Your RPD session has expired please log in again.", MessageDialogStyle.Affirmative);

                ReturnToLogin();
                return;
            }

            // Check user hasn't pasted in any non-numeric characters
            if (WorkflowID.IsNotNumeric())
            {
                _ = await dialogCoordinator.ShowMessageAsync(this, "Alert!", "Non-numeric characters entered in run number", MessageDialogStyle.Affirmative);

                return;
            }

            HalFileInfo   info   = new HalFileInfo(SelectedSite, WorkflowID);
            CommandResult result = submitHalFile.Execute(info);

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

                return;
            }

            // Display success dialog
            _ = await dialogCoordinator.ShowMessageAsync(this, "Information!", info.ToString(), MessageDialogStyle.Affirmative);

            // Update the session timeout
            sessionData.UpdateTimeStamp();

            // Clear data
            SelectedSite = null;
            WorkflowID   = null;
        }
Esempio n. 2
0
 public CommandResult Execute(HalFileInfo data) => new CommandResult();