コード例 #1
0
        private void CalculateNextRunsButton_Click(object sender, EventArgs e)
        {
            var scheduleTimes = new List <DateTimeOffset>();

            var time = DateTimeOffset.Now;

            if (!string.IsNullOrEmpty(cronExpressionTextBox.Text))
            {
                for (var i = 0; i <= 99; i++)
                {
                    var date = FormsHelper.GetScheduleForCron(cronExpressionTextBox.Text, time);
                    if (date == DateTimeOffset.MinValue)
                    {
                        return;
                    }
                    if (date == null)
                    {
                        continue;
                    }
                    scheduleTimes.Add(date.Value);
                    time = date.Value;
                }
            }
            calculatedRunsTextBox.Text = string.Empty;
            foreach (var date in scheduleTimes)
            {
                calculatedRunsTextBox.Text = calculatedRunsTextBox.Text + $@"{date.ToLocalTime():yyyy-MM-dd HH:mm:ss}" +
                                             Environment.NewLine;
            }
        }
コード例 #2
0
        private bool ValidateJobSettings()
        {
            if (cronTriggerRadioButton.Checked)
            {
                var date = FormsHelper.GetScheduleForCron(cronExpressionTextBox.Text, DateTimeOffset.Now);
                if (date == DateTimeOffset.MinValue)
                {
                    return(false);
                }
            }
            var message = new StringBuilder();

            if (string.IsNullOrEmpty(jobName.Text))
            {
                message.AppendLine(Resources.Job_name_is_missing);
            }

            if (string.IsNullOrEmpty(jobGroupComboBox.Text))
            {
                message.AppendLine(Resources.Job_group_is_not_selected);
            }

            if (string.IsNullOrEmpty(downloadFolder.Text))
            {
                message.AppendLine(Resources.Download_folder_is_not_selected);
            }

            if (string.IsNullOrEmpty(errorsFolder.Text))
            {
                message.AppendLine(Resources.Download_errors_folder_is_not_selected);
            }

            if ((instanceComboBox.SelectedItem == null) || string.IsNullOrEmpty(instanceComboBox.Text))
            {
                message.AppendLine(Resources.Dynamics_instance_is_not_selected);
            }

            if (userAuthRadioButton.Checked &&
                ((userComboBox.SelectedItem == null) || string.IsNullOrEmpty(userComboBox.Text)))
            {
                message.AppendLine(Resources.User_is_not_selected);
            }

            if ((appRegistrationComboBox.SelectedItem == null) || string.IsNullOrEmpty(appRegistrationComboBox.Text))
            {
                message.AppendLine(Resources.AAD_client_application_is_not_selected);
            }

            if ((dataJobComboBox.SelectedItem == null) || string.IsNullOrEmpty(dataJobComboBox.Text))
            {
                message.AppendLine(Resources.Data_job_is_not_selected);
            }

            if (message.Length > 0)
            {
                MessageBox.Show(message.ToString(), Resources.Job_configuration_is_not_valid);
            }

            return(message.Length == 0);
        }
コード例 #3
0
        private bool ValidateJobSettings()
        {
            if (importJobCronTriggerRadioButton.Checked)
            {
                var date = FormsHelper.GetScheduleForCron(importJobCronExpressionTextBox.Text, DateTimeOffset.Now);
                if (date == DateTimeOffset.MinValue)
                {
                    return(false);
                }
            }

            if (useMonitoringJobCheckBox.Checked && monitoringJobCronTriggerRadioButton.Checked)
            {
                var date = FormsHelper.GetScheduleForCron(monitoringJobCronExpressionTextBox.Text, DateTimeOffset.Now);
                if (date == DateTimeOffset.MinValue)
                {
                    return(false);
                }
            }

            var message = new StringBuilder();

            if (string.IsNullOrEmpty(jobName.Text))
            {
                message.AppendLine(Resources.Job_name_is_missing);
            }

            if ((jobGroupComboBox.SelectedItem == null) || string.IsNullOrEmpty(jobGroupComboBox.Text))
            {
                message.AppendLine(Resources.Job_group_is_not_selected);
            }

            if (string.IsNullOrEmpty(topFolderTextBox.Text) && useStandardSubfolder.Checked)
            {
                message.AppendLine(Resources.Top_uploads_folder_is_not_selected);
            }

            if (string.IsNullOrEmpty(inputFolderTextBox.Text))
            {
                message.AppendLine(Resources.Input_folder_is_not_selected);
            }

            if (string.IsNullOrEmpty(uploadSuccessFolderTextBox.Text))
            {
                message.AppendLine(Resources.Upload_success_folder_is_not_selected);
            }

            if (string.IsNullOrEmpty(uploadErrorsFolderTextBox.Text))
            {
                message.AppendLine(Resources.Upload_errors_folder_is_not_selected);
            }

            if (string.IsNullOrEmpty(processingSuccessFolderTextBox.Text) && useMonitoringJobCheckBox.Checked)
            {
                message.AppendLine(Resources.Processing_success_folder_is_not_selected);
            }

            if (string.IsNullOrEmpty(processingErrorsFolderTextBox.Text) && useMonitoringJobCheckBox.Checked)
            {
                message.AppendLine(Resources.Processing_errors_folder_is_not_selected);
            }

            if (!multicompanyCheckBox.Checked && string.IsNullOrEmpty(legalEntityTextBox.Text))
            {
                message.AppendLine(Resources.Legal_entity_is_missing);
            }

            if (string.IsNullOrEmpty(dataProject.Text))
            {
                message.AppendLine(Resources.Data_project_is_missing);
            }

            if ((instanceComboBox.SelectedItem == null) || string.IsNullOrEmpty(instanceComboBox.Text))
            {
                message.AppendLine(Resources.Dynamics_instance_is_not_selected);
            }

            if (userAuthRadioButton.Checked &&
                ((userComboBox.SelectedItem == null) || string.IsNullOrEmpty(userComboBox.Text)))
            {
                message.AppendLine(Resources.User_is_not_selected);
            }

            if ((appRegistrationComboBox.SelectedItem == null) || string.IsNullOrEmpty(appRegistrationComboBox.Text))
            {
                message.AppendLine(Resources.AAD_client_application_is_not_selected);
            }

            if (string.IsNullOrEmpty(statusFileExtensionTextBox.Text) && useMonitoringJobCheckBox.Checked)
            {
                message.AppendLine(Resources.Status_file_extension_is_not_specified);
            }

            if (!inputFilesArePackagesCheckBox.Checked && string.IsNullOrEmpty(packageTemplateTextBox.Text))
            {
                message.AppendLine(Resources.Package_template_is_missing);
            }

            if (multicompanyCheckBox.Checked && getLegalEntityFromFilenameRadioButton.Checked)
            {
                if (string.IsNullOrEmpty(filenameSeparatorTextBox.Text))
                {
                    message.AppendLine(Resources.Filename_separator_is_missing);
                }
            }

            if (string.IsNullOrEmpty(getAzureWriteUrlTextBox.Text))
            {
                message.AppendLine(Resources.URL_for_GetAzureWriteUrl_action_is_missing);
            }

            if (string.IsNullOrEmpty(importFromPackageTextBox.Text))
            {
                message.AppendLine(Resources.URL_for_ImportFromPackage_action_is_missing);
            }

            if (string.IsNullOrEmpty(getExecutionSummaryStatusTextBox.Text))
            {
                message.AppendLine(Resources.URL_for_GetExecutionSummaryStatus_action_is_missing);
            }

            if (string.IsNullOrEmpty(getExecutionSummaryPageUrlTextBox.Text))
            {
                message.AppendLine(Resources.URL_for_GetExecutionSummaryPageUrl_action_is_missing);
            }

            if (string.IsNullOrEmpty(getImportTargetErrorKeysFileUrlTextBox.Text))
            {
                message.AppendLine(Resources.URL_for_GetImportTargetErrorKeysFileUrl_action_is_missing);
            }

            if (string.IsNullOrEmpty(generateImportTargetErrorKeysFileTextBox.Text))
            {
                message.AppendLine(Resources.URL_for_GenerateImportTargetErrorKeysFile_action_is_missing);
            }

            if (string.IsNullOrEmpty(getExecutionErrorsTextBox.Text))
            {
                message.AppendLine(Resources.URL_for_GetExecutionErrors_action_is_missing);
            }

            if (message.Length > 0)
            {
                MessageBox.Show(message.ToString(), Resources.Job_configuration_is_not_valid);
            }

            return(message.Length == 0);
        }
コード例 #4
0
        private bool ValidateJobSettings()
        {
            if (upJobCronTriggerRadioButton.Checked)
            {
                var date = FormsHelper.GetScheduleForCron(upJobCronExpressionTextBox.Text, DateTimeOffset.Now);
                if (date == DateTimeOffset.MinValue)
                {
                    return(false);
                }
            }

            if (useMonitoringJobCheckBox.Checked && procJobCronTriggerRadioButton.Checked)
            {
                var date = FormsHelper.GetScheduleForCron(procJobCronExpressionTextBox.Text, DateTimeOffset.Now);
                if (date == DateTimeOffset.MinValue)
                {
                    return(false);
                }
            }

            var message = new StringBuilder();

            if (string.IsNullOrEmpty(jobName.Text))
            {
                message.AppendLine(Resources.Job_name_is_missing);
            }

            if ((jobGroupComboBox.SelectedItem == null) || string.IsNullOrEmpty(jobGroupComboBox.Text))
            {
                message.AppendLine(Resources.Job_group_is_not_selected);
            }

            if (string.IsNullOrEmpty(topUploadFolderTextBox.Text) && useStandardSubfolder.Checked)
            {
                message.AppendLine(Resources.Top_uploads_folder_is_not_selected);
            }

            if (string.IsNullOrEmpty(inputFolderTextBox.Text))
            {
                message.AppendLine(Resources.Input_folder_is_not_selected);
            }

            if (string.IsNullOrEmpty(uploadSuccessFolderTextBox.Text))
            {
                message.AppendLine(Resources.Upload_success_folder_is_not_selected);
            }

            if (string.IsNullOrEmpty(uploadErrorsFolderTextBox.Text))
            {
                message.AppendLine(Resources.Upload_errors_folder_is_not_selected);
            }

            if (string.IsNullOrEmpty(processingSuccessFolderTextBox.Text) && useMonitoringJobCheckBox.Checked)
            {
                message.AppendLine(Resources.Processing_success_folder_is_not_selected);
            }

            if (string.IsNullOrEmpty(processingErrorsFolderTextBox.Text) && useMonitoringJobCheckBox.Checked)
            {
                message.AppendLine(Resources.Processing_errors_folder_is_not_selected);
            }

            if ((instanceComboBox.SelectedItem == null) || string.IsNullOrEmpty(instanceComboBox.Text))
            {
                message.AppendLine(Resources.Dynamics_instance_is_not_selected);
            }

            if (userAuthRadioButton.Checked &&
                ((userComboBox.SelectedItem == null) || string.IsNullOrEmpty(userComboBox.Text)))
            {
                message.AppendLine(Resources.User_is_not_selected);
            }

            if ((appRegistrationComboBox.SelectedItem == null) || string.IsNullOrEmpty(appRegistrationComboBox.Text))
            {
                message.AppendLine(Resources.AAD_client_application_is_not_selected);
            }

            if ((dataJobComboBox.SelectedItem == null) || string.IsNullOrEmpty(dataJobComboBox.Text))
            {
                message.AppendLine(Resources.Data_job_is_not_selected);
            }

            if (string.IsNullOrEmpty(statusFileExtensionTextBox.Text) && useMonitoringJobCheckBox.Checked)
            {
                message.AppendLine(Resources.Status_file_extension_is_not_specified);
            }

            if (message.Length > 0)
            {
                MessageBox.Show(message.ToString(), Resources.Job_configuration_is_not_valid);
            }

            return(message.Length == 0);
        }