/// <summary> /// Loads <see cref="B06Level111"/> items on the B05Level111Objects collection. /// </summary> /// <param name="collection">The grand parent <see cref="B03Level11Coll"/> collection.</param> internal void LoadItems(B03Level11Coll collection) { foreach (var item in this) { var obj = collection.FindB04Level11ByParentProperties(item.marentID1); var rlce = obj.B05Level111Objects.RaiseListChangedEvents; obj.B05Level111Objects.RaiseListChangedEvents = false; obj.B05Level111Objects.Add(item); obj.B05Level111Objects.RaiseListChangedEvents = rlce; } }
/// <summary> /// Factory method. Loads a <see cref="B02Level1"/> object from the given SafeDataReader. /// </summary> /// <param name="dr">The SafeDataReader to use.</param> /// <returns>A reference to the fetched <see cref="B02Level1"/> object.</returns> internal static B02Level1 GetB02Level1(SafeDataReader dr) { B02Level1 obj = new B02Level1(); // show the framework that this is a child object obj.MarkAsChild(); obj.Fetch(dr); obj.LoadProperty(B03Level11ObjectsProperty, B03Level11Coll.NewB03Level11Coll()); obj.MarkOld(); return(obj); }
/// <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 = B03Level11Child.GetB03Level11Child(dr); var obj = ((B01Level1Coll)Parent).FindB02Level1ByParentProperties(child.cParentID1); obj.LoadProperty(B03Level11SingleObjectProperty, child); } dr.NextResult(); while (dr.Read()) { var child = B03Level11ReChild.GetB03Level11ReChild(dr); var obj = ((B01Level1Coll)Parent).FindB02Level1ByParentProperties(child.cParentID2); obj.LoadProperty(B03Level11ASingleObjectProperty, child); } dr.NextResult(); var b03Level11Coll = B03Level11Coll.GetB03Level11Coll(dr); b03Level11Coll.LoadItems((B01Level1Coll)Parent); dr.NextResult(); while (dr.Read()) { var child = B05Level111ReChild.GetB05Level111ReChild(dr); var obj = b03Level11Coll.FindB04Level11ByParentProperties(child.cMarentID2); obj.LoadChild(child); } dr.NextResult(); while (dr.Read()) { var child = B05Level111Child.GetB05Level111Child(dr); var obj = b03Level11Coll.FindB04Level11ByParentProperties(child.cMarentID1); obj.LoadChild(child); } dr.NextResult(); var b05Level111Coll = B05Level111Coll.GetB05Level111Coll(dr); b05Level111Coll.LoadItems(b03Level11Coll); dr.NextResult(); while (dr.Read()) { var child = B07Level1111Child.GetB07Level1111Child(dr); var obj = b05Level111Coll.FindB06Level111ByParentProperties(child.cLarentID1); obj.LoadChild(child); } dr.NextResult(); while (dr.Read()) { var child = B07Level1111ReChild.GetB07Level1111ReChild(dr); var obj = b05Level111Coll.FindB06Level111ByParentProperties(child.cLarentID2); obj.LoadChild(child); } dr.NextResult(); var b07Level1111Coll = B07Level1111Coll.GetB07Level1111Coll(dr); b07Level1111Coll.LoadItems(b05Level111Coll); dr.NextResult(); while (dr.Read()) { var child = B09Level11111Child.GetB09Level11111Child(dr); var obj = b07Level1111Coll.FindB08Level1111ByParentProperties(child.cNarentID1); obj.LoadChild(child); } dr.NextResult(); while (dr.Read()) { var child = B09Level11111ReChild.GetB09Level11111ReChild(dr); var obj = b07Level1111Coll.FindB08Level1111ByParentProperties(child.cNarentID2); obj.LoadChild(child); } dr.NextResult(); var b09Level11111Coll = B09Level11111Coll.GetB09Level11111Coll(dr); b09Level11111Coll.LoadItems(b07Level1111Coll); dr.NextResult(); while (dr.Read()) { var child = B11Level111111Child.GetB11Level111111Child(dr); var obj = b09Level11111Coll.FindB10Level11111ByParentProperties(child.cQarentID1); obj.LoadChild(child); } dr.NextResult(); while (dr.Read()) { var child = B11Level111111ReChild.GetB11Level111111ReChild(dr); var obj = b09Level11111Coll.FindB10Level11111ByParentProperties(child.cQarentID2); obj.LoadChild(child); } dr.NextResult(); var b11Level111111Coll = B11Level111111Coll.GetB11Level111111Coll(dr); b11Level111111Coll.LoadItems(b09Level11111Coll); }