Ejemplo n.º 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;
        }
Ejemplo n.º 2
0
        public void SetInfo(List <int> PramasIDlist)
        {
            PramasBLL     pbll = new PramasBLL();
            IntroducerBLL ibll = new IntroducerBLL();

            PramasIDList = PramasIDlist;
            Pramas PramasInfo = pbll.Get_PramasInfo(PramasIDlist[0]);

            txtPramasName.Text = PramasInfo.Name;
            List <Introducer> Introducerlist = ibll.Get_IntroducerList(PramasIDlist[0]);

            if (Introducerlist != null)
            {
                dgvIntroducer.Columns.Clear();
                DataGridViewTextBoxColumn a = new DataGridViewTextBoxColumn();
                a.HeaderText = "序号";
                dgvIntroducer.Columns.Add(a);
                DataGridViewTextBoxColumn b = new DataGridViewTextBoxColumn();
                b.HeaderText = "引导词";
                dgvIntroducer.Columns.Add(b);
                DataGridViewTextBoxColumn c = new DataGridViewTextBoxColumn();
                c.HeaderText = "偏离描述";
                dgvIntroducer.Columns.Add(c);
                for (int i = 0; i < Introducerlist.Count; i++)
                {
                    int index = this.dgvIntroducer.Rows.Add();
                    this.dgvIntroducer.Rows[index].Cells[0].Value = index + 1;
                    this.dgvIntroducer.Rows[index].Cells[1].Value = Introducerlist[i].IntroducerText;
                    this.dgvIntroducer.Rows[index].Cells[2].Value = "";
                }
            }
        }
Ejemplo n.º 3
0
        private void UcAnalyCombox_DataBind()
        {
            IntroducerBLL introducerBLL = new IntroducerBLL();

            if (ReceiveSelectedTreeNode != null)
            {
                int id = Convert.ToInt32(ReceiveSelectedTreeNode);
                List <Introducer> introducerList = introducerBLL.Get_IntroducerList(id);
                this.dataGridView1.Columns["Column1"].DataPropertyName = "IntroducerText";
                this.dataGridView1.AutoGenerateColumns = false;
                this.dataGridView1.DataSource          = introducerList;
            }
        }
Ejemplo n.º 4
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();
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 为选择的参数展示表的数据绑定
        /// </summary>
        private void PreParamSelectionDataBind()
        {
            PramasBLL     pbll    = new PramasBLL();
            IntroducerBLL ibll    = new IntroducerBLL();
            string        ProName = HAZOP分析系统.ProName;
            List <Pramas> plist   = pbll.Get_PramasList(ProName);
            List <DisplayPramasAndIntroducer> displaylist = null;

            if (plist != null)
            {
                List <Introducer> introducerlist = new List <Introducer>();
                displaylist = new List <DisplayPramasAndIntroducer>();
                for (int i = 0; i < plist.Count; i++)
                {
                    DisplayPramasAndIntroducer displayinfo = new DisplayPramasAndIntroducer();
                    displayinfo.PramasID = plist[i].PramasID;
                    displayinfo.Name     = plist[i].Name;
                    displayinfo.Type     = plist[i].Type;
                    introducerlist       = ibll.Get_IntroducerList(plist[i].PramasID);
                    if (introducerlist != null)
                    {
                        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);
                }
            }
            dgvPreParamSelection.AutoGenerateColumns = false;
            dgvPreParamSelection.DataSource          = displaylist;
        }