Beispiel #1
0
        private void SubmitSuppliers_Click(object sender, EventArgs e)
        {
            TreeView backup = new TreeView();

            try
            {
                SubmitSuppliers.Enabled = false;
                TreeViewBox.Enabled     = false;

                CopyTree(TreeViewBox, backup);
                TreeViewBox.BeginUpdate();
                cnxn.AccountsForForms.UnionWith(TreeViewBox.getChecked());
                TreeView LocationTree = cnxn.getSQMLocationOptionsTree(TreeViewBox.getChecked());
                TreeViewBox.Nodes.Clear();
                CopyTree(LocationTree, TreeViewBox);
                TreeViewBox.EndUpdate();
                TreeViewBox.Enabled           = true;
                SelectLabel.Text              = "Please select Locations for SQM";
                SubmitSuppliers.Visible       = false;
                SubmitLocationsButton.Enabled = true;
                SubmitLocationsButton.Visible = true;
            }
            catch (Exception)
            {
                MessageBox.Show("Invalid Settings!", "Error", MessageBoxButtons.OK);
                SubmitSuppliers.Enabled = true;
                TreeViewBox.BeginUpdate();
                TreeViewBox.Nodes.Clear();
                CopyTree(backup, TreeViewBox);
                TreeViewBox.EndUpdate();
                TreeViewBox.Enabled     = true;
                TreeViewBox.Enabled     = true;
                SubmitSuppliers.Visible = true;
            }
        }
Beispiel #2
0
        private void SubmitButton_Click(object sender, EventArgs e)
        {
            try
            {
                cnxn = new DBConnection(DBBox.Text, DataServerBox.Text, EnvironmentBox.SelectedIndex);
                cnxn.getManagement();

                cnxn.getAccounts();
                DBBox.Enabled         = false;
                DataServerBox.Enabled = false;
                SubmitButton.Enabled  = false;
                TreeViewBox.BeginUpdate();
                // TreeViewBox = cnxn.getTree();
                CopyTree(cnxn.getAccountTree(), TreeViewBox);
                //TreeViewBox.Nodes.Add("This Worked");
                TreeViewBox.EndUpdate();
                SubmitButton.Visible    = false;
                SubmitSuppliers.Visible = true;
            }
            catch (Exception)
            {
                MessageBox.Show("Invalid Settings!", "Error", MessageBoxButtons.OK);
                DBBox.Enabled         = true;
                DataServerBox.Enabled = true;
            }
        }
Beispiel #3
0
        private void SubmitResults_Click(object sender, EventArgs e)//TODO: This should populate the tree with location>Form>Result>Files
        {
            TreeView backup = new TreeView();

            try
            {
                SubmitResults.Enabled = false;
                SubmitResults.Visible = false;
                TreeViewBox.Enabled   = false;
                CopyTree(TreeViewBox, backup);
                Graph AccountsToForms = cnxn.getAccountFormResultGraph();
                Graph FormsToResults  = new Graph();
                foreach (string AccountID in AccountsToForms.getRoots())
                {
                    FormsToResults.setNameForID(AccountID, AccountsToForms.getNameFromID(AccountID));
                    foreach (string FormID in AccountsToForms.getChildren(AccountID))
                    {
                        FormsToResults.setNameForID(FormID, AccountsToForms.getNameFromID(FormID));
                        FormsToResults.addEdge(AccountID, FormID);
                        foreach (TreeNode Result in TreeViewBox.getCheckedChildren(FormID))
                        {
                            FormsToResults.setNameForID(Result.Name, Result.Text);
                            FormsToResults.addEdge(FormID, Result.Name);
                        }
                    }
                }
                TreeViewBox.BeginUpdate();
                TreeView resultsTree = cnxn.getFileTree(FormsToResults);
                TreeViewBox.Nodes.Clear();
                CopyTree(resultsTree, TreeViewBox);
                TreeViewBox.EndUpdate();
                TreeViewBox.Enabled   = true;
                SelectLabel.Text      = "Please select Results from which to pull certifications.";
                SubmitResults.Visible = false;
            }
            catch (Exception)
            {
                MessageBox.Show("Invalid Settings!", "Error", MessageBoxButtons.OK);
                SubmitResults.Enabled = true;
                SubmitResults.Visible = true;
                TreeViewBox.BeginUpdate();
                TreeViewBox.Nodes.Clear();
                CopyTree(backup, TreeViewBox);
                TreeViewBox.EndUpdate();
                TreeViewBox.Enabled = true;
                TreeViewBox.Enabled = true;
            }
        }
Beispiel #4
0
        private void SubmitFormsButton_Click(object sender, EventArgs e)
        {
            TreeView backup = new TreeView();

            try
            {
                SubmitFormsButton.Enabled = false;
                SubmitFormsButton.Visible = false;
                TreeViewBox.Enabled       = false;
                //cnxn.AccountsForForms.UnionWith(TreeViewBox.getChecked());
                //cnxn.getForms(cnxn.AccountsForForms);
                CopyTree(TreeViewBox, backup);
                Graph AccountsToForms = new Graph();
                foreach (TreeNode Account in TreeViewBox.Nodes)
                {
                    AccountsToForms.setNameForID(Account.Name, Account.Text);
                    foreach (TreeNode Form in TreeViewBox.getCheckedChildren(Account.Name))
                    {
                        AccountsToForms.setNameForID(Form.Name, Form.Text);
                        AccountsToForms.addEdge(Account.Name, Form.Name);
                    }
                }
                TreeViewBox.BeginUpdate();
                TreeView resultsTree = cnxn.getResultsTree(AccountsToForms);
                TreeViewBox.Nodes.Clear();
                CopyTree(resultsTree, TreeViewBox);
                TreeViewBox.EndUpdate();
                TreeViewBox.Enabled     = true;
                SelectLabel.Text        = "Please select Results from which to pull certifications.";
                SubmitSuppliers.Visible = false;
            }
            catch (Exception)
            {
                MessageBox.Show("Invalid Settings!", "Error", MessageBoxButtons.OK);
                SubmitFormsButton.Enabled = true;
                SubmitFormsButton.Visible = true;
                TreeViewBox.BeginUpdate();
                TreeViewBox.Nodes.Clear();
                CopyTree(backup, TreeViewBox);
                TreeViewBox.EndUpdate();
                TreeViewBox.Enabled = true;
                TreeViewBox.Enabled = true;
            }
        }
Beispiel #5
0
        private void SubmitMaterialsButton_Click(object sender, EventArgs e)
        {
            TreeView backup = new TreeView();

            try
            {
                SubmitMaterialsButton.Enabled = false;
                SubmitMaterialsButton.Visible = false;
                TreeViewBox.Enabled           = false;
                cnxn.AccountsForForms.UnionWith(TreeViewBox.getChecked());
                cnxn.getForms(cnxn.AccountsForForms);
                CopyTree(TreeViewBox, backup);
                TreeViewBox.BeginUpdate();
                TreeView FormTree = cnxn.getFormTree();
                TreeViewBox.Nodes.Clear();
                CopyTree(FormTree, TreeViewBox);
                TreeViewBox.EndUpdate();
                TreeViewBox.Enabled       = true;
                SelectLabel.Text          = "Please select Forms for each level to search for Certs";
                SubmitSuppliers.Visible   = false;
                SubmitFormsButton.Visible = true;
                SubmitFormsButton.Enabled = true;
            }
            catch (Exception)
            {
                MessageBox.Show("Invalid Settings!", "Error", MessageBoxButtons.OK);
                SubmitMaterialsButton.Enabled = true;
                SubmitMaterialsButton.Visible = true;
                SubmitFormsButton.Visible     = false;
                SubmitFormsButton.Enabled     = false;
                TreeViewBox.BeginUpdate();
                TreeViewBox.Nodes.Clear();
                CopyTree(backup, TreeViewBox);
                TreeViewBox.EndUpdate();
                TreeViewBox.Enabled = true;
                TreeViewBox.Enabled = true;
            }
        }