Esempio n. 1
0
        protected void tree_GetChildrenData(DeluxeTreeNode parentNode, DeluxeTreeNodeCollection result)
        {
            Thread.Sleep(new Random().Next(1000));

            Random rnd = new Random();

            for (int i = 0; i < rnd.Next(5); i++)
            {
                string         text = "动态子节点" + i;
                DeluxeTreeNode node = new DeluxeTreeNode(text, text);

                if (i != 1)
                {
                    node.ChildNodesLoadingType = ChildNodesLoadingTypeDefine.LazyLoading;
                }

                result.Add(node);

                if (i == 1)
                {
                    DeluxeTreeNode subNode = new DeluxeTreeNode("固定孙节点", text);
                    node.Nodes.Add(subNode);
                }
            }
        }
Esempio n. 2
0
        protected void tree_GetChildrenData(DeluxeTreeNode parentNode, DeluxeTreeNodeCollection result, string callBackContext)
        {
            string             cssclass = parentNode.CssClass;
            CategoryCollection root     = CategoryAdapter.Instance.GetByParentCode(parentNode.Value);

            foreach (var item in root)
            {
                DeluxeTreeNode node = new DeluxeTreeNode(item.DisplayName, item.Code);
                if (IsLastNode(item.Code))
                {
                    node.ChildNodesLoadingType = ChildNodesLoadingTypeDefine.Normal;
                    node.CssClass = "treeNodeThree";
                    node.Expanded = true;
                }
                else
                {
                    node.ChildNodesLoadingType = ChildNodesLoadingTypeDefine.LazyLoading;
                }
                node.NodeCloseImg = "../../../Images/wenjianjia.gif";
                node.NodeOpenImg  = "../../../Images/wenjianjia.gif";



                result.Add(node);
            }
        }
 protected void tree_GetChildrenData(DeluxeTreeNode parentNode, DeluxeTreeNodeCollection result, string callBackContext)
 {
     if (parentNode.Text == "加载子节点会出现异常")
         throw new System.ApplicationException("加载子节点出现异常");
     else
         if (parentNode.Text == "很多子节点,小心打开!")
             CreateSubTreeNodes(result, 300);
         else
         {
             Thread.Sleep(1000);
             Random rnd = new Random();
             CreateSubTreeNodes(result, rnd.Next(5));
         }
 }
Esempio n. 4
0
        protected void tree_GetChildrenData(DeluxeTreeNode parentNode, DeluxeTreeNodeCollection result, string callBackContext)
        {
            WfProgramInApplicationCollection programs = WfApplicationAdapter.Instance.LoadProgramsByApplication(parentNode.Value);

            foreach (WfProgram program in programs)
            {
                DeluxeTreeNode node = new DeluxeTreeNode(program.Name, program.ApplicationCodeName + "~" + program.CodeName)
                {
                    ToolTip      = program.CodeName,
                    NodeOpenImg  = "../images/edit.gif",
                    NodeCloseImg = "../images/edit.gif",
                    ExtendedData = "Program"
                };

                result.Add(node);
            }
        }
Esempio n. 5
0
 protected void tree_GetChildrenData(DeluxeTreeNode parentNode, DeluxeTreeNodeCollection result, string callBackContext)
 {
     if (parentNode.Text == "加载子节点会出现异常")
     {
         throw new System.ApplicationException("加载子节点出现异常");
     }
     else
     if (parentNode.Text == "很多子节点,小心打开!")
     {
         CreateSubTreeNodes(result, 250);
     }
     else
     {
         Random rnd = new Random();
         CreateSubTreeNodes(result, 1);
     }
 }
        private static void CreateSubTreeNodes(DeluxeTreeNodeCollection parent, int subNodesCount)
        {
            for (int i = 0; i < subNodesCount; i++)
            {
                string text = "动态子节点" + i;
                DeluxeTreeNode node = new DeluxeTreeNode(text, text);

                node.ExtendedData = new ExtendedData();
                node.ShowCheckBox = true;

                if (i != 1)
                    node.ChildNodesLoadingType = ChildNodesLoadingTypeDefine.LazyLoading;

                parent.Add(node);

                if (i == 1)
                {
                    DeluxeTreeNode subNode = new DeluxeTreeNode("固定孙节点", text);
                    node.Nodes.Add(subNode);
                }
            }
        }
        private static void CreateSubTreeNodes(DeluxeTreeNodeCollection parent, int subNodesCount)
        {
            for (int i = 0; i < subNodesCount; i++)
            {
                string         text = "动态子节点" + i;
                DeluxeTreeNode node = new DeluxeTreeNode(text, text);

                node.ExtendedData = new ExtendedData();
                node.ShowCheckBox = true;

                if (i != 1)
                {
                    node.ChildNodesLoadingType = ChildNodesLoadingTypeDefine.LazyLoading;
                }

                parent.Add(node);

                if (i == 1)
                {
                    DeluxeTreeNode subNode = new DeluxeTreeNode("固定孙节点", text);
                    node.Nodes.Add(subNode);
                }
            }
        }
Esempio n. 8
0
        private static void BindObjectsToTreeNodes(PC.SCObjectAndRelationCollection relations, DeluxeTreeNodeCollection nodes, bool godMode, string[] requiredPermissions, PC.Permissions.SCContainerAndPermissionCollection permissions, string excludeID, string exceptID)
        {
            relations.Sort((m, n) => m.InnerSort.CompareTo(n.InnerSort));
            foreach (PC.SCObjectAndRelation r in relations)
            {
                if (r.ID != excludeID && Util.IsOrganization(r.SchemaType))
                {
                    bool showCheckBoxes;
                    bool selectable;

                    if (r.ID == exceptID)
                    {
                        selectable = false;
                    }
                    else if (godMode)
                    {
                        selectable = true;
                    }
                    else
                    {
                        selectable = true;
                        if (requiredPermissions != null && permissions != null)
                        {
                            foreach (string p in requiredPermissions)
                            {
                                selectable &= Util.ContainsPermission(permissions, r.ID, p);
                            }
                        }
                    }

                    if (HttpContext.Current.Request.QueryString["mode"] == "single")
                    {
                        showCheckBoxes = false;
                    }
                    else
                    {
                        showCheckBoxes = selectable;
                    }

                    DeluxeTreeNode newTreeNode = CreateTreeNode(r.ID, r.Name, r.DisplayName, r.FullPath, selectable, showCheckBoxes);

                    nodes.Add(newTreeNode);
                }
            }
        }
Esempio n. 9
0
        private static void BindObjectsToTreeNodes(SCObjectAndRelationCollection relations, DeluxeTreeNodeCollection nodes, string[] schemaTypes)
        {
            HashSet <string> filter = new HashSet <string>(schemaTypes);

            relations.Sort((m, n) => m.InnerSort.CompareTo(n.InnerSort));
            foreach (SCObjectAndRelation r in relations)
            {
                DeluxeTreeNode newTreeNode = CreateTreeNode(r.ID, r.Name, r.DisplayName, r.FullPath, r.SchemaType);
                if (filter.Contains(r.SchemaType) == false)
                {
                    newTreeNode.ShowCheckBox = false;
                    newTreeNode.Checked      = false;
                }
                nodes.Add(newTreeNode);
            }
        }
Esempio n. 10
0
 protected void tree_SelectingNode(DeluxeTreeNode parentNode, DeluxeTreeNodeCollection result, string callBackContext)
 {
 }
Esempio n. 11
0
        protected void tree_GetChildrenData(DeluxeTreeNode parentNode, DeluxeTreeNodeCollection result, string callBackContext)
        {
            SCObjectAndRelationCollection relations = SCSnapshotAdapter.Instance.QueryObjectAndRelationByParentIDs(PC.SchemaInfo.FilterByCategory("Organizations").ToSchemaNames(), new string[] { parentNode.Value }, false, true, false, Util.GetTime());

            BindObjectsToTreeNodes(relations, result);
        }
Esempio n. 12
0
 private static void BindObjectsToTreeNodes(SCObjectAndRelationCollection relations, DeluxeTreeNodeCollection nodes)
 {
     relations.Sort((m, n) => m.InnerSort.CompareTo(n.InnerSort));
     foreach (SCObjectAndRelation r in relations)
     {
         if (Util.IsOrganization(r.SchemaType))
         {
             DeluxeTreeNode newTreeNode = CreateTreeNode(r.ID, r.Name, r.DisplayName, r.FullPath);
             nodes.Add(newTreeNode);
         }
     }
 }