/// <summary>
        /// Factory method. Loads a <see cref="F02Level1"/> object from the given SafeDataReader.
        /// </summary>
        /// <param name="dr">The SafeDataReader to use.</param>
        /// <returns>A reference to the fetched <see cref="F02Level1"/> object.</returns>
        internal static F02Level1 GetF02Level1(SafeDataReader dr)
        {
            F02Level1 obj = new F02Level1();

            // show the framework that this is a child object
            obj.MarkAsChild();
            obj.Fetch(dr);
            obj.LoadProperty(F03Level11ObjectsProperty, F03Level11Coll.NewF03Level11Coll());
            obj.MarkOld();
            return(obj);
        }
Example #2
0
 /// <summary>
 /// Loads <see cref="F06Level111"/> items on the F05Level111Objects collection.
 /// </summary>
 /// <param name="collection">The grand parent <see cref="F03Level11Coll"/> collection.</param>
 internal void LoadItems(F03Level11Coll collection)
 {
     foreach (var item in this)
     {
         var obj  = collection.FindF04Level11ByParentProperties(item.marentID1);
         var rlce = obj.F05Level111Objects.RaiseListChangedEvents;
         obj.F05Level111Objects.RaiseListChangedEvents = false;
         obj.F05Level111Objects.Add(item);
         obj.F05Level111Objects.RaiseListChangedEvents = rlce;
     }
 }
        /// <summary>
        /// Loads child objects from the given SafeDataReader.
        /// </summary>
        /// <param name="dr">The SafeDataReader to use.</param>
        internal void FetchChildren(SafeDataReader dr)
        {
            dr.NextResult();
            while (dr.Read())
            {
                var child = F03Level11Child.GetF03Level11Child(dr);
                var obj   = ((F01Level1Coll)Parent).FindF02Level1ByParentProperties(child.cParentID1);
                obj.LoadProperty(F03Level11SingleObjectProperty, child);
            }
            dr.NextResult();
            while (dr.Read())
            {
                var child = F03Level11ReChild.GetF03Level11ReChild(dr);
                var obj   = ((F01Level1Coll)Parent).FindF02Level1ByParentProperties(child.cParentID2);
                obj.LoadProperty(F03Level11ASingleObjectProperty, child);
            }
            dr.NextResult();
            var f03Level11Coll = F03Level11Coll.GetF03Level11Coll(dr);

            f03Level11Coll.LoadItems((F01Level1Coll)Parent);
            dr.NextResult();
            while (dr.Read())
            {
                var child = F05Level111ReChild.GetF05Level111ReChild(dr);
                var obj   = f03Level11Coll.FindF04Level11ByParentProperties(child.cMarentID2);
                obj.LoadChild(child);
            }
            dr.NextResult();
            while (dr.Read())
            {
                var child = F05Level111Child.GetF05Level111Child(dr);
                var obj   = f03Level11Coll.FindF04Level11ByParentProperties(child.cMarentID1);
                obj.LoadChild(child);
            }
            dr.NextResult();
            var f05Level111Coll = F05Level111Coll.GetF05Level111Coll(dr);

            f05Level111Coll.LoadItems(f03Level11Coll);
            dr.NextResult();
            while (dr.Read())
            {
                var child = F07Level1111Child.GetF07Level1111Child(dr);
                var obj   = f05Level111Coll.FindF06Level111ByParentProperties(child.cLarentID1);
                obj.LoadChild(child);
            }
            dr.NextResult();
            while (dr.Read())
            {
                var child = F07Level1111ReChild.GetF07Level1111ReChild(dr);
                var obj   = f05Level111Coll.FindF06Level111ByParentProperties(child.cLarentID2);
                obj.LoadChild(child);
            }
            dr.NextResult();
            var f07Level1111Coll = F07Level1111Coll.GetF07Level1111Coll(dr);

            f07Level1111Coll.LoadItems(f05Level111Coll);
            dr.NextResult();
            while (dr.Read())
            {
                var child = F09Level11111Child.GetF09Level11111Child(dr);
                var obj   = f07Level1111Coll.FindF08Level1111ByParentProperties(child.cNarentID1);
                obj.LoadChild(child);
            }
            dr.NextResult();
            while (dr.Read())
            {
                var child = F09Level11111ReChild.GetF09Level11111ReChild(dr);
                var obj   = f07Level1111Coll.FindF08Level1111ByParentProperties(child.cNarentID2);
                obj.LoadChild(child);
            }
            dr.NextResult();
            var f09Level11111Coll = F09Level11111Coll.GetF09Level11111Coll(dr);

            f09Level11111Coll.LoadItems(f07Level1111Coll);
            dr.NextResult();
            while (dr.Read())
            {
                var child = F11Level111111Child.GetF11Level111111Child(dr);
                var obj   = f09Level11111Coll.FindF10Level11111ByParentProperties(child.cQarentID1);
                obj.LoadChild(child);
            }
            dr.NextResult();
            while (dr.Read())
            {
                var child = F11Level111111ReChild.GetF11Level111111ReChild(dr);
                var obj   = f09Level11111Coll.FindF10Level11111ByParentProperties(child.cQarentID2);
                obj.LoadChild(child);
            }
            dr.NextResult();
            var f11Level111111Coll = F11Level111111Coll.GetF11Level111111Coll(dr);

            f11Level111111Coll.LoadItems(f09Level11111Coll);
        }