Ejemplo n.º 1
0
 /// <summary>
 /// Loads <see cref="A12_CityRoad"/> items on the A11_CityRoadObjects collection.
 /// </summary>
 /// <param name="collection">The grand parent <see cref="A09_CityColl"/> collection.</param>
 internal void LoadItems(A09_CityColl collection)
 {
     foreach (var item in this)
     {
         var obj  = collection.FindA10_CityByParentProperties(item.parent_City_ID);
         var rlce = obj.A11_CityRoadObjects.RaiseListChangedEvents;
         obj.A11_CityRoadObjects.RaiseListChangedEvents = false;
         obj.A11_CityRoadObjects.Add(item);
         obj.A11_CityRoadObjects.RaiseListChangedEvents = rlce;
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Factory method. Loads a <see cref="A08_Region"/> object from the given A08_RegionDto.
        /// </summary>
        /// <param name="data">The <see cref="A08_RegionDto"/>.</param>
        /// <returns>A reference to the fetched <see cref="A08_Region"/> object.</returns>
        internal static A08_Region GetA08_Region(A08_RegionDto data)
        {
            A08_Region obj = new A08_Region();

            // show the framework that this is a child object
            obj.MarkAsChild();
            obj.Fetch(data);
            obj.LoadProperty(A09_CityObjectsProperty, A09_CityColl.NewA09_CityColl());
            obj.MarkOld();
            return(obj);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Loads child objects from the given DAL provider.
        /// </summary>
        /// <param name="dal">The DAL provider to use.</param>
        private void FetchChildren(IA02_ContinentDal dal)
        {
            LoadProperty(A03_Continent_SingleObjectProperty, A03_Continent_Child.GetA03_Continent_Child(dal.A03_Continent_Child));
            LoadProperty(A03_Continent_ASingleObjectProperty, A03_Continent_ReChild.GetA03_Continent_ReChild(dal.A03_Continent_ReChild));
            LoadProperty(A03_SubContinentObjectsProperty, A03_SubContinentColl.GetA03_SubContinentColl(dal.A03_SubContinentColl));
            foreach (var item in dal.A05_SubContinent_Child)
            {
                var child = A05_SubContinent_Child.GetA05_SubContinent_Child(item);
                var obj   = A03_SubContinentObjects.FindA04_SubContinentByParentProperties(child.subContinent_ID1);
                obj.LoadChild(child);
            }
            foreach (var item in dal.A05_SubContinent_ReChild)
            {
                var child = A05_SubContinent_ReChild.GetA05_SubContinent_ReChild(item);
                var obj   = A03_SubContinentObjects.FindA04_SubContinentByParentProperties(child.subContinent_ID2);
                obj.LoadChild(child);
            }
            var a05_CountryColl = A05_CountryColl.GetA05_CountryColl(dal.A05_CountryColl);

            a05_CountryColl.LoadItems(A03_SubContinentObjects);
            foreach (var item in dal.A07_Country_Child)
            {
                var child = A07_Country_Child.GetA07_Country_Child(item);
                var obj   = a05_CountryColl.FindA06_CountryByParentProperties(child.country_ID1);
                obj.LoadChild(child);
            }
            foreach (var item in dal.A07_Country_ReChild)
            {
                var child = A07_Country_ReChild.GetA07_Country_ReChild(item);
                var obj   = a05_CountryColl.FindA06_CountryByParentProperties(child.country_ID2);
                obj.LoadChild(child);
            }
            var a07_RegionColl = A07_RegionColl.GetA07_RegionColl(dal.A07_RegionColl);

            a07_RegionColl.LoadItems(a05_CountryColl);
            foreach (var item in dal.A09_Region_Child)
            {
                var child = A09_Region_Child.GetA09_Region_Child(item);
                var obj   = a07_RegionColl.FindA08_RegionByParentProperties(child.region_ID1);
                obj.LoadChild(child);
            }
            foreach (var item in dal.A09_Region_ReChild)
            {
                var child = A09_Region_ReChild.GetA09_Region_ReChild(item);
                var obj   = a07_RegionColl.FindA08_RegionByParentProperties(child.region_ID2);
                obj.LoadChild(child);
            }
            var a09_CityColl = A09_CityColl.GetA09_CityColl(dal.A09_CityColl);

            a09_CityColl.LoadItems(a07_RegionColl);
            foreach (var item in dal.A11_City_Child)
            {
                var child = A11_City_Child.GetA11_City_Child(item);
                var obj   = a09_CityColl.FindA10_CityByParentProperties(child.city_ID1);
                obj.LoadChild(child);
            }
            foreach (var item in dal.A11_City_ReChild)
            {
                var child = A11_City_ReChild.GetA11_City_ReChild(item);
                var obj   = a09_CityColl.FindA10_CityByParentProperties(child.city_ID2);
                obj.LoadChild(child);
            }
            var a11_CityRoadColl = A11_CityRoadColl.GetA11_CityRoadColl(dal.A11_CityRoadColl);

            a11_CityRoadColl.LoadItems(a09_CityColl);
        }
        /// <summary>
        /// Loads child objects from the given SafeDataReader.
        /// </summary>
        /// <param name="dr">The SafeDataReader to use.</param>
        private void FetchChildren(SafeDataReader dr)
        {
            dr.NextResult();
            if (dr.Read())
            {
                LoadProperty(A03_Continent_SingleObjectProperty, A03_Continent_Child.GetA03_Continent_Child(dr));
            }
            dr.NextResult();
            if (dr.Read())
            {
                LoadProperty(A03_Continent_ASingleObjectProperty, A03_Continent_ReChild.GetA03_Continent_ReChild(dr));
            }
            dr.NextResult();
            LoadProperty(A03_SubContinentObjectsProperty, A03_SubContinentColl.GetA03_SubContinentColl(dr));
            dr.NextResult();
            while (dr.Read())
            {
                var child = A05_SubContinent_Child.GetA05_SubContinent_Child(dr);
                var obj   = A03_SubContinentObjects.FindA04_SubContinentByParentProperties(child.subContinent_ID1);
                obj.LoadChild(child);
            }
            dr.NextResult();
            while (dr.Read())
            {
                var child = A05_SubContinent_ReChild.GetA05_SubContinent_ReChild(dr);
                var obj   = A03_SubContinentObjects.FindA04_SubContinentByParentProperties(child.subContinent_ID2);
                obj.LoadChild(child);
            }
            dr.NextResult();
            var a05_CountryColl = A05_CountryColl.GetA05_CountryColl(dr);

            a05_CountryColl.LoadItems(A03_SubContinentObjects);
            dr.NextResult();
            while (dr.Read())
            {
                var child = A07_Country_Child.GetA07_Country_Child(dr);
                var obj   = a05_CountryColl.FindA06_CountryByParentProperties(child.country_ID1);
                obj.LoadChild(child);
            }
            dr.NextResult();
            while (dr.Read())
            {
                var child = A07_Country_ReChild.GetA07_Country_ReChild(dr);
                var obj   = a05_CountryColl.FindA06_CountryByParentProperties(child.country_ID2);
                obj.LoadChild(child);
            }
            dr.NextResult();
            var a07_RegionColl = A07_RegionColl.GetA07_RegionColl(dr);

            a07_RegionColl.LoadItems(a05_CountryColl);
            dr.NextResult();
            while (dr.Read())
            {
                var child = A09_Region_Child.GetA09_Region_Child(dr);
                var obj   = a07_RegionColl.FindA08_RegionByParentProperties(child.region_ID1);
                obj.LoadChild(child);
            }
            dr.NextResult();
            while (dr.Read())
            {
                var child = A09_Region_ReChild.GetA09_Region_ReChild(dr);
                var obj   = a07_RegionColl.FindA08_RegionByParentProperties(child.region_ID2);
                obj.LoadChild(child);
            }
            dr.NextResult();
            var a09_CityColl = A09_CityColl.GetA09_CityColl(dr);

            a09_CityColl.LoadItems(a07_RegionColl);
            dr.NextResult();
            while (dr.Read())
            {
                var child = A11_City_Child.GetA11_City_Child(dr);
                var obj   = a09_CityColl.FindA10_CityByParentProperties(child.city_ID1);
                obj.LoadChild(child);
            }
            dr.NextResult();
            while (dr.Read())
            {
                var child = A11_City_ReChild.GetA11_City_ReChild(dr);
                var obj   = a09_CityColl.FindA10_CityByParentProperties(child.city_ID2);
                obj.LoadChild(child);
            }
            dr.NextResult();
            var a11_CityRoadColl = A11_CityRoadColl.GetA11_CityRoadColl(dr);

            a11_CityRoadColl.LoadItems(a09_CityColl);
        }