示例#1
0
        private void showReinforcements(object target, ExecutedRoutedEventArgs e)
        {
            ReinforcementsDialog dlg = new ReinforcementsDialog();
            dlg.Owner = this;
            if (dlg.ShowDialog() == true)
            {
                DataRowView rowView = (DataRowView)dataGrid.SelectedItems[0];

                string rcluster = dlg.txtRCluster.Text;
                int nworkers = Convert.ToInt32(dlg.txtNumWorkers.Text);
                int jid = (int)rowView["ID"];
                int priority = dlg.cmbPriority.SelectedIndex;
                string jobTemplate = dlg.txtJobTemplate.Text;
                int jobTimeout = dlg.timeJob.Value.HasValue ? Convert.ToInt32(dlg.timeJob.Value.Value.TotalSeconds) : 0;
                int taskTimeout = dlg.timeTask.Value.HasValue ? Convert.ToInt32(dlg.timeTask.Value.Value.TotalSeconds) : 0;

                Submission sdlg = null;

                sdlg = new Submission(txtDatabase.Text, jid, rcluster, jobTemplate, nworkers, priority, jobTimeout, taskTimeout);
                sdlg.Owner = this;
                sdlg.ShowDialog();

                if (sdlg.lastError != null)
                    System.Windows.MessageBox.Show(this, sdlg.lastError.Message, "Error",
                    System.Windows.MessageBoxButton.OK,
                    System.Windows.MessageBoxImage.Error);
            }
        }
示例#2
0
        private void showRecovery(object sender, ExecutedRoutedEventArgs e)
        {
            RecoveryDialog dlg = new RecoveryDialog();
            dlg.Owner = this;
            if (dlg.ShowDialog() == true)
            {
                foreach (DataRowView drv in dataGrid.SelectedItems)
                {
                    int jobid = (int)drv["ID"];
                    string cluster = dlg.txtRCluster.Text;
                    int numWorkers = Convert.ToInt32(dlg.txtNumWorkers.Text);
                    int priority = dlg.cmbPriority.SelectedIndex;
                    string executor = dlg.txtExecutor.Text;
                    string jobTemplate = dlg.txtJobTemplate.Text;
                    int jobTimeout = dlg.timeJob.Value.HasValue ? Convert.ToInt32(dlg.timeJob.Value.Value.TotalSeconds) : 0;
                    int taskTimeout = dlg.timeTask.Value.HasValue ? Convert.ToInt32(dlg.timeTask.Value.Value.TotalSeconds) : 0;

                    Submission sdlg = new Submission(txtDatabase.Text, jobid, cluster, jobTemplate, numWorkers, priority, executor, jobTimeout, taskTimeout);
                    sdlg.Owner = this;
                    sdlg.ShowDialog();

                    if (sdlg.lastError != null)
                    {
                        System.Windows.MessageBox.Show(this, sdlg.lastError.Message, "Error",
                                                       System.Windows.MessageBoxButton.OK,
                                                       System.Windows.MessageBoxImage.Error);
                        break;
                    }
                }

                updateState();
            }
        }
示例#3
0
        private void showNewJob(object sender, RoutedEventArgs e)
        {
            NewJobDialog dlg = new NewJobDialog();
            dlg.Owner = this;
            if (dlg.ShowDialog() == true)
            {
                string bin = dlg.txtExecutable.Text;
                if (dlg.chkMostRecentBinary.IsChecked == true)
                    bin = "";

                Submission sdlg = new Submission(txtDatabase.Text, dlg.txtCategories.Text,
                                                 dlg.txtSharedDir.Text,
                                                 dlg.txtMemout.Text, dlg.txtTimeout.Text, dlg.txtExecutor.Text,
                                                 bin, dlg.txtParameters.Text,
                                                 dlg.txtCluster.Text, dlg.cmbNodeGroup.Text, dlg.cmbLocality.Text,
                                                 dlg.txtLimitMin.Text, dlg.txtLimitMax.Text,
                                                 WindowsIdentity.GetCurrent().Name.ToString(),
                                                 dlg.cmbPriority.SelectedIndex,
                                                 dlg.txtExtension.Text, dlg.txtNote.Text,
                                                 dlg.chkParametricity.IsChecked == true,
                                                 dlg.txtParametricityFrom.Text,
                                                 dlg.txtParametricityTo.Text,
                                                 dlg.txtParametricityStep.Text,
                                                 dlg.chkJobgroup.IsChecked == true,
                                                 dlg.txtJobgroup.Text,
                                                 dlg.txtJobTemplate.Text,
                                                 dlg.timeJob.Value.HasValue ? Convert.ToInt32(dlg.timeJob.Value.Value.TotalSeconds) : 0,
                                                 dlg.timeTask.Value.HasValue ? Convert.ToInt32(dlg.timeTask.Value.Value.TotalSeconds) : 0);
                sdlg.Owner = this;
                sdlg.ShowDialog();

                if (sdlg.lastError != null)
                    System.Windows.MessageBox.Show(this, sdlg.lastError.Message, "Error",
                    System.Windows.MessageBoxButton.OK,
                    System.Windows.MessageBoxImage.Error);

                updateState();
            }
        }
示例#4
0
        private void showNewCatchall(object sender, RoutedEventArgs e)
        {
            CatchallDialog dlg = new CatchallDialog();
            dlg.Owner = this;
            if (dlg.ShowDialog() == true)
            {
                int jobTimeout = dlg.timeJob.Value.HasValue ? Convert.ToInt32(dlg.timeJob.Value.Value.TotalSeconds) : 0;
                int taskTimeout = dlg.timeTask.Value.HasValue ? Convert.ToInt32(dlg.timeTask.Value.Value.TotalSeconds) : 0;

                Submission sdlg = new Submission(txtDatabase.Text,
                                                 dlg.txtCluster.Text,
                                                 dlg.cmbLocality.Text,
                                                 dlg.cmbPriority.SelectedIndex,
                                                 dlg.cmbNodeGroup.Text,
                                                 dlg.txtExecutor.Text,
                                                 dlg.txtLimitMin.Text,
                                                 dlg.txtLimitMax.Text,
                                                 dlg.txtJobTemplate.Text,
                                                 jobTimeout, taskTimeout);

                sdlg.Owner = this;
                sdlg.ShowDialog();

                if (sdlg.lastError != null)
                {
                    System.Windows.MessageBox.Show(this, sdlg.lastError.Message, "Error",
                                                   System.Windows.MessageBoxButton.OK,
                                                   System.Windows.MessageBoxImage.Error);
                }

                updateState();
            }
        }
示例#5
0
        private void showMove(object target, ExecutedRoutedEventArgs e)
        {
            CopyDialog dlg = new CopyDialog();
            dlg.Owner = this;
            if (dlg.ShowDialog() == true)
            {
                string backupDB = dlg.txtDB.Text;

                if (txtDatabase.Text == backupDB)
                {
                    System.Windows.MessageBox.Show(this, "Refusing to copy to the same database.", "Error",
                                                    System.Windows.MessageBoxButton.OK,
                                                    System.Windows.MessageBoxImage.Error);
                    return;
                }

                Int32Collection jobIDs = new Int32Collection();
                IEnumerator den = dataGrid.SelectedItems.GetEnumerator();
                while (den.MoveNext())
                {
                    DataRowView x = (DataRowView)den.Current;
                    jobIDs.Add((int)x["ID"]);
                }

                Submission sdlg = null;

                do
                {
                    Int32Collection subset = null;
                    if (jobIDs.Count > 20)
                    {
                        subset = new Int32Collection();
                        for (int i = 0; i < 20; i++)
                        {
                            subset.Add(jobIDs[0]);
                            jobIDs.RemoveAt(0);
                        }
                    }
                    else
                    {
                        subset = new Int32Collection(jobIDs);
                        jobIDs.Clear();
                    }

                    sdlg = new Submission(txtDatabase.Text, backupDB, subset, true /* move */);
                    sdlg.Owner = this;
                    sdlg.ShowDialog();
                }
                while (jobIDs.Count > 0 && sdlg.lastError == null);

                if (sdlg.lastError != null)
                    System.Windows.MessageBox.Show(this, sdlg.lastError.Message, "Error",
                    System.Windows.MessageBoxButton.OK,
                    System.Windows.MessageBoxImage.Error);
            }
        }
示例#6
0
        private void showNewCatchall(object sender, RoutedEventArgs e)
        {
            CatchallDialog dlg = new CatchallDialog();
            dlg.Owner = this;
            if (dlg.ShowDialog() == true)
            {
                Submission sdlg = new Submission(txtDatabase.Text,
                                                 dlg.txtCluster.Text,
                                                 dlg.cmbLocality.Text,
                                                 dlg.cmbPriority.SelectedIndex,
                                                 dlg.cmbNodeGroup.Text,
                                                 dlg.txtExecutor.Text,
                                                 dlg.txtLimitMin.Text,
                                                 dlg.txtLimitMax.Text);

                sdlg.Owner = this;
                sdlg.ShowDialog();

                if (sdlg.lastError != null)
                {
                    System.Windows.MessageBox.Show(this, sdlg.lastError.Message, "Error",
                                                   System.Windows.MessageBoxButton.OK,
                                                   System.Windows.MessageBoxImage.Error);
                }

                updateState();
            }
        }