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; } }
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; } }