private TreeViewNode RenderHierarchyTreeViewNode(TreeView treeView, object[] hierarchy, string path) { path += "/" + (string)hierarchy[1]; // Create a new tree view node for // the hierarchy on root level. TreeViewNode node = new TreeViewNode(treeView, "tvnHierarchy" + hierarchy[0].ToString(), ""); node.CssClass = "BackgroundColor5"; node.Label = string.Format( "<div id=\"lblHierarchyName{1}\">{0}</div>", (string)hierarchy[1], hierarchy[0] ); node.Buttons.Add(new LiteralControl(string.Format( "<div class=\"ImageInsertHierarchy\"><img src=\"/Images/Icons/Add2.png\" onclick=\"insertHierarchyIdParent='{0}';InitDragBox('boxInsertHierarchyControl');\" /></div>", hierarchy[0] ))); node.Attributes.Add( "Path", path ); node.OnClientClick = string.Format( "LoadStudies(this, '{0}');", hierarchy[0] ); node.OnContextMenu = string.Format( "EditHierarchy('{0}');return false;", hierarchy[0] ); // Get all hierarchies of the workgroups where the user // is assigned to where the hierarchy is the parent. List <object[]> childHierarchies = Global.Core.Hierarchies.ExecuteReader(string.Format( "SELECT Id, Name FROM [Hierarchies] WHERE IdHierarchy='{1}' AND Id IN (SELECT IdHierarchy FROM WorkgroupHierarchies " + "WHERE IdWorkgroup IN (SELECT IdWorkgroup FROM UserWorkgroups WHERE IdUser='******')) ORDER BY Name", Global.IdUser.Value, hierarchy[0] )); // Run through all available child hierarchies of the hierarchy. foreach (object[] childHierarchy in childHierarchies) { node.AddChild(RenderHierarchyTreeViewNode( treeView, childHierarchy, path )); } /*TreeViewNode nodeAdd = new TreeViewNode(treeView, "add_hierarchy" + hierarchy[0], ""); * nodeAdd.Label = "<img src=\"/Images/Icons/Add2.png\" />"; * * node.AddChild(nodeAdd);*/ return(node); }
private void buildTree(TreeViewNode node0, ITreeNodeObject g) { foreach (ITreeNodeObject cg in g.ChildObjects) { TreeViewNode node = new TreeViewNode(cg.Name, "" + cg.Identity); node0.AddChild(node); buildTree(node, cg); } }
private void buildgeoTree (TreeViewNode node0, Geography g) { foreach (Geography cg in g.Children) { childnr++; TreeViewNode node = new TreeViewNode(cg.Name, "" + cg.Identity); node0.AddChild(node); buildgeoTree(node, cg); } }
private void buildgeoTree(TreeViewNode node0, Geography g) { foreach (Geography cg in g.Children) { childnr++; TreeViewNode node = new TreeViewNode(cg.Name, "" + cg.Identity); node0.AddChild(node); buildgeoTree(node, cg); } }
private TreeViewNode RenderHierarchyTreeViewNode(TreeView treeView, object[] workgroup, object[] hierarchy, string path) { // Create a new tree view node for // the hierarchy on root level. TreeViewNode node = new TreeViewNode(treeView, hierarchy[0].ToString(), ""); node.CssClass = "Color1"; node.Label = string.Format( "<table><tr><td><input type=\"checkbox\" {1} onclick=\"ToggleWorkgroupHierarchyCheckbox('{2}', '{3}');\" /></td><td>{0}</td></tr></table>", (string)hierarchy[1], path == "" ? "checked=\"CHECKED\"" : (Global.Core.WorkgroupHierarchies.Count( new string[] { "IdWorkgroup", "IdHierarchy" }, new object[] { workgroup[0], hierarchy[0] } ) == 0 ? "" : "checked=\"CHECKED\""), workgroup[0], hierarchy[0] ); path += "/" + (string)hierarchy[1]; node.Attributes.Add( "Path", path ); /*node.OnClientClick = string.Format( * "LoadStudies(this, '{0}');", * hierarchy[0] * );*/ // Get all hierarchies of the workgroups where the user // is assigned to where the hierarchy is the parent. List <object[]> childHierarchies = Global.Core.Hierarchies.ExecuteReader(string.Format( "SELECT Id, Name FROM [Hierarchies] WHERE IdHierarchy='{1}'", Global.IdUser.Value, hierarchy[0] )); // Run through all available child hierarchies of the hierarchy. foreach (object[] childHierarchy in childHierarchies) { node.AddChild(RenderHierarchyTreeViewNode( treeView, workgroup, childHierarchy, path )); } return(node); }
private TreeViewNode RenderHierarchyTreeViewNode(WebUtilities.Controls.TreeView treeView, object[] hierarchy, string path) { path += "/" + (string)hierarchy[1]; // Create a new tree view node for // the hierarchy on root level. TreeViewNode node = new TreeViewNode(treeView, "tvnHierarchy" + hierarchy[0].ToString(), ""); node.CssClass = "BackgroundColor5"; node.Label = (string)hierarchy[1]; node.Attributes.Add( "Path", path ); node.OnClientClick = string.Format( "LoadVariables(this, '{0}');", hierarchy[0] ); // Get all hierarchies of the workgroups where the user // is assigned to where the hierarchy is the parent. List <object[]> childHierarchies = Global.Core.Hierarchies.ExecuteReader(string.Format( "SELECT Id, Name FROM [Hierarchies] WHERE IdHierarchy='{1}' AND Id IN (SELECT IdHierarchy FROM WorkgroupHierarchies " + "WHERE IdWorkgroup IN (SELECT IdWorkgroup FROM UserWorkgroups WHERE IdUser='******'))", Global.IdUser.Value, hierarchy[0] )); // Run through all available child hierarchies of the hierarchy. foreach (object[] childHierarchy in childHierarchies) { node.AddChild(RenderHierarchyTreeViewNode( treeView, childHierarchy, path )); } return(node); }
private void buildTree (TreeViewNode node0, ITreeNodeObject g) { foreach (ITreeNodeObject cg in g.ChildObjects) { TreeViewNode node = new TreeViewNode(cg.Name, "" + cg.Identity); node0.AddChild(node); buildTree(node, cg); } }
private TreeViewNode RenderHierarchyTreeViewNode(TreeView treeView, object[] hierarchy, string path) { path += "/" + (string)hierarchy[1]; // Create a new tree view node for // the hierarchy on root level. TreeViewNode node = new TreeViewNode(treeView, "tvnHierarchy" + hierarchy[0].ToString(), ""); node.CssClass = "BackgroundColor5"; node.Label = string.Format( "<div id=\"lblHierarchyName{1}\">{0}</div>", (string)hierarchy[1], hierarchy[0] ); node.Attributes.Add( "Path", path ); //for root (default) hierarchy selected. if (hierarchy[0].ToString() == "00000000-0000-0000-0000-000000000000") { node.OnClientClick = string.Format( "LoadWorkflow(this, '{0}', '{1}');", hierarchy[0], HttpUtility.UrlEncode("Workflow/Default") ); } else { node.OnClientClick = string.Format( "LoadWorkflow(this, '{0}', '{1}');", hierarchy[0], HttpUtility.UrlEncode("Workflow/HierarchyWorkflow[@IdHierarchy=\"" + hierarchy[0] + "\"]") ); } // Get all hierarchies of the workgroups where the user // is assigned to where the hierarchy is the parent. List <object[]> childHierarchies = Global.Core.Hierarchies.ExecuteReader(string.Format( "SELECT Id, Name FROM [Hierarchies] WHERE IdHierarchy='{1}' AND Id IN (SELECT IdHierarchy FROM WorkgroupHierarchies " + "WHERE IdWorkgroup IN (SELECT IdWorkgroup FROM UserWorkgroups WHERE IdUser='******')) ORDER BY Name", Global.IdUser.Value, hierarchy[0] )); // Run through all available child hierarchies of the hierarchy. foreach (object[] childHierarchy in childHierarchies) { node.AddChild(RenderHierarchyTreeViewNode( treeView, childHierarchy, path )); } /*TreeViewNode nodeAdd = new TreeViewNode(treeView, "add_hierarchy" + hierarchy[0], ""); * nodeAdd.Label = "<img src=\"/Images/Icons/Add2.png\" />"; * * node.AddChild(nodeAdd);*/ return(node); }