Example #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);
                }
            }
        }
Example #2
0
        private MCS.Web.Responsive.WebControls.DeluxeTree CreateDynamicTree()
        {
            MCS.Web.Responsive.WebControls.DeluxeTree tree = new MCS.Web.Responsive.WebControls.DeluxeTree();

            tree.Width                 = Unit.Pixel(200);
            tree.Height                = Unit.Pixel(300);
            tree.BorderStyle           = BorderStyle.Solid;
            tree.BorderWidth           = Unit.Pixel(1);
            tree.NodeCloseImg          = "closeImg.gif";
            tree.NodeOpenImg           = "openImg.gif";
            tree.Style["overflow"]     = "auto";
            tree.Style["padding-left"] = "5px";
            //tree.GetChildrenData += new WebControls.DeluxeTree.GetChildrenDataDelegete(tree_GetChildrenData);

            DeluxeTreeNode first = new DeluxeTreeNode("First Node", "FirstNode");

            first.ChildNodesLoadingType = ChildNodesLoadingTypeDefine.LazyLoading;
            tree.Nodes.Add(first);

            DeluxeTreeNode second = new DeluxeTreeNode("Second Node", "SecondNode");

            second.ChildNodesLoadingType = ChildNodesLoadingTypeDefine.LazyLoading;
            tree.Nodes.Add(second);

            return(tree);
        }
Example #3
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            //var settings = LogCategoryConfigSection.GetConfig();

            //if (settings == null)
            //    throw new System.Configuration.ConfigurationErrorsException("未找到日志类别配置");

            var nodeGenerl = new DeluxeTreeNode("用户操作", " ")
            {
                Expanded = true
            };

            var nodeAd = new DeluxeTreeNode("实体操作", "DynamicEntity")
            {
                Expanded = true,
                //NodeCloseImg = "../images/ad.png",
                //NodeOpenImg = "../images/ad.png"
            };

            var nodeAdReverseUp = new DeluxeTreeNode("实体字段操作", "DynamicEntityField");

            var nodeAdReverseOutUp = new DeluxeTreeNode("外部实体操作", "OuterEntity");

            var nodeAdReverseOutFiled = new DeluxeTreeNode("外部实体字段操作", "OuterEntityField");

            nodeGenerl.Nodes.Add(nodeAd);
            nodeGenerl.Nodes.Add(nodeAdReverseUp);
            nodeGenerl.Nodes.Add(nodeAdReverseOutUp);
            nodeGenerl.Nodes.Add(nodeAdReverseOutFiled);


            this.tree.Nodes.Add(nodeGenerl);
        }
Example #4
0
        private static void PrepareTreeNodeRecursively(PC.SCSimpleObject parentOrg, DeluxeTreeNode parentTreeNode, Dictionary <string, PC.SCSimpleObject> parentsList, bool godMode, DateTime timePoint, string[] requiredPermissions, string excludeId, string exceptID)
        {
            if (excludeId != parentOrg.ID)
            {
                PC.SCObjectAndRelationCollection relations = PC.Adapters.SCSnapshotAdapter.Instance.QueryObjectAndRelationByParentIDs(PC.SchemaInfo.FilterByCategory("Organizations").ToSchemaNames(), new string[] { parentOrg.ID }, false, true, false, timePoint);

                PC.Permissions.SCContainerAndPermissionCollection permissions = null;

                if (requiredPermissions != null)
                {
                    permissions = PC.Adapters.SCAclAdapter.Instance.LoadCurrentContainerAndPermissions(Util.CurrentUser.ID, relations.ToIDArray());
                }

                BindObjectsToTreeNodes(relations, parentTreeNode.Nodes, godMode, requiredPermissions, permissions, excludeId, exceptID);

                foreach (DeluxeTreeNode childNode in parentTreeNode.Nodes)
                {
                    PC.SCSimpleObject obj = null;

                    if (parentsList.TryGetValue(childNode.Value, out obj))
                    {
                        childNode.ChildNodesLoadingType = ChildNodesLoadingTypeDefine.Normal;
                        childNode.Expanded = true;

                        PrepareTreeNodeRecursively(obj, childNode, parentsList, godMode, timePoint, requiredPermissions, excludeId, exceptID);
                    }
                }
            }
        }
Example #5
0
        protected void tree_GetChildrenData(MCS.Web.WebControls.DeluxeTreeNode parentNode, MCS.Web.WebControls.DeluxeTreeNodeCollection result, string callBackContext)
        {
            if (parentNode.ExtendedData.ToString() == "category")
            {
                var subCates = AU.Adapters.SchemaCategoryAdapter.Instance.LoadSubCategories(parentNode.Value);

                foreach (var item in subCates)
                {
                    DeluxeTreeNode node = CreateTreeNode(item.ID, item.Name, item.Name, item.Name);
                    node.ChildNodesLoadingType = ChildNodesLoadingTypeDefine.LazyLoading;
                    node.ExtendedData          = "category";
                    node.Expanded = false;
                    result.Add(node);
                }
            }

            var subUnits = AU.Adapters.AUSnapshotAdapter.Instance.LoadAUSchemaByCategory(parentNode.Value, true, DateTime.MinValue);

            foreach (AU.AUSchema item in subUnits)
            {
                DeluxeTreeNode node = CreateTreeNode(item.ID, item.Name, item.DisplayName, item.Name);
                node.ChildNodesLoadingType = ChildNodesLoadingTypeDefine.Normal;
                node.NodeOpenImg           = "Images/blocks.png";
                node.NodeCloseImg          = "Images/blocks.png";
                node.ExtendedData          = "schema";
                node.Expanded = false;
                result.Add(node);
            }
        }
Example #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.IsCallback == false && this.IsPostBack == false)
            {
                string pageEntity = Request.QueryString["frameUrl"];

                if (!pageEntity.IsNullOrEmpty())
                {
                    //if (pageEntity.Equals("ETLEntity"))
                    //{
                    //    pcBanner.ActiveMenuIndex = 2;
                    //}
                }

                DECategory     root = CategoryAdapter.Instance.GetRoot();
                DeluxeTreeNode node = new DeluxeTreeNode(root.DisplayName, root.Code);
                node.NodeCloseImg = "Images/wenjianjia.gif";
                node.NodeOpenImg  = "Images/wenjianjia.gif";
                //node.ChildNodesLoadingType = ChildNodesLoadingTypeDefine.LazyLoading;
                node.CssClass = "treenodeParent";
                tree.Nodes.Add(node);
                node.Expanded = true;
                tree_GetChildrenData(node, node.Nodes, null);
            }
        }
Example #7
0
        private void InitTreeNodes(WfApplicationCollection applications)
        {
            DeluxeTreeNode rootNode = new DeluxeTreeNode(TreeRootText, TreeRootText)
            {
                NodeOpenImg  = "../images/computer.gif",
                NodeCloseImg = "../images/computer.gif",
                Expanded     = true
            };

            AddDefaultTreeNode(rootNode);

            foreach (WfApplication app in applications)
            {
                DeluxeTreeNode node = new DeluxeTreeNode(app.Name, app.CodeName)
                {
                    ToolTip               = app.CodeName,
                    NodeOpenImg           = "../images/accomplished.gif",
                    NodeCloseImg          = "../images/accomplished.gif",
                    ChildNodesLoadingType = ChildNodesLoadingTypeDefine.LazyLoading
                };

                rootNode.Nodes.Add(node);
            }

            tree.Nodes.Add(rootNode);
        }
Example #8
0
        protected override void OnPreRender(EventArgs e)
        {
            if (string.IsNullOrEmpty(this.lastVisitOrg.Value) == false)
            {
                this.Response.Redirect("OUExplorer.aspx?ou=" + Server.UrlEncode(this.lastVisitOrg.Value), true);
            }
            else
            {
                base.OnPreRender(e);

                SCOrganization root = SCOrganization.GetRoot();

                if (this.IsPostBack == false)
                {
                    this.navOUID.Value = WebUtility.GetRequestQueryString("ou", root.ID);
                }

                DeluxeTreeNode rootTreeNode = CreateTreeNode(root.ID, root.Name, root.DisplayName, string.Empty);

                rootTreeNode.Expanded = true;
                this.tree.Nodes.Add(rootTreeNode);

                rootTreeNode.ChildNodesLoadingType = ChildNodesLoadingTypeDefine.Normal;

                Dictionary <string, SCSimpleObject> parentsList = PrepareParentsList(this.navOUID.Value);

                PrepareTreeNodeRecursively(root.ToSimpleObject(), rootTreeNode, parentsList, Util.GetTime(), this.navOUID.Value);
            }
        }
Example #9
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 override void OnPreRender(EventArgs e)
        {
            Response.Cache.SetNoStore();
            JSONSerializerExecute.RegisterConverter(typeof(PropertyValueConverter));
            JSONSerializerExecute.RegisterConverter(typeof(UserSettingsConverter));
            JSONSerializerExecute.RegisterConverter(typeof(UserSettingsCategoryConverter));

            txtDataSource.Attributes.Add("style", "display:none;");
            btnSubmit.Attributes.Add("onclick", "updateHiddenText();");

            tree.Nodes.Clear();
            tree.OnNodeSelecting = "nodeClick";

            //根据当前登录的用户取得UserSettings的信息
            UserSettings objUserSettings = UserSettings.LoadSettings(DeluxeIdentity.CurrentUser.ID);

            RegisterEnumTypes(objUserSettings);

            DeluxeTreeNode rootNode = new DeluxeTreeNode(TreeRootText, TreeRootText)
            {
                NodeOpenImg  = "../images/computer.gif",
                NodeCloseImg = "../images/computer.gif",
                Expanded     = true
            };

            DeluxeTreeNode node;
            string         fsNodeText  = string.Empty;
            string         fsNodeValue = string.Empty;

            //循环添加二级结点
            for (int i = 0; i < objUserSettings.Categories.Count; i++)
            {
                fsNodeText  = objUserSettings.Categories[i].Description;
                fsNodeValue = objUserSettings.Categories[i].Name;
                node        = new DeluxeTreeNode(fsNodeText, fsNodeValue)
                {
                    NodeOpenImg  = "../images/accomplished.gif",
                    NodeCloseImg = "../images/accomplished.gif",
                    ExtendedData = objUserSettings.Categories[i].Description
                };
                rootNode.Nodes.Add(node);
            }

            tree.Nodes.Add(rootNode);
            if (!IsPostBack)
            {
                if (objUserSettings.Categories.Count != 0)
                {
                    txtDataSource.Text = JSONSerializerExecute.Serialize(objUserSettings);
                }
            }

            base.OnPreRender(e);
        }
Example #11
0
        private static DeluxeTreeNode CreateTreeNode(string id, string name, string displayName, string fullPath)
        {
            DeluxeTreeNode node = new DeluxeTreeNode(displayName.IsNotEmpty() ? displayName : name, id);

            node.ChildNodesLoadingType = ChildNodesLoadingTypeDefine.LazyLoading;
            node.ToolTip      = fullPath;
            node.NodeOpenImg  = ControlResources.OULogoUrl;
            node.NodeCloseImg = ControlResources.OULogoUrl;
            node.CssClass     = "pc-orgnode";

            return(node);
        }
Example #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);
         }
     }
 }
Example #13
0
        private static DeluxeTreeNode CreateTreeNode(string id, string name, string displayName, string fullPath)
        {
            DeluxeTreeNode node = new DeluxeTreeNode(string.IsNullOrWhiteSpace(displayName) ? name : displayName, id);

            node.ChildNodesLoadingType = ChildNodesLoadingTypeDefine.LazyLoading;
            node.ToolTip      = fullPath;
            node.NodeOpenImg  = ControlResources.OULogoUrl;
            node.NodeCloseImg = ControlResources.OULogoUrl;
            node.CssClass     = "au-catenode";

            return(node);
        }
Example #14
0
        protected void tree_GetChildrenData(MCS.Web.WebControls.DeluxeTreeNode parentNode, MCS.Web.WebControls.DeluxeTreeNodeCollection result, string callBackContext)
        {
            var subCates = AU.Adapters.SchemaCategoryAdapter.Instance.LoadSubCategories(parentNode.Value);

            foreach (var item in subCates)
            {
                DeluxeTreeNode node = CreateTreeNode(item.ID, item.Name, item.Name, item.Name);
                node.ChildNodesLoadingType = ChildNodesLoadingTypeDefine.Normal;
                node.Expanded = true;
                result.Add(node);
            }
        }
Example #15
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            var settings = LogCategoryConfigSection.GetConfig();

            if (settings == null)
            {
                throw new System.Configuration.ConfigurationErrorsException("未找到日志类别配置");
            }

            var nodeGenerl = new DeluxeTreeNode("用户操作", "G")
            {
                Expanded = true
            };

            var nodeAd = new DeluxeTreeNode("活动目录同步", "AD")
            {
                Expanded     = true,
                NodeCloseImg = "../images/ad.png",
                NodeOpenImg  = "../images/ad.png"
            };

            var nodeAdReverse = new DeluxeTreeNode("活动目录反向同步", "RAD");

            this.tree.Nodes.Add(nodeGenerl);
            this.tree.Nodes.Add(nodeAd);
            this.tree.Nodes.Add(nodeAdReverse);

            System.Collections.Specialized.HybridDictionary dic = new System.Collections.Specialized.HybridDictionary();

            foreach (LogCategoryConfigurationElement item in settings.Categories)
            {
                var node = new DeluxeTreeNode(item.Title, nodeGenerl.Value + "." + item.Name);
                node.Expanded = false;
                nodeGenerl.Nodes.Add(node);
                dic.Add(item.Name, node);
            }

            var categoris = LogCategoryAdapter.Instance.LoadCategories();

            foreach (var item in categoris)
            {
                if (dic.Contains(item.Category))
                {
                    var nodeParent = (DeluxeTreeNode)dic[item.Category];

                    var node = new DeluxeTreeNode(item.Description, nodeParent.Value + "." + item.OperationType);
                    nodeParent.Nodes.Add(node);
                }
            }
        }
Example #16
0
        private void AddDefaultTreeNode(DeluxeTreeNode rootNode)
        {
            DeluxeTreeNode node = new DeluxeTreeNode("全局参数", "Default")
            {
                ToolTip      = "Default",
                Selected     = true,
                NodeOpenImg  = "../images/accomplished.gif",
                NodeCloseImg = "../images/accomplished.gif",
                ExtendedData = "Program"
            };

            rootNode.Nodes.Add(node);
        }
Example #17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DECategory     root = CategoryAdapter.Instance.GetRoot();
            DeluxeTreeNode node = new DeluxeTreeNode(root.DisplayName, root.Code);

            node.NodeCloseImg = "../../../Images/wenjianjia.gif";
            node.NodeOpenImg  = "../../../Images/wenjianjia.gif";
            //node.ChildNodesLoadingType = ChildNodesLoadingTypeDefine.LazyLoading;
            node.CssClass = "treenodeParent";
            tree.Nodes.Add(node);
            node.Expanded = true;
            tree_GetChildrenData(node, node.Nodes, null);
        }
 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));
         }
 }
Example #19
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            this.tree.NodeOpenImg = ControlResources.OULogoUrl;

            var topCates = AU.Adapters.SchemaCategoryAdapter.Instance.LoadSubCategories(null);

            foreach (AU.AUSchemaCategory item in topCates)
            {
                DeluxeTreeNode node = CreateTreeNode(item.ID, item.Name, item.Name, item.Name);
                node.Expanded = false;
                this.tree.Nodes.Add(node);
            }
        }
Example #20
0
        private static DeluxeTreeNode CreateTreeNode(string id, string name, string displayName, string fullPath, string schemaType)
        {
            DeluxeTreeNode node = new DeluxeTreeNode(displayName.IsNotEmpty() ? displayName : name, id);

            var profile = profiles[schemaType];

            node.ChildNodesLoadingType = profile.Terminal ? ChildNodesLoadingTypeDefine.Normal : ChildNodesLoadingTypeDefine.LazyLoading;
            node.ToolTip      = fullPath;
            node.NodeOpenImg  = profile.OpenImageUrl;
            node.NodeCloseImg = profile.CloseImageUrl;
            node.CssClass     = profile.CssClass ?? "pc-orgnode";
            node.ShowCheckBox = true;

            return(node);
        }
Example #21
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);
            }
        }
Example #22
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);
            }
        }
Example #23
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);
     }
 }
Example #24
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);
                }
            }
        }
Example #25
0
        private static DeluxeTreeNode CreateTreeNode(SchemaObjectBase obj)
        {
            string name = obj.Properties.GetValue("DisplayName", string.Empty);

            if (string.IsNullOrEmpty(name))
            {
                name = obj.Properties.GetValue("Name", string.Empty);
            }

            DeluxeTreeNode node = new DeluxeTreeNode(name, obj.ID);

            node.ChildNodesLoadingType = ChildNodesLoadingTypeDefine.LazyLoading;
            node.ToolTip      = obj.Properties.GetValue("description", string.Empty);
            node.NodeOpenImg  = ControlResources.OULogoUrl;
            node.NodeCloseImg = ControlResources.OULogoUrl;

            return(node);
        }
Example #26
0
        protected override void OnPreRender(EventArgs e)
        {
            bool godMode = Util.SuperVisiorMode;

            if (this.mainView.ActiveViewIndex == 1)
            {
                this.panMode.Attributes["class"]      = string.Empty;
                this.toggleButton.Attributes["title"] = "切换为列表模式";

                PC.SCOrganization root         = PC.SCOrganization.GetRoot();
                DeluxeTreeNode    rootTreeNode = CreateTreeNode(root.ID, root.Name, root.DisplayName, string.Empty, false, false);

                rootTreeNode.Expanded = true;
                this.tree.Nodes.Add(rootTreeNode);

                rootTreeNode.ChildNodesLoadingType = ChildNodesLoadingTypeDefine.Normal;

                Dictionary <string, PC.SCSimpleObject> parentsList = PrepareParentsList(PC.SCOrganization.RootOrganizationID);

                var pmLimitString = this.Request.QueryString.Get("permission");

                var requiredPermissions = pmLimitString != null?pmLimitString.Split(',') : null;

                var excludeID = this.Request.QueryString["superOf"];

                var exceptID = this.Request.QueryString["exceptOrg"];

                PrepareTreeNodeRecursively(root.ToSimpleObject(), rootTreeNode, parentsList, godMode, DateTime.MinValue, requiredPermissions, excludeID, exceptID);

                this.tree.CallBackContext = godMode ? "godMode" : "general";
            }
            else
            {
                this.panMode.Attributes["class"]      = "pc-listmode";
                this.toggleButton.Attributes["title"] = "切换为分层模式";
            }

            this.hfMode.Value   = this.mainView.ActiveViewIndex.ToString();
            this.hfGod.Value    = godMode ? "1" : "0";
            this.hfSingle.Value = this.Request["mode"] == "single" ? "1" : string.Empty;

            base.OnPreRender(e);
        }
Example #27
0
        private static DeluxeTreeNode CreateTreeNode(string id, string name, string displayName, string fullPath, bool selectable, bool showCheckBox)
        {
            DeluxeTreeNode node = new DeluxeTreeNode(displayName.IsNotEmpty() ? displayName : name, id);

            node.ChildNodesLoadingType = ChildNodesLoadingTypeDefine.LazyLoading;
            node.ToolTip      = fullPath;
            node.NodeOpenImg  = selectable ? ControlResources.OULogoUrl : ControlResources.OULogoUrl;
            node.NodeCloseImg = selectable ? ControlResources.OULogoUrl : ControlResources.OULogoUrl;

            node.ShowCheckBox = showCheckBox;

            if (selectable == false)
            {
                node.CssClass         = "pc-node-exclude";
                node.SelectedCssClass = "pc-node-exclude";
                node.ExtendedData     = "noselect";
            }

            return(node);
        }
Example #28
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            this.tree.NodeOpenImg = ControlResources.OULogoUrl;

            var cate = AU.Adapters.SchemaCategoryAdapter.Instance.LoadByID(Request.QueryString["id"]);

            if (cate == null || cate.Status != MCS.Library.SOA.DataObjects.Schemas.SchemaProperties.SchemaObjectStatus.Normal)
            {
                Response.Redirect("~/Default.aspx", true);
            }
            else
            {
                var subCate = AU.Adapters.SchemaCategoryAdapter.Instance.LoadSubCategories(cate.ID);

                cateName.InnerText = cate.Name;

                foreach (AU.AUSchemaCategory item in subCate)
                {
                    DeluxeTreeNode node = CreateTreeNode(item.ID, item.Name, item.Name, item.Name);
                    node.ChildNodesLoadingType = ChildNodesLoadingTypeDefine.LazyLoading;
                    node.Expanded     = false;
                    node.ExtendedData = "category";
                    this.tree.Nodes.Add(node);
                }

                var subUnits = AU.Adapters.AUSnapshotAdapter.Instance.LoadAUSchemaByCategory(cate.ID, true, DateTime.MinValue);

                foreach (AU.AUSchema item in subUnits)
                {
                    DeluxeTreeNode node = CreateTreeNode(item.ID, item.Name, item.DisplayName, item.Name);
                    node.ChildNodesLoadingType = ChildNodesLoadingTypeDefine.Normal;
                    node.NodeOpenImg           = "Images/blocks.png";
                    node.NodeCloseImg          = "Images/blocks.png";
                    node.ExtendedData          = "schema";
                    node.Expanded = false;
                    this.tree.Nodes.Add(node);
                }
            }
        }
Example #29
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string         code = this.Request.QueryString["CODE"];
                DECategory     root = CategoryAdapter.Instance.GetRoot();
                DeluxeTreeNode node = new DeluxeTreeNode(root.DisplayName, root.Code);
                node.NodeCloseImg = "../../Images/wenjianjia.gif";
                node.NodeOpenImg  = "../../Images/wenjianjia.gif";
                node.CssClass     = "treenodeParent";
                tree.Nodes.Add(node);
                node.Expanded     = true;
                node.ShowCheckBox = true;

                if (code.Equals(root.Code))
                {
                    node.Checked = true;
                }
                tree_GetChildrenData(node, node.Nodes, null);
            }
        }
Example #30
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                DeluxeTreeNode rootNode = new DeluxeTreeNode();
                rootNode.Text = "rootNode";
                rootNode.Value = "rootNode";
                rootNode.Expanded = true;
                rootNode.NavigateUrl = "http://www.baidu.com";
                rootNode.Target = "_self";
                //rootNode.ChildNodesLoadingType = ChildNodesLoadingTypeDefine.LazyLoading;
                //rootNode.LazyLoadingText = "正在加载..";

                DeluxeTreeNode node1 = new DeluxeTreeNode();
                node1.Text = "node1";
                node1.Value = "node1";
                //node1.Html = "<b>node1</b>";

                DeluxeTreeNode node2 = new DeluxeTreeNode();
                node2.Text = "node2";
                node2.Value = "node2";

                rootNode.Nodes.Add(node1);
                rootNode.Nodes.Add(node2);

                DeluxeTreeNode node3 = new DeluxeTreeNode();
                node3.Text = "node3";
                node3.Value = "node3";

                DeluxeTreeNode node4 = new DeluxeTreeNode();
                node4.Text = "node4";
                node4.Value = "node4";

                node2.Nodes.Add(node3);
                node2.Nodes.Add(node4);

                this.tree.Nodes.Add(rootNode);
                //this.tree.DataBind(); 
            }
        }
        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);
                }
            }
        }
Example #32
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);
            SCOrganization root = SCOrganization.GetRoot();

            DeluxeTreeNode rootTreeNode = CreateTreeNode(root.ID, root.Name, root.DisplayName, string.Empty, root.SchemaType);

            rootTreeNode.Expanded     = true;
            rootTreeNode.ShowCheckBox = false;
            this.tree.Nodes.Add(rootTreeNode);

            rootTreeNode.ChildNodesLoadingType = ChildNodesLoadingTypeDefine.Normal;
            string[] schemaTypes = this.Request.QueryString.GetValues("schemaType") ?? DefaultSearchSchemas;

            HashSet <string> union = new HashSet <string>(schemaTypes);

            union.UnionWith(alwaysVisibleSchemaObjects);

            SCObjectAndRelationCollection relations = SCSnapshotAdapter.Instance.QueryObjectAndRelationByParentIDs(union.ToArray(), new string[] { root.ID }, false, false, false, Util.GetTime());

            BindObjectsToTreeNodes(relations, rootTreeNode.Nodes, schemaTypes);
        }