/// <summary> Retrieves the related entity of type 'MPicEntity', using a relation of type 'n:1'</summary> /// <param name="forceFetch">if true, it will discard any changes currently in the currently loaded related entity and will refetch the entity from the persistent storage</param> /// <returns>A fetched entity of type 'MPicEntity' which is related to this entity.</returns> public virtual MPicEntity GetSingleMpic(bool forceFetch) { if( ( !_alreadyFetchedMpic || forceFetch || _alwaysFetchMpic) && !base.IsSerializing && !base.IsDeserializing && !base.InDesignMode) { bool performLazyLoading = base.CheckIfLazyLoadingShouldOccur(TJadwalEntity.Relations.MPicEntityUsingCPic); MPicEntity newEntity = new MPicEntity(); if(base.ParticipatesInTransaction) { base.Transaction.Add(newEntity); } bool fetchResult = false; if(performLazyLoading) { fetchResult = newEntity.FetchUsingPK(this.CPic); } if(fetchResult) { if(base.ActiveContext!=null) { newEntity = (MPicEntity)base.ActiveContext.Get(newEntity); } this.Mpic = newEntity; } else { if(_mpicReturnsNewIfNotFound) { if(performLazyLoading || (!performLazyLoading && (_mpic == null))) { this.Mpic = newEntity; } } else { this.Mpic = null; } } _alreadyFetchedMpic = fetchResult; if(base.ParticipatesInTransaction && !fetchResult) { base.Transaction.Remove(newEntity); } } return _mpic; }
/// <summary> setups the sync logic for member _mpic</summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> private void SetupSyncMpic(IEntity relatedEntity) { if(_mpic!=relatedEntity) { DesetupSyncMpic(true, true); _mpic = (MPicEntity)relatedEntity; base.PerformSetupSyncRelatedEntity( _mpic, new PropertyChangedEventHandler( OnMpicPropertyChanged ), "Mpic", TJadwalEntity.Relations.MPicEntityUsingCPic, true, ref _alreadyFetchedMpic, new string[] { } ); } }
/// <summary> Initializes the class members</summary> private void InitClassMembers() { _mpic = null; _mpicReturnsNewIfNotFound = true; _alwaysFetchMpic = false; _alreadyFetchedMpic = false; _thistoryJadwal = null; _thistoryJadwalReturnsNewIfNotFound = true; _alwaysFetchThistoryJadwal = false; _alreadyFetchedThistoryJadwal = false; PerformDependencyInjection(); // __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers // __LLBLGENPRO_USER_CODE_REGION_END OnInitClassMembersComplete(); }
/// <summary> Removes the sync logic for member _mpic</summary> /// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param> /// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param> private void DesetupSyncMpic(bool signalRelatedEntity, bool resetFKFields) { base.PerformDesetupSyncRelatedEntity( _mpic, new PropertyChangedEventHandler( OnMpicPropertyChanged ), "Mpic", TJadwalEntity.Relations.MPicEntityUsingCPic, true, signalRelatedEntity, "Tjadwal", resetFKFields, new int[] { (int)TJadwalFieldIndex.CPic } ); _mpic = null; }
/// <summary>Private CTor for deserialization</summary> /// <param name="info"></param> /// <param name="context"></param> protected TJadwalEntity(SerializationInfo info, StreamingContext context) : base(info, context) { _mpic = (MPicEntity)info.GetValue("_mpic", typeof(MPicEntity)); if(_mpic!=null) { _mpic.AfterSave+=new EventHandler(OnEntityAfterSave); } _mpicReturnsNewIfNotFound = info.GetBoolean("_mpicReturnsNewIfNotFound"); _alwaysFetchMpic = info.GetBoolean("_alwaysFetchMpic"); _alreadyFetchedMpic = info.GetBoolean("_alreadyFetchedMpic"); _thistoryJadwal = (THistoryJadwalEntity)info.GetValue("_thistoryJadwal", typeof(THistoryJadwalEntity)); if(_thistoryJadwal!=null) { _thistoryJadwal.AfterSave+=new EventHandler(OnEntityAfterSave); } _thistoryJadwalReturnsNewIfNotFound = info.GetBoolean("_thistoryJadwalReturnsNewIfNotFound"); _alwaysFetchThistoryJadwal = info.GetBoolean("_alwaysFetchThistoryJadwal"); _alreadyFetchedThistoryJadwal = info.GetBoolean("_alreadyFetchedThistoryJadwal"); base.FixupDeserialization(FieldInfoProviderSingleton.GetInstance(), PersistenceInfoProviderSingleton.GetInstance()); // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor // __LLBLGENPRO_USER_CODE_REGION_END }
/// <summary>Creates a new, empty MPicEntity object.</summary> /// <returns>A new, empty MPicEntity object.</returns> public override IEntity Create() { IEntity toReturn = new MPicEntity(); // __LLBLGENPRO_USER_CODE_REGION_START CreateNewMPic // __LLBLGENPRO_USER_CODE_REGION_END return toReturn; }