コード例 #1
0
 public TreeChildData GetTestTaskPlanChildTreeNode(TreeViewPara para)
 {
     using (SQLTransaction trans = new SQLTransaction(para))
     {
         TestPlanBusiness business = new TestPlanBusiness();
         return(business.GetTestTaskPlanChildTreeNode(para, trans));
     }
 }
コード例 #2
0
        public TreeChildData GetTestTaskPlanChildTreeNode(TreeViewPara para, SQLTransaction trans)
        {
            TreeChildData childData = new TreeChildData();

            childData.ExpandPermission = true;
            childData.ChildData        = new List <TreeNodeObject>();
            var nodeType = ObjectFactoryUtility.TypeFromID(para.Value1);

            if (nodeType == "PMSPROJECT")
            {
                ObjectQuery query = new ObjectQuery("PROJECTSTAGE");
                query.FilterString = " PROJECTID ='" + para.Value1 + "' ";
                var stageList = query.ExecObjectQuery(para, trans);
                foreach (var stage in stageList)
                {
                    var tempName     = stage.GetObjectDBValue(ObjectInfoConst.EntityName).ToString();
                    var tempNodeType = stage.ObjType.Name;
                    var tempImg      = ServiceUtility.ToWebIconPath(stage.ObjType.IconPath);
                    var tempNode     = ServiceUtility.GetTreeNodeObject(tempName, stage.ObjectID, "", tempNodeType, "1", tempImg, tempNodeType, true);
                    tempNode.ContentPermission = true;
                    childData.ChildData.Add(tempNode);
                }
            }
            else if (nodeType == "PROJECTSTAGE")
            {
                var stageObj = ObjectFactoryUtility.CreateInstance(para, trans, para.Value1, false);
                if (stageObj != null)
                {
                    var         projectId = stageObj.GetObjectDBValue("PROJECTID").ToString();
                    ObjectQuery query     = new ObjectQuery("TESTPLANTASK");
                    query.FilterString = " PROJECT ='" + projectId + "'  AND STAGE='" + para.Value1 + "' ";
                    var testPlanTaskList = query.ExecObjectQuery(para, trans);
                    foreach (var planTask in testPlanTaskList)
                    {
                        var tempName     = planTask.GetObjectDBValue(ObjectInfoConst.EntityName).ToString();
                        var tempNodeType = planTask.ObjType.Name;
                        var tempImg      = ServiceUtility.ToWebIconPath(planTask.ObjType.IconPath);
                        var tempNode     = ServiceUtility.GetTreeNodeObject(tempName, planTask.ObjectID, "", tempNodeType, "1", tempImg, tempNodeType, true);
                        tempNode.ContentPermission = true;
                        childData.ChildData.Add(tempNode);
                    }
                }
            }
            else
            {
                //如果当前用户有权限,则加载下级节点
            }

            return(childData);
        }