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); } }
/// <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); }
/// <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); }
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); }
/// <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); }
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); } }