Пример #1
0
        private void MenuItemSetSystemDiagram_Click(object sender, EventArgs e)
        {
            if (treeLeft.SelectedNode == null)
            {
                return;
            }
            TreeNode       pNode  = treeLeft.SelectedNode.Parent;
            CSystem        system = (CSystem)pNode.Tag;
            SelDiagramForm frm    = new SelDiagramForm();

            if (frm.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            system.FW_Diagram_id = frm.m_SelDiagram.Id;
            if (!Program.Ctx.SystemMgr.Update(system))
            {
                MessageBox.Show("修改失败!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
        }
Пример #2
0
        private void treeLeft_AfterSelect(object sender, TreeViewEventArgs e)
        {
            TreeNodeTag tag = (TreeNodeTag)e.Node.Tag;

            if (tag == null)
            {
                return;
            }

            if (tag.NodeType == TreeNodeType.TableRoot)
            {
                tablePanel.Dock    = DockStyle.Fill;
                tablePanel.Visible = true;
                tablePanel.BringToFront();
            }
            else if (tag.NodeType == TreeNodeType.DiagramRoot)
            {
                diagramPanel.Dock    = DockStyle.Fill;
                diagramPanel.Visible = true;
                diagramPanel.BringToFront();
            }
            else if (tag.NodeType == TreeNodeType.UserRoot)
            {
                TreeNodeTag ptag    = (TreeNodeTag)e.Node.Parent.Tag;
                CCompany    Company = (CCompany)ptag.Data;
                userPanel.Company = Company;
                userPanel.Dock    = DockStyle.Fill;
                userPanel.Visible = true;
                userPanel.BringToFront();
            }
            else if (tag.NodeType == TreeNodeType.OrgRoot)
            {
                TreeNodeTag ptag    = (TreeNodeTag)e.Node.Parent.Tag;
                CCompany    Company = (CCompany)ptag.Data;
                orgPanel.Company = Company;
                orgPanel.Dock    = DockStyle.Fill;
                orgPanel.Visible = true;
                orgPanel.BringToFront();
            }
            else if (tag.NodeType == TreeNodeType.RoleRoot)
            {
                TreeNodeTag ptag    = (TreeNodeTag)e.Node.Parent.Tag;
                CCompany    Company = (CCompany)ptag.Data;
                rolePanel.Company = Company;
                rolePanel.Dock    = DockStyle.Fill;
                rolePanel.Visible = true;
                rolePanel.BringToFront();
            }
            else if (tag.NodeType == TreeNodeType.AccessRoot)
            {
                TreeNodeTag ptag    = (TreeNodeTag)e.Node.Parent.Tag;
                CCompany    Company = (CCompany)ptag.Data;
                accessPanel.Company = Company;
                accessPanel.Dock    = DockStyle.Fill;
                accessPanel.Visible = true;
                accessPanel.BringToFront();
            }
            else if (tag.NodeType == TreeNodeType.WindowCatalogRoot)
            {
                windowPanel.Catalog = null;
                windowPanel.Dock    = DockStyle.Fill;
                windowPanel.Visible = true;
                windowPanel.BringToFront();
            }
            else if (tag.NodeType == TreeNodeType.WindowCatalog)
            {
                CWindowCatalog catalog = (CWindowCatalog)tag.Data;
                windowPanel.Catalog = catalog;
                windowPanel.Dock    = DockStyle.Fill;
                windowPanel.Visible = true;
                windowPanel.BringToFront();
            }
            else if (tag.NodeType == TreeNodeType.ViewCatalogRoot)
            {
                viewPanel.Catalog = null;
                viewPanel.Dock    = DockStyle.Fill;
                viewPanel.Visible = true;
                viewPanel.BringToFront();
            }
            else if (tag.NodeType == TreeNodeType.ViewCatalog)
            {
                CViewCatalog catalog = (CViewCatalog)tag.Data;
                viewPanel.Catalog = catalog;
                viewPanel.Dock    = DockStyle.Fill;
                viewPanel.Visible = true;
                viewPanel.BringToFront();
            }
            else if (tag.NodeType == TreeNodeType.FormCatalogRoot)
            {
                formPanel.Catalog = null;
                formPanel.Dock    = DockStyle.Fill;
                formPanel.Visible = true;
                formPanel.BringToFront();
            }
            else if (tag.NodeType == TreeNodeType.FormCatalog)
            {
                CFormCatalog catalog = (CFormCatalog)tag.Data;
                formPanel.Catalog = catalog;
                formPanel.Dock    = DockStyle.Fill;
                formPanel.Visible = true;
                formPanel.BringToFront();
            }
            else if (tag.NodeType == TreeNodeType.SubSystemRoot)
            {
                subSystemPanel.Dock    = DockStyle.Fill;
                subSystemPanel.Visible = true;
                subSystemPanel.BringToFront();
            }
            else if (tag.NodeType == TreeNodeType.SubDiagram)
            {
                TreeNode    pNode  = e.Node.Parent;
                TreeNodeTag tagP   = (TreeNodeTag)pNode.Tag;
                CSystem     system = (CSystem)tagP.Data;
                if (system.FW_Diagram_id == Guid.Empty)
                {
                    SelDiagramForm frm = new SelDiagramForm();
                    if (frm.ShowDialog() != DialogResult.OK)
                    {
                        return;
                    }
                    system.FW_Diagram_id = frm.m_SelDiagram.Id;
                    if (!Program.Ctx.SystemMgr.Update(system))
                    {
                        MessageBox.Show("修改失败!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    }
                    DesignerForm frm2 = new DesignerForm();
                    frm2.m_Diagram = frm.m_SelDiagram;
                    frm2.Show(this);
                }
                else
                {
                    CDiagram diagram = (CDiagram)Program.Ctx.DiagramMgr.Find(system.FW_Diagram_id);
                    if (diagram == null)
                    {
                        SelDiagramForm frm = new SelDiagramForm();
                        if (frm.ShowDialog() != DialogResult.OK)
                        {
                            return;
                        }
                        system.FW_Diagram_id = frm.m_SelDiagram.Id;
                        if (!Program.Ctx.SystemMgr.Update(system))
                        {
                            MessageBox.Show("修改失败!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                        }
                        DesignerForm frm2 = new DesignerForm();
                        frm2.m_Diagram = frm.m_SelDiagram;
                        frm2.Show(this);
                    }
                    else
                    {
                        DesignerForm frm2 = new DesignerForm();
                        frm2.m_Diagram = diagram;
                        frm2.Show(this);
                    }
                }
            }
            else if (tag.NodeType == TreeNodeType.WindowCatalog)
            {
            }
            else if (tag.NodeType == TreeNodeType.ReportCompany)
            {
                TreeNodeTag ptag    = (TreeNodeTag)e.Node.Tag;
                CCompany    Company = (CCompany)ptag.Data;
                reportPanel.Company = Company;
                reportPanel.Catalog = null;
                reportPanel.Dock    = DockStyle.Fill;
                reportPanel.Visible = true;
                reportPanel.BringToFront();
            }
            else if (tag.NodeType == TreeNodeType.ReportCatalog)
            {
                CCompany Company = null;
                TreeNode p       = e.Node.Parent;
                while (p != null)
                {
                    TreeNodeTag ptag = (TreeNodeTag)p.Tag;
                    if (ptag.NodeType == TreeNodeType.ReportCompany)
                    {
                        Company = (CCompany)ptag.Data;
                        break;
                    }
                    p = p.Parent;
                }
                reportPanel.Company = Company;
                CReportCatalog catalog = (CReportCatalog)tag.Data;
                reportPanel.Catalog = catalog;
                reportPanel.Dock    = DockStyle.Fill;
                reportPanel.Visible = true;
                reportPanel.BringToFront();
            }
            else if (tag.NodeType == TreeNodeType.WorkflowCompany)
            {
                TreeNodeTag ptag    = (TreeNodeTag)e.Node.Tag;
                CCompany    Company = (CCompany)ptag.Data;
                workflowDefPanel.Company = Company;
                workflowDefPanel.Catalog = null;
                workflowDefPanel.Dock    = DockStyle.Fill;
                workflowDefPanel.Visible = true;
                workflowDefPanel.BringToFront();
            }
            else if (tag.NodeType == TreeNodeType.WorkflowCatalog)
            {
                CCompany Company = null;
                TreeNode p       = e.Node.Parent;
                while (p != null)
                {
                    TreeNodeTag ptag = (TreeNodeTag)p.Tag;
                    if (ptag.NodeType == TreeNodeType.WorkflowCompany)
                    {
                        Company = (CCompany)ptag.Data;
                        break;
                    }
                    p = p.Parent;
                }
                workflowDefPanel.Company = Company;
                CWorkflowCatalog catalog = (CWorkflowCatalog)tag.Data;
                workflowDefPanel.Catalog = catalog;
                workflowDefPanel.Dock    = DockStyle.Fill;
                workflowDefPanel.Visible = true;
                workflowDefPanel.BringToFront();
            }
            else if (tag.NodeType == TreeNodeType.MenuRoot)
            {
                menuPanel.Dock    = DockStyle.Fill;
                menuPanel.Visible = true;
                menuPanel.BringToFront();
            }
        }