private void buttonAddGroup_Click(object sender, EventArgs e) { try { using (FormActiveDirectoryGroup frm = new FormActiveDirectoryGroup()) { frm.Text = frm.Text + " [Add]"; frm.GroupName = ""; frm.Operation = Global.Operation.INSERT; if (frm.ShowDialog() == DialogResult.OK) { RefreshTree(); } } } catch (Exception) { throw; } }
private void buttonModify_Click(object sender, EventArgs e) { try { if (treeViewGroup.SelectedNode == null) { Global.ShowMessage("Please select item to remove", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } using (FormActiveDirectoryGroup frm = new FormActiveDirectoryGroup()) { frm.Text = frm.Text + " [Modify]"; frm.Id = Convert.ToInt32(treeViewGroup.SelectedNode.Name); frm.GroupName = treeViewGroup.SelectedNode.Text; frm.Operation = Global.Operation.UPDATE; if (frm.ShowDialog() == DialogResult.OK) { RefreshTree(); } } } catch (Exception) { throw; } }