/// <summary>
        /// 流程表单树
        /// </summary>
        public FlowFormTrees(string flowNo)
        {
            int i = this.Retrieve(FlowFormTreeAttr.FK_Flow, flowNo);

            if (i == 0)
            {
                FlowFormTree tree = new FlowFormTree();
                tree.No       = "100";
                tree.FK_Flow  = flowNo;
                tree.Name     = "根目录";
                tree.IsDir    = false;
                tree.ParentNo = "0";
                tree.Insert();

                //创建一个节点.
                tree.DoCreateSubNode();
            }
        }
Exemple #2
0
        /// <summary>
        /// 获取表单库所有表单
        /// </summary>
        /// <returns></returns>
        public string BindForm_GenerForms()
        {
            //形成树
            FlowFormTrees appendFormTrees = new FlowFormTrees();
            //节点绑定表单
            FrmNodes frmNodes = new FrmNodes(this.FK_Flow, this.FK_Node);
            //所有表单类别
            SysFormTrees formTrees = new SysFormTrees();

            formTrees.RetrieveAll(SysFormTreeAttr.Idx);

            //根节点
            BP.WF.Template.FlowFormTree root = new BP.WF.Template.FlowFormTree();
            root.Name = "表单库";
            int i = root.Retrieve(FlowFormTreeAttr.ParentNo, 0);

            if (i != 0)
            {
                root.Name     = "表单库";
                root.No       = "1";
                root.NodeType = "root";
                root.Insert();
            }
            root.NodeType = "root";

            appendFormTrees.AddEntity(root);

            foreach (SysFormTree formTree in formTrees)
            {
                //已经添加排除
                if (appendFormTrees.Contains("No", formTree.No) == true)
                {
                    continue;
                }

                //根节点排除
                if (formTree.ParentNo.Equals("0"))
                {
                    root.No = formTree.No;
                    continue;
                }



                //文件夹
                BP.WF.Template.FlowFormTree nodeFolder = new BP.WF.Template.FlowFormTree();
                nodeFolder.No       = formTree.No;
                nodeFolder.ParentNo = formTree.ParentNo;
                nodeFolder.Name     = formTree.Name;
                nodeFolder.NodeType = "folder";
                if (formTree.ParentNo.Equals("0"))
                {
                    nodeFolder.ParentNo = root.No;
                }
                appendFormTrees.AddEntity(nodeFolder);

                //表单
                MapDatas mapS = new MapDatas();
                mapS.RetrieveByAttr(MapDataAttr.FK_FormTree, formTree.No);
                if (mapS != null && mapS.Count > 0)
                {
                    foreach (MapData map in mapS)
                    {
                        BP.WF.Template.FlowFormTree formFolder = new BP.WF.Template.FlowFormTree();
                        formFolder.No       = map.No;
                        formFolder.ParentNo = map.FK_FormTree;
                        formFolder.Name     = map.Name + "[" + map.No + "]";
                        formFolder.NodeType = "form";
                        appendFormTrees.AddEntity(formFolder);
                    }
                }
            }

            string strCheckedNos = "";

            //设置选中
            foreach (FrmNode frmNode in frmNodes)
            {
                strCheckedNos += "," + frmNode.FK_Frm + ",";
            }
            //重置
            appendMenus.Clear();
            //生成数据
            TansEntitiesToGenerTree(appendFormTrees, root.No, strCheckedNos);
            return(appendMenus.ToString());
        }