Ejemplo n.º 1
0
        private void Child_Update()
        {
            if (!IsDirty)
            {
                return;
            }

            var dto = new H06_CountryDto();

            dto.Country_ID   = Country_ID;
            dto.Country_Name = Country_Name;
            using (var dalManager = DalFactorySelfLoadSoftDelete.GetManager())
            {
                var args = new DataPortalHookArgs(dto);
                OnUpdatePre(args);
                var dal = dalManager.GetProvider <IH06_CountryDal>();
                using (BypassPropertyChecks)
                {
                    var resultDto = dal.Update(dto);
                    args = new DataPortalHookArgs(resultDto);
                }
                OnUpdatePost(args);
                // flushes all pending data operations
                FieldManager.UpdateChildren(this);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Factory method. Loads a <see cref="H06_Country"/> object from the given H06_CountryDto.
        /// </summary>
        /// <param name="data">The <see cref="H06_CountryDto"/>.</param>
        /// <returns>A reference to the fetched <see cref="H06_Country"/> object.</returns>
        internal static H06_Country GetH06_Country(H06_CountryDto data)
        {
            H06_Country obj = new H06_Country();

            obj.Fetch(data);
            return(obj);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Loads a <see cref="H06_Country"/> object from the given <see cref="H06_CountryDto"/>.
        /// </summary>
        /// <param name="data">The H06_CountryDto to use.</param>
        private void Fetch(H06_CountryDto data)
        {
            // Value properties
            LoadProperty(Country_IDProperty, data.Country_ID);
            LoadProperty(Country_NameProperty, data.Country_Name);
            var args = new DataPortalHookArgs(data);

            OnFetchRead(args);
        }
Ejemplo n.º 4
0
        private H06_CountryDto Fetch(SafeDataReader dr)
        {
            var h06_Country = new H06_CountryDto();

            // Value properties
            h06_Country.Country_ID   = dr.GetInt32("Country_ID");
            h06_Country.Country_Name = dr.GetString("Country_Name");

            return(h06_Country);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Factory method. Loads a <see cref="H06_Country"/> object from the given H06_CountryDto.
        /// </summary>
        /// <param name="data">The <see cref="H06_CountryDto"/>.</param>
        /// <returns>A reference to the fetched <see cref="H06_Country"/> object.</returns>
        internal static H06_Country GetH06_Country(H06_CountryDto data)
        {
            H06_Country obj = new H06_Country();

            // show the framework that this is a child object
            obj.MarkAsChild();
            obj.Fetch(data);
            obj.MarkOld();
            return(obj);
        }
Ejemplo n.º 6
0

        
Ejemplo n.º 7
0

        
Ejemplo n.º 8
0
        private void Child_Insert(H04_SubContinent parent)
        {
            var dto = new H06_CountryDto();

            dto.Parent_SubContinent_ID = parent.SubContinent_ID;
            dto.Country_Name           = Country_Name;
            using (var dalManager = DalFactorySelfLoadSoftDelete.GetManager())
            {
                var args = new DataPortalHookArgs(dto);
                OnInsertPre(args);
                var dal = dalManager.GetProvider <IH06_CountryDal>();
                using (BypassPropertyChecks)
                {
                    var resultDto = dal.Insert(dto);
                    LoadProperty(Country_IDProperty, resultDto.Country_ID);
                    args = new DataPortalHookArgs(resultDto);
                }
                OnInsertPost(args);
                // flushes all pending data operations
                FieldManager.UpdateChildren(this);
            }
        }