/// <summary> setups the sync logic for member _supportQueue</summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> private void SetupSyncSupportQueue(IEntityCore relatedEntity) { if(_supportQueue!=relatedEntity) { DesetupSyncSupportQueue(true, true); _supportQueue = (SupportQueueEntity)relatedEntity; this.PerformSetupSyncRelatedEntity( _supportQueue, new PropertyChangedEventHandler( OnSupportQueuePropertyChanged ), "SupportQueue", SD.HnD.DAL.RelationClasses.StaticSupportQueueThreadRelations.SupportQueueEntityUsingQueueIDStatic, true, ref _alreadyFetchedSupportQueue, new string[] { } ); } }
/// <summary> Retrieves the related entity of type 'SupportQueueEntity', 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 'SupportQueueEntity' which is related to this entity.</returns> public virtual SupportQueueEntity GetSingleSupportQueue(bool forceFetch) { if( ( !_alreadyFetchedSupportQueue || forceFetch || _alwaysFetchSupportQueue) && !this.IsSerializing && !this.IsDeserializing && !this.InDesignMode) { bool performLazyLoading = this.CheckIfLazyLoadingShouldOccur(Relations.SupportQueueEntityUsingQueueID); SupportQueueEntity newEntity = new SupportQueueEntity(); bool fetchResult = false; if(performLazyLoading) { AddToTransactionIfNecessary(newEntity); fetchResult = newEntity.FetchUsingPK(this.QueueID); } if(fetchResult) { newEntity = (SupportQueueEntity)GetFromActiveContext(newEntity); } else { if(!_supportQueueReturnsNewIfNotFound) { RemoveFromTransactionIfNecessary(newEntity); newEntity = null; } } this.SupportQueue = newEntity; _alreadyFetchedSupportQueue = fetchResult; } return _supportQueue; }
/// <summary>Private CTor for deserialization</summary> /// <param name="info"></param> /// <param name="context"></param> protected SupportQueueThreadEntityBase(SerializationInfo info, StreamingContext context) : base(info, context) { _supportQueue = (SupportQueueEntity)info.GetValue("_supportQueue", typeof(SupportQueueEntity)); if(_supportQueue!=null) { _supportQueue.AfterSave+=new EventHandler(OnEntityAfterSave); } _supportQueueReturnsNewIfNotFound = info.GetBoolean("_supportQueueReturnsNewIfNotFound"); _alwaysFetchSupportQueue = info.GetBoolean("_alwaysFetchSupportQueue"); _alreadyFetchedSupportQueue = info.GetBoolean("_alreadyFetchedSupportQueue"); _claimedByUser = (UserEntity)info.GetValue("_claimedByUser", typeof(UserEntity)); if(_claimedByUser!=null) { _claimedByUser.AfterSave+=new EventHandler(OnEntityAfterSave); } _claimedByUserReturnsNewIfNotFound = info.GetBoolean("_claimedByUserReturnsNewIfNotFound"); _alwaysFetchClaimedByUser = info.GetBoolean("_alwaysFetchClaimedByUser"); _alreadyFetchedClaimedByUser = info.GetBoolean("_alreadyFetchedClaimedByUser"); _placedInQueueByUser = (UserEntity)info.GetValue("_placedInQueueByUser", typeof(UserEntity)); if(_placedInQueueByUser!=null) { _placedInQueueByUser.AfterSave+=new EventHandler(OnEntityAfterSave); } _placedInQueueByUserReturnsNewIfNotFound = info.GetBoolean("_placedInQueueByUserReturnsNewIfNotFound"); _alwaysFetchPlacedInQueueByUser = info.GetBoolean("_alwaysFetchPlacedInQueueByUser"); _alreadyFetchedPlacedInQueueByUser = info.GetBoolean("_alreadyFetchedPlacedInQueueByUser"); _thread = (ThreadEntity)info.GetValue("_thread", typeof(ThreadEntity)); if(_thread!=null) { _thread.AfterSave+=new EventHandler(OnEntityAfterSave); } _threadReturnsNewIfNotFound = info.GetBoolean("_threadReturnsNewIfNotFound"); _alwaysFetchThread = info.GetBoolean("_alwaysFetchThread"); _alreadyFetchedThread = info.GetBoolean("_alreadyFetchedThread"); this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance(), PersistenceInfoProviderSingleton.GetInstance()); // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor // __LLBLGENPRO_USER_CODE_REGION_END }
/// <summary> Removes the sync logic for member _supportQueue</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 DesetupSyncSupportQueue(bool signalRelatedEntity, bool resetFKFields) { this.PerformDesetupSyncRelatedEntity( _supportQueue, new PropertyChangedEventHandler( OnSupportQueuePropertyChanged ), "SupportQueue", SD.HnD.DAL.RelationClasses.StaticSupportQueueThreadRelations.SupportQueueEntityUsingQueueIDStatic, true, signalRelatedEntity, "SupportQueueThreads", resetFKFields, new int[] { (int)SupportQueueThreadFieldIndex.QueueID } ); _supportQueue = null; }
/// <summary> /// Creates a new support queue. /// </summary> /// <param name="queueName">Name of the queue.</param> /// <param name="queueDescription">The queue description.</param> /// <param name="orderNo">The order no.</param> /// <returns>true if succeeded, false otherwise</returns> public static bool CreateNewSupportQueue(string queueName, string queueDescription, short orderNo) { SupportQueueEntity toInsert = new SupportQueueEntity(); toInsert.QueueDescription = queueDescription; toInsert.QueueName = queueName; toInsert.OrderNo = orderNo; return toInsert.Save(); }
/// <summary> /// Gets the support queue entity with the queue id passed in /// </summary> /// <param name="queueID">The queue ID.</param> /// <returns>the supportqueue entity requested or null if not found.</returns> public static SupportQueueEntity GetSupportQueue(int queueID) { // fetch using the constructor. SupportQueueEntity toReturn = new SupportQueueEntity(queueID); if(toReturn.IsNew) { // not found return null; } return toReturn; }
/// <summary>Creates a new, empty SupportQueueEntity object.</summary> /// <returns>A new, empty SupportQueueEntity object.</returns> public override IEntity Create() { IEntity toReturn = new SupportQueueEntity(); // __LLBLGENPRO_USER_CODE_REGION_START CreateNewSupportQueue // __LLBLGENPRO_USER_CODE_REGION_END return toReturn; }
/// <summary> Removes the sync logic for member _defaultSupportQueue</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 DesetupSyncDefaultSupportQueue(bool signalRelatedEntity, bool resetFKFields) { this.PerformDesetupSyncRelatedEntity( _defaultSupportQueue, new PropertyChangedEventHandler( OnDefaultSupportQueuePropertyChanged ), "DefaultSupportQueue", SD.HnD.DAL.RelationClasses.StaticForumRelations.SupportQueueEntityUsingDefaultSupportQueueIDStatic, true, signalRelatedEntity, "DefaultForForums", resetFKFields, new int[] { (int)ForumFieldIndex.DefaultSupportQueueID } ); _defaultSupportQueue = null; }
/// <summary>Private CTor for deserialization</summary> /// <param name="info"></param> /// <param name="context"></param> protected ForumEntityBase(SerializationInfo info, StreamingContext context) : base(info, context) { _forumRoleForumActionRights = (SD.HnD.DAL.CollectionClasses.ForumRoleForumActionRightCollection)info.GetValue("_forumRoleForumActionRights", typeof(SD.HnD.DAL.CollectionClasses.ForumRoleForumActionRightCollection)); _alwaysFetchForumRoleForumActionRights = info.GetBoolean("_alwaysFetchForumRoleForumActionRights"); _alreadyFetchedForumRoleForumActionRights = info.GetBoolean("_alreadyFetchedForumRoleForumActionRights"); _threads = (SD.HnD.DAL.CollectionClasses.ThreadCollection)info.GetValue("_threads", typeof(SD.HnD.DAL.CollectionClasses.ThreadCollection)); _alwaysFetchThreads = info.GetBoolean("_alwaysFetchThreads"); _alreadyFetchedThreads = info.GetBoolean("_alreadyFetchedThreads"); _usersWhoStartedThreads = (SD.HnD.DAL.CollectionClasses.UserCollection)info.GetValue("_usersWhoStartedThreads", typeof(SD.HnD.DAL.CollectionClasses.UserCollection)); _alwaysFetchUsersWhoStartedThreads = info.GetBoolean("_alwaysFetchUsersWhoStartedThreads"); _alreadyFetchedUsersWhoStartedThreads = info.GetBoolean("_alreadyFetchedUsersWhoStartedThreads"); _section = (SectionEntity)info.GetValue("_section", typeof(SectionEntity)); if(_section!=null) { _section.AfterSave+=new EventHandler(OnEntityAfterSave); } _sectionReturnsNewIfNotFound = info.GetBoolean("_sectionReturnsNewIfNotFound"); _alwaysFetchSection = info.GetBoolean("_alwaysFetchSection"); _alreadyFetchedSection = info.GetBoolean("_alreadyFetchedSection"); _defaultSupportQueue = (SupportQueueEntity)info.GetValue("_defaultSupportQueue", typeof(SupportQueueEntity)); if(_defaultSupportQueue!=null) { _defaultSupportQueue.AfterSave+=new EventHandler(OnEntityAfterSave); } _defaultSupportQueueReturnsNewIfNotFound = info.GetBoolean("_defaultSupportQueueReturnsNewIfNotFound"); _alwaysFetchDefaultSupportQueue = info.GetBoolean("_alwaysFetchDefaultSupportQueue"); _alreadyFetchedDefaultSupportQueue = info.GetBoolean("_alreadyFetchedDefaultSupportQueue"); this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance(), PersistenceInfoProviderSingleton.GetInstance()); // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor // __LLBLGENPRO_USER_CODE_REGION_END }