コード例 #1
0
        /// <summary> Adds the entire collection hierarchy under the ALL aggregation object </summary>
        /// <param name="Tracer">Trace object keeps a list of each method executed and important milestones in rendering </param>
        /// <returns> TRUE if successful, otherwise FALSE </returns>
        /// <remarks> This is postponed until it is needed for the TREE VIEW on the home page, to allow the system to start
        /// faster, even with a great number of item aggregationPermissions in the hierarchy </remarks>
        public static Aggregation_Hierarchy Get_Collection_Hierarchy(Custom_Tracer Tracer)
        {
            if (Tracer != null)
            {
                Tracer.Add_Trace("Item_Aggregation_Utilities.Get_Collection_Hierarchy", "Preparing to create the aggregation hierarchy object");
            }

            // Get the database table
            DataSet childInfo = Engine_Database.Get_Aggregation_Hierarchies(Tracer);

            if (childInfo == null)
            {
                if (Tracer != null)
                {
                    Tracer.Add_Trace("Item_Aggregation_Utilities.Get_Collection_Hierarchy", "NULL value returned from database lookup");
                }

                return(null);
            }

            // Build the return value
            Aggregation_Hierarchy returnValue = new Aggregation_Hierarchy();

            // Add all the collections
            if (Tracer != null)
            {
                Tracer.Add_Trace("Item_Aggregation_Utilities.Get_Collection_Hierarchy", "Add all the child aggregations to the hierarchy");
            }
            add_hierarchy_children(returnValue.Collections, childInfo.Tables[0]);

            // Add all the institutions
            if (Tracer != null)
            {
                Tracer.Add_Trace("Item_Aggregation_Utilities.Get_Collection_Hierarchy", "Add all the institutions to the hierarchy");
            }
            add_hierarchy_children(returnValue.Institutions, childInfo.Tables[1]);

            return(returnValue);
        }