コード例 #1
0
        public List <EPS> GetEps()
        {
            var eps = new ReadEPS {
                Field = new EPSFieldType[3]
            };

            eps.Field[0] = EPSFieldType.ObjectId;
            eps.Field[1] = EPSFieldType.Name;
            eps.Field[2] = EPSFieldType.Id;
            var retVal = new List <EPS>(_epsService.ReadEPS(eps));

            return(retVal);
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: csai38/ProjectTm
        private TreeNode[] _readEPS2Tree(EPSService epss, int?parentObjectId, ProjectService projServ = null)
        {
            //epss.CookieContainer = eppmConnection.sessionCookie;
            //string[] fields = new string(["ObjectId", "ParentObjectId", "Id", "Name"]);
            string[] fields = new string[4] {
                "ObjectId", "ParentObjectId", "Id", "Name"
            };
            ReadEPS readEPS = new ReadEPS();

            readEPS.Field = new EPSFieldType[4] {
                EPSFieldType.ObjectId, EPSFieldType.ParentObjectId, EPSFieldType.Id, EPSFieldType.Name
            };
            readEPS.Filter = (parentObjectId == null) ? "ParentObjectId IS NULL" : String.Format("ParentObjectId = {0}", parentObjectId);
            EPS[] res = epss.ReadEPS(readEPS);
            if (res.Length == 0)
            {
                return(null);
            }
            TreeNode[] treeNodes = new TreeNode[res.Length];
            int        i         = 0;

            foreach (EPS r in res)
            {
                TreeNode nod = new TreeNode();
                nod.Text = r.Name;
                nod.Tag  = String.Format("eps-{0}", r.ObjectId);

                TreeNode[] nodes = this._readEPS2Tree(epss, r.ObjectId, projServ);
                if (nodes != null)
                {
                    nod.Nodes.AddRange(nodes);
                }
                if (projServ != null)
                {
                    TreeNode[] projs = this._readProjects(projServ, r.ObjectId);
                    if (projs != null)
                    {
                        nod.Nodes.AddRange(projs);
                    }
                }
                nod.Expand();
                treeNodes[i] = nod;
                i++;
            }
            return(treeNodes);
        }