예제 #1
0
        /// <summary>
        /// 已选参数展示表的数据绑定
        /// </summary>
        private void PreParamSledDataBind()
        {
            IntroducerBLL                     ibll        = new IntroducerBLL();
            string                            ProName     = HAZOP分析系统.ProName;
            List <SelectedPramas>             splist      = spbll.Get_SelectedPramasList(ProName);
            List <DisplayPramasAndIntroducer> displaylist = null;

            if (splist != null)
            {
                List <HOZAPModel.Introducer> introducerlist = new List <HOZAPModel.Introducer>();
                displaylist = new List <DisplayPramasAndIntroducer>();
                for (int i = 0; i < splist.Count; i++)
                {
                    DisplayPramasAndIntroducer displayinfo = new DisplayPramasAndIntroducer();
                    displayinfo.PramasID = splist[i].PramasId;
                    displayinfo.Name     = splist[i].PramasText;
                    introducerlist       = ibll.Get_IntroducerList(splist[i].PramasId);
                    for (int j = 0; j < introducerlist.Count; j++)
                    {
                        if (j == introducerlist.Count - 1)
                        {
                            displayinfo.AllIntroducer += introducerlist[j].IntroducerText;
                        }
                        else
                        {
                            displayinfo.AllIntroducer += introducerlist[j].IntroducerText + "、";
                        }
                    }
                    displaylist.Add(displayinfo);
                }
            }

            dgvPreParamSled.AutoGenerateColumns = false;
            dgvPreParamSled.DataSource          = displaylist;
        }
예제 #2
0
        /// <summary>
        /// 创建TreeView
        /// </summary>
        private void CreateTree()
        {
            TreeNode root = new TreeNode();

            root.Text = InitialInterface.ProName;
            trvUcAnaly.Nodes.Add(root);
            SelectedPramasBLL     spbll    = new SelectedPramasBLL();
            IntroducerBLL         ibll     = new IntroducerBLL();
            NodeBLL               nbll     = new NodeBLL();
            List <Node>           nodelist = nbll.Get_NodeList(InitialInterface.ProName);
            List <SelectedPramas> sp       = spbll.Get_SelectedPramasList(InitialInterface.ProName);

            if (nodelist != null)
            {
                for (int i = 0; i < nodelist.Count; i++)
                {
                    TreeNode node1 = new TreeNode();
                    node1.Text = nodelist[i].NodeName;
                    node1.Tag  = nodelist[i].NodeId;
                    root.Nodes.Add(node1);
                    if (sp != null)
                    {
                        for (int j = 0; j < sp.Count; j++)
                        {
                            TreeNode node2 = new TreeNode();
                            node2.Text = sp[j].PramasText;
                            node2.Tag  = sp[j].PramasId;
                            node1.Nodes.Add(node2);
                            List <HOZAPModel.Introducer> Introducerlist = ibll.Get_IntroducerList(sp[j].PramasId);
                            for (int k = 0; k < Introducerlist.Count; k++)
                            {
                                TreeNode node3 = new TreeNode();
                                node3.Text = Introducerlist[k].IntroducerText;
                                node3.Tag  = Introducerlist[k].IntroducerId;
                                node2.Nodes.Add(node3);
                            }
                        }
                    }
                }
                this.trvUcAnaly.Nodes[0].Expand();
            }
        }