Ejemplo n.º 1
0
        /// <summary>
        /// 过滤文件登记数据
        /// </summary>
        /// <param name="data"></param>
        /// <param name="treeEnum"></param>
        /// <returns></returns>
        private DataSet FilterData(DataSet data, RegistEnum treeEnum)
        {
            DigiPower.ERM.CBLL.TreesData tcbll = new DigiPower.ERM.CBLL.TreesData();

            DigiPower.ERM.CBLL.FileRegist cbll = new DigiPower.ERM.CBLL.FileRegist();

            DataSet NewData = new DataSet();

            switch (treeEnum)
            {
            case RegistEnum.NOATTACHMENT:
            {
                NewData = tcbll.GetTreeNoAttachment(Globals.OpenedProjectNo);

                NewData = FilterDataWithNoNode(NewData);

                return(NewData);
            }

            case RegistEnum.NOREGIST:
            {
                NewData = tcbll.GetTreeNoRegist(Globals.OpenedProjectNo);

                NewData = FilterDataWithNoNode(NewData);

                return(NewData);
            }

            case RegistEnum.NOPAPER:
            {
                NewData = tcbll.GetTreeNoPaper(Globals.OpenedProjectNo);

                NewData = FilterDataWithNoNode(NewData);

                return(NewData);
            }

            case RegistEnum.NOCHECK:
            {
                NewData = tcbll.GetTreeNoCheck(Globals.OpenedProjectNo);

                NewData = FilterDataWithNoNode(NewData);

                return(NewData);
            }

            case RegistEnum.ISPAPER:
            {
                NewData = tcbll.GetTreeIsPaper(Globals.OpenedProjectNo);

                NewData = FilterDataWithNoNode(NewData);

                return(NewData);
            }

            default:
                return(data);
            }
        }
Ejemplo n.º 2
0
        /// 用递归的方法读取树
        /// </summary>
        /// <param name="treeView">需要把数据绑定到的TreeView控件</param>
        /// <param name="tableName">树的数据所在的表</param>
        public void GetFileTree(TreeView treeView, bool withImage, string projectNo, bool isAll)
        {
            treeView.Nodes.Clear();

            DigiPower.ERM.CBLL.FileRegist cbll = new DigiPower.ERM.CBLL.FileRegist();

            ds = cbll.GetNewFileRecording_Templet(projectNo);

            DataView dataView = new DataView(ds.Tables[0]);

            dataView.RowFilter = "id='01'";
            if (dataView.Count == 0)
            {
                return;
            }
            string     nodeID     = "";
            string     title      = "";
            int        imageindex = 0;
            string     tag        = "";
            TreeNodeEx node;

            //获取数据
            nodeID = dataView[0]["id"].ToString();    //节点唯一ID
            title  = dataView[0]["title"].ToString(); //标题
            tag    = dataView[0]["table_name"].ToString();
            //新建节点
            node = new TreeNodeEx();

            node.Name = nodeID;         //节点唯一ID,用来检索
            node.Text = title;          //标题
            node.Tag  = tag;
            if (withImage)
            {
                node.ImageIndex         = imageindex;
                node.SelectedImageIndex = imageindex;
            }

            //添加节点
            treeView.BeginUpdate();

            //添加子节点
            LoadFileChildNodes(node.Nodes, nodeID, withImage, isAll);


            treeView.Nodes.Add(node);

            treeView.EndUpdate();

            //展开根节点
            treeView.Nodes[0].Expand();

            //销毁
            ds = null;
        }
Ejemplo n.º 3
0
        public string GetFinal_fileCount(TreeNodeEx node)
        {
            DigiPower.ERM.CBLL.FileRegist cbll = new DigiPower.ERM.CBLL.FileRegist();

            string count = "[0]";

            string NUM = cbll.GetAttachmentListCount(OpeartPath(node), Globals.OpenedProjectNo);

            if (!String.IsNullOrEmpty(NUM))
            {
                count = "[" + NUM + "]";
            }

            return(count);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 刷新节点
        /// </summary>
        /// <param name="Node"></param>
        /// <param name="withImage"></param>
        /// <param name="projectNo"></param>
        /// <param name="IsCount"></param>
        /// <param name="isAll"></param>
        public void RefreshFileNode(TreeNode NodeNode, bool withImage, string projectNo, bool isAll)
        {
            TreeNodeEx Node = (TreeNodeEx)NodeNode;

            //树
            TreeView treeView1 = Node.TreeView;

            DigiPower.ERM.CBLL.FileRegist cbll = new DigiPower.ERM.CBLL.FileRegist();

            ds = cbll.RegistGetNewFileRecording_Templet(projectNo);

            DataView dataView = new DataView(ds.Tables[0]);

            if (dataView.Count == 0)
            {
                treeView1.Nodes.Clear();
                return;
            }

            Node.Nodes.Clear();

            dataView.RowFilter = "id='" + Node.Name + "'";

            if (dataView.Count > 0)
            {
                //添加节点
                treeView1.BeginUpdate();

                Node.Text = dataView[0]["title"].ToString();

                Node.Tag = dataView[0]["table_name"].ToString();

                //添加子节点
                LoadFileChildNodes(Node.Nodes, Node.Name, withImage, isAll);

                Node.IsFirstExpand = false;

                treeView1.EndUpdate();
            }
            //销毁
            // ds = null;
        }