Esempio n. 1
0
        private void toolStripMenuItemAddRoot_Click(object sender, EventArgs e)
        {
            DlgOrgEdit form = new DlgOrgEdit(null, EditType.AddRoot, this.Action);

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                SysOrganization newOrg = form.Organization;
                UltraTreeNode   node   = new UltraTreeNode();
                node.Key  = newOrg.OrganizationId;
                node.Text = GetOrgTreeNodeText(newOrg);
                node.LeftImages.Add(GetImage(newOrg.OrganizationType));
                node.Tag = newOrg;
                ultraTree1.Nodes.Add(node);
            }
        }
Esempio n. 2
0
        private void toolStripMenuItemUpdate_Click(object sender, EventArgs e)
        {
            UltraTreeNode node = ultraTree1.ActiveNode;

            if (node != null)
            {
                SysOrganization org  = node.Tag as SysOrganization;
                DlgOrgEdit      form = new DlgOrgEdit(org, EditType.Update, this.Action);
                if (form.ShowDialog(this) == DialogResult.OK)
                {
                    SysOrganization newOrg = form.Organization;
                    node.Text = newOrg.OrganizationName;
                    node.Tag  = newOrg;
                }
            }
        }
Esempio n. 3
0
        private void toolStripMenuItemAddSub_Click(object sender, EventArgs e)
        {
            UltraTreeNode node = ultraTree1.ActiveNode;

            if (node != null)
            {
                SysOrganization org  = node.Tag as SysOrganization;
                DlgOrgEdit      form = new DlgOrgEdit(org, EditType.AddChild, this.Action);
                if (form.ShowDialog(this) == DialogResult.OK)
                {
                    SysOrganization newOrg  = form.Organization;
                    UltraTreeNode   subNode = new UltraTreeNode();
                    subNode.Key  = newOrg.OrganizationId;
                    subNode.Text = GetOrgTreeNodeText(newOrg);
                    subNode.Tag  = newOrg;
                    subNode.LeftImages.Add(GetImage(newOrg.OrganizationType));
                    node.Nodes.Add(subNode);
                }
            }
        }