Exemple #1
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);
            }
        }
        protected void tree_GetChildrenData(MCS.Web.WebControls.DeluxeTreeNode parentNode, MCS.Web.WebControls.DeluxeTreeNodeCollection result, string callBackContext)
        {
            switch ((string)parentNode.ExtendedData)
            {
            case "Category":
            {
                var subCates = AUClient.ServiceBroker.AUCenterQueryService.Instance.GetSubCategories(parentNode.Value, true);
                foreach (var item in subCates)
                {
                    result.Add(CreateNode(item));
                }

                var subSchemas = AUClient.ServiceBroker.AUCenterQueryService.Instance.GetAUSchemaByCategory(parentNode.Value, true);
                foreach (var item in subSchemas)
                {
                    result.Add(CreateNode(item));
                }
            }
            break;

            case "AUSchema":
            {
                var schemaRoles = AUClient.ServiceBroker.AUCenterQueryService.Instance.GetMembers(parentNode.Value, new string[] { "AUSchemaRoles" }, true);
                foreach (AUClient.ClientAUSchemaRole item in schemaRoles)
                {
                    result.Add(CreateNode(item));
                }
            }
            break;

            default:
                break;
            }
        }
Exemple #3
0
 private void AddUnitToTree(AU.AdminUnit item, MCS.Web.WebControls.DeluxeTreeNodeCollection treeNodes)
 {
     treeNodes.Add(new MCS.Web.WebControls.DeluxeTreeNode(item.Name, item.ID)
     {
         NodeOpenImg           = ControlResources.OULogoUrl,
         NodeCloseImg          = ControlResources.OULogoUrl,
         CssClass              = "au-catenode",
         ChildNodesLoadingType = ChildNodesLoadingTypeDefine.LazyLoading,
         ExtendedData          = "AU"
     });
 }
Exemple #4
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);
            }
        }
Exemple #5
0
        /// <summary>
        /// new root
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void _addRootButton_Click(object sender, EventArgs e)
        {
            MCS.Web.WebControls.DeluxeTreeNode oItem = new MCS.Web.WebControls.DeluxeTreeNode();
            oItem.Text = "New Root";

            Items.Add(oItem);

            TreeNode oNewTreeNode = new TreeNode("New Root");

            oNewTreeNode.Tag = oItem;
            _treeView.Nodes.Add(oNewTreeNode);

            _treeView.SelectedNode = _treeView.Nodes[_treeView.Nodes.Count - 1];
        }
Exemple #6
0
        private DeluxeTreeNode AddSchemaToTree(AU.AUSchema item, MCS.Web.WebControls.DeluxeTreeNodeCollection treeNodes)
        {
            DeluxeTreeNode node = new MCS.Web.WebControls.DeluxeTreeNode(item.Name, item.ID)
            {
                NodeOpenImg           = ControlResources.OULogoUrl,
                NodeCloseImg          = ControlResources.OULogoUrl,
                CssClass              = "au-catenode",
                ChildNodesLoadingType = ChildNodesLoadingTypeDefine.Normal,
                ExtendedData          = "Schema",
                Expanded              = true
            };

            treeNodes.Add(node);

            return(node);
        }
        private void InitRootTreeNode()
        {
            IOrganization innerRoot = this.Root;

            ServiceBrokerContext.Current.SaveContextStates();

            try
            {
                if (ShowDeletedObjects)
                {
                    ServiceBrokerContext.Current.UseLocalCache       = false;
                    ServiceBrokerContext.Current.ListObjectCondition = ListObjectMask.All;
                }

                if (innerRoot == null)
                {
                    var tmpRootPath = this.RootPath;

                    if (string.IsNullOrEmpty(tmpRootPath))
                    {
                        tmpRootPath = OguPermissionSettings.GetConfig().RootOUPath;
                    }

                    innerRoot = UserOUControlSettings.GetConfig().UserOUControlQuery.GetOrganizationByPath(tmpRootPath); // OguMechanismFactory.GetMechanism().GetRoot();
                }

                DeluxeTreeNode rootNode = new DeluxeTreeNode();

                BindOguObjToTreeNode((IOrganization)OguBase.CreateWrapperObject(innerRoot), rootNode, MultiSelect, SelectMask);

                rootNodesData.Add(rootNode);

                if (RootExpanded)
                {
                    rootNode.ChildNodesLoadingType = ChildNodesLoadingTypeDefine.Normal;
                    rootNode.Expanded = true;
                    BindChildren(rootNode.Nodes, OnGetChildren(innerRoot), MultiSelect, ListMask, SelectMask);
                }
            }
            finally
            {
                ServiceBrokerContext.Current.RestoreSavedStates();
            }
        }
        private void BindChildren(DeluxeTreeNodeCollection nodes, IEnumerable <IOguObject> objects, bool multiSelect, UserControlObjectMask listMask, UserControlObjectMask selectMask)
        {
            OguDataCollection <IOguObject> wrappedObjects = CreateWrappedObjects(objects);

            foreach (IOguObject obj in wrappedObjects)
            {
                DeluxeTreeNode treeNode = new DeluxeTreeNode();
                bool           cancel   = false;

                BindOguObjToTreeNode(obj, treeNode, multiSelect, selectMask);

                FilterObjectToTreeNode(obj, treeNode, listMask, ref cancel);

                if (cancel == false)
                {
                    if (LoadingObjectToTreeNode != null)
                    {
                        LoadingObjectToTreeNode(this, obj, treeNode, ref cancel);
                    }
                }

                if (obj.FullPath.IsNotEmpty())
                {
                    treeNode.Checked = this.selectedOuUserData.FindSingleObjectByFullPath(obj.FullPath) != null;
                }
                else
                {
                    treeNode.Checked = this.selectedOuUserData.FindSingleObjectByID(obj.ID) != null;
                }

                if (cancel == false)
                {
                    nodes.Add(treeNode);
                }
            }

            if (ObjectsLoaded != null)
            {
                ObjectsLoaded(this, wrappedObjects);
            }
        }
		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);
			}
		}
		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);
				}
			}
		}
		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);
			}
		}
		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);
				}
			}
		}