Exemplo n.º 1
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   = ParentList.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   = ParentList.FindB02_ContinentByParentProperties(child.continent_ID2);
                obj.LoadProperty(B03_Continent_ASingleObjectProperty, child);
            }
            dr.NextResult();
            var b03_SubContinentColl = B03_SubContinentColl.GetB03_SubContinentColl(dr);

            b03_SubContinentColl.LoadItems(ParentList);
            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);
        }
 /// <summary>
 /// Loads child <see cref="B07_Country_Child"/> object.
 /// </summary>
 /// <param name="child">The child object to load.</param>
 internal void LoadChild(B07_Country_Child child)
 {
     LoadProperty(B07_Country_SingleObjectProperty, child);
 }
        /// <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   = ParentList.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   = ParentList.FindB02_ContinentByParentProperties(child.continent_ID2);
                obj.LoadProperty(B03_Continent_ASingleObjectProperty, child);
            }
            var b03_SubContinentColl = B03_SubContinentColl.GetB03_SubContinentColl(dal.B03_SubContinentColl);

            b03_SubContinentColl.LoadItems(ParentList);
            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);
        }