コード例 #1
0
        /// <summary>
        /// Factory method. Loads a <see cref="B04_SubContinent"/> object from the given SafeDataReader.
        /// </summary>
        /// <param name="dr">The SafeDataReader to use.</param>
        /// <returns>A reference to the fetched <see cref="B04_SubContinent"/> object.</returns>
        internal static B04_SubContinent GetB04_SubContinent(SafeDataReader dr)
        {
            B04_SubContinent obj = new B04_SubContinent();

            // show the framework that this is a child object
            obj.MarkAsChild();
            obj.Fetch(dr);
            obj.LoadProperty(B05_CountryObjectsProperty, B05_CountryColl.NewB05_CountryColl());
            obj.MarkOld();
            return(obj);
        }
コード例 #2
0
 /// <summary>
 /// Loads <see cref="B08_Region"/> items on the B07_RegionObjects collection.
 /// </summary>
 /// <param name="collection">The grand parent <see cref="B05_CountryColl"/> collection.</param>
 internal void LoadItems(B05_CountryColl collection)
 {
     foreach (var item in this)
     {
         var obj  = collection.FindB06_CountryByParentProperties(item.parent_Country_ID);
         var rlce = obj.B07_RegionObjects.RaiseListChangedEvents;
         obj.B07_RegionObjects.RaiseListChangedEvents = false;
         obj.B07_RegionObjects.Add(item);
         obj.B07_RegionObjects.RaiseListChangedEvents = rlce;
     }
 }
コード例 #3
0
        /// <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 = B03_Continent_Child.GetB03_Continent_Child(dr);
                var obj   = ((B01_ContinentColl)Parent).FindB02_ContinentByParentProperties(child.continent_ID1);
                obj.LoadProperty(B03_Continent_SingleObjectProperty, child);
            }
            dr.NextResult();
            while (dr.Read())
            {
                var child = B03_Continent_ReChild.GetB03_Continent_ReChild(dr);
                var obj   = ((B01_ContinentColl)Parent).FindB02_ContinentByParentProperties(child.continent_ID2);
                obj.LoadProperty(B03_Continent_ASingleObjectProperty, child);
            }
            dr.NextResult();
            var b03_SubContinentColl = B03_SubContinentColl.GetB03_SubContinentColl(dr);

            b03_SubContinentColl.LoadItems((B01_ContinentColl)Parent);
            dr.NextResult();
            while (dr.Read())
            {
                var child = B05_SubContinent_Child.GetB05_SubContinent_Child(dr);
                var obj   = b03_SubContinentColl.FindB04_SubContinentByParentProperties(child.subContinent_ID1);
                obj.LoadChild(child);
            }
            dr.NextResult();
            while (dr.Read())
            {
                var child = B05_SubContinent_ReChild.GetB05_SubContinent_ReChild(dr);
                var obj   = b03_SubContinentColl.FindB04_SubContinentByParentProperties(child.subContinent_ID2);
                obj.LoadChild(child);
            }
            dr.NextResult();
            var b05_CountryColl = B05_CountryColl.GetB05_CountryColl(dr);

            b05_CountryColl.LoadItems(b03_SubContinentColl);
            dr.NextResult();
            while (dr.Read())
            {
                var child = B07_Country_Child.GetB07_Country_Child(dr);
                var obj   = b05_CountryColl.FindB06_CountryByParentProperties(child.country_ID1);
                obj.LoadChild(child);
            }
            dr.NextResult();
            while (dr.Read())
            {
                var child = B07_Country_ReChild.GetB07_Country_ReChild(dr);
                var obj   = b05_CountryColl.FindB06_CountryByParentProperties(child.country_ID2);
                obj.LoadChild(child);
            }
            dr.NextResult();
            var b07_RegionColl = B07_RegionColl.GetB07_RegionColl(dr);

            b07_RegionColl.LoadItems(b05_CountryColl);
            dr.NextResult();
            while (dr.Read())
            {
                var child = B09_Region_Child.GetB09_Region_Child(dr);
                var obj   = b07_RegionColl.FindB08_RegionByParentProperties(child.region_ID1);
                obj.LoadChild(child);
            }
            dr.NextResult();
            while (dr.Read())
            {
                var child = B09_Region_ReChild.GetB09_Region_ReChild(dr);
                var obj   = b07_RegionColl.FindB08_RegionByParentProperties(child.region_ID2);
                obj.LoadChild(child);
            }
            dr.NextResult();
            var b09_CityColl = B09_CityColl.GetB09_CityColl(dr);

            b09_CityColl.LoadItems(b07_RegionColl);
            dr.NextResult();
            while (dr.Read())
            {
                var child = B11_City_Child.GetB11_City_Child(dr);
                var obj   = b09_CityColl.FindB10_CityByParentProperties(child.city_ID1);
                obj.LoadChild(child);
            }
            dr.NextResult();
            while (dr.Read())
            {
                var child = B11_City_ReChild.GetB11_City_ReChild(dr);
                var obj   = b09_CityColl.FindB10_CityByParentProperties(child.city_ID2);
                obj.LoadChild(child);
            }
            dr.NextResult();
            var b11_CityRoadColl = B11_CityRoadColl.GetB11_CityRoadColl(dr);

            b11_CityRoadColl.LoadItems(b09_CityColl);
        }
コード例 #4
0
        /// <summary>
        /// Loads child objects from the given DAL provider.
        /// </summary>
        /// <param name="dal">The DAL provider to use.</param>
        internal void FetchChildren(IB01_ContinentCollDal dal)
        {
            foreach (var item in dal.B03_Continent_Child)
            {
                var child = B03_Continent_Child.GetB03_Continent_Child(item);
                var obj   = ((B01_ContinentColl)Parent).FindB02_ContinentByParentProperties(child.continent_ID1);
                obj.LoadProperty(B03_Continent_SingleObjectProperty, child);
            }
            foreach (var item in dal.B03_Continent_ReChild)
            {
                var child = B03_Continent_ReChild.GetB03_Continent_ReChild(item);
                var obj   = ((B01_ContinentColl)Parent).FindB02_ContinentByParentProperties(child.continent_ID2);
                obj.LoadProperty(B03_Continent_ASingleObjectProperty, child);
            }
            var b03_SubContinentColl = B03_SubContinentColl.GetB03_SubContinentColl(dal.B03_SubContinentColl);

            b03_SubContinentColl.LoadItems((B01_ContinentColl)Parent);
            foreach (var item in dal.B05_SubContinent_Child)
            {
                var child = B05_SubContinent_Child.GetB05_SubContinent_Child(item);
                var obj   = b03_SubContinentColl.FindB04_SubContinentByParentProperties(child.subContinent_ID1);
                obj.LoadChild(child);
            }
            foreach (var item in dal.B05_SubContinent_ReChild)
            {
                var child = B05_SubContinent_ReChild.GetB05_SubContinent_ReChild(item);
                var obj   = b03_SubContinentColl.FindB04_SubContinentByParentProperties(child.subContinent_ID2);
                obj.LoadChild(child);
            }
            var b05_CountryColl = B05_CountryColl.GetB05_CountryColl(dal.B05_CountryColl);

            b05_CountryColl.LoadItems(b03_SubContinentColl);
            foreach (var item in dal.B07_Country_Child)
            {
                var child = B07_Country_Child.GetB07_Country_Child(item);
                var obj   = b05_CountryColl.FindB06_CountryByParentProperties(child.country_ID1);
                obj.LoadChild(child);
            }
            foreach (var item in dal.B07_Country_ReChild)
            {
                var child = B07_Country_ReChild.GetB07_Country_ReChild(item);
                var obj   = b05_CountryColl.FindB06_CountryByParentProperties(child.country_ID2);
                obj.LoadChild(child);
            }
            var b07_RegionColl = B07_RegionColl.GetB07_RegionColl(dal.B07_RegionColl);

            b07_RegionColl.LoadItems(b05_CountryColl);
            foreach (var item in dal.B09_Region_Child)
            {
                var child = B09_Region_Child.GetB09_Region_Child(item);
                var obj   = b07_RegionColl.FindB08_RegionByParentProperties(child.region_ID1);
                obj.LoadChild(child);
            }
            foreach (var item in dal.B09_Region_ReChild)
            {
                var child = B09_Region_ReChild.GetB09_Region_ReChild(item);
                var obj   = b07_RegionColl.FindB08_RegionByParentProperties(child.region_ID2);
                obj.LoadChild(child);
            }
            var b09_CityColl = B09_CityColl.GetB09_CityColl(dal.B09_CityColl);

            b09_CityColl.LoadItems(b07_RegionColl);
            foreach (var item in dal.B11_City_Child)
            {
                var child = B11_City_Child.GetB11_City_Child(item);
                var obj   = b09_CityColl.FindB10_CityByParentProperties(child.city_ID1);
                obj.LoadChild(child);
            }
            foreach (var item in dal.B11_City_ReChild)
            {
                var child = B11_City_ReChild.GetB11_City_ReChild(item);
                var obj   = b09_CityColl.FindB10_CityByParentProperties(child.city_ID2);
                obj.LoadChild(child);
            }
            var b11_CityRoadColl = B11_CityRoadColl.GetB11_CityRoadColl(dal.B11_CityRoadColl);

            b11_CityRoadColl.LoadItems(b09_CityColl);
        }