Exemplo n.º 1
0
        private void toolStripMenuItemAddRoot_Click(object sender, EventArgs e)
        {
            DlgRoleEdit dlg = new DlgRoleEdit(null, EditType.AddRoot);

            dlg.Action = this.Action;
            if (dlg.ShowDialog(this) == DialogResult.OK)
            {
                SysRole       role = dlg.Role;
                UltraTreeNode node = new UltraTreeNode(role.RoleId);
                node.Text = role.RoleName;
                node.Tag  = role;
                ultraTreeRole.Nodes.Add(node);
            }
        }
Exemplo n.º 2
0
        private void toolStripMenuItemUpdate_Click(object sender, EventArgs e)
        {
            UltraTreeNode node = ultraTreeRole.ActiveNode;

            if (node != null)
            {
                SysRole     role = node.Tag as SysRole;
                DlgRoleEdit dlg  = new DlgRoleEdit(role, EditType.Update, this.Action);
                if (dlg.ShowDialog(this) == DialogResult.OK)
                {
                    SysRole newRole = dlg.Role;
                    node.Text = newRole.RoleName;
                    node.Tag  = newRole;
                }
            }
        }
Exemplo n.º 3
0
        private void toolStripMenuItemAddSub_Click(object sender, EventArgs e)
        {
            UltraTreeNode node = ultraTreeRole.ActiveNode;

            if (node != null)
            {
                SysRole     role = node.Tag as SysRole;
                DlgRoleEdit dlg  = new DlgRoleEdit(role, EditType.AddChild, this.Action);
                if (dlg.ShowDialog(this) == DialogResult.OK)
                {
                    SysRole       cRole = dlg.Role;
                    UltraTreeNode child = new UltraTreeNode(cRole.RoleId);
                    child.Text = cRole.RoleName;
                    child.Tag  = cRole;
                    node.Nodes.Add(child);
                }
            }
        }