/// <summary> setups the sync logic for member _hafTemplate</summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> private void SetupSyncHafTemplate(IEntity2 relatedEntity) { if (_hafTemplate != relatedEntity) { DesetupSyncHafTemplate(true, true); _hafTemplate = (HafTemplateEntity)relatedEntity; base.PerformSetupSyncRelatedEntity(_hafTemplate, new PropertyChangedEventHandler(OnHafTemplatePropertyChanged), "HafTemplate", HafTemplateQuestionEntity.Relations.HafTemplateEntityUsingHaftemplateId, true, new string[] { }); } }
/// <summary> Initializes the class members</summary> protected virtual void InitClassMembers() { _customerHealthQuestions = null; _hafTemplate = null; PerformDependencyInjection(); // __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers // __LLBLGENPRO_USER_CODE_REGION_END OnInitClassMembersComplete(); }
public void PublishTemplate(long templateId) { using (IDataAccessAdapter myAdapter = PersistenceLayer.GetDataAccessAdapter()) { var entity = new HafTemplateEntity() { IsPublished = true }; var bucket = new RelationPredicateBucket(HafTemplateFields.HaftemplateId == (long)templateId); try { myAdapter.UpdateEntitiesDirectly(entity, bucket); } catch (Exception exception) { throw new PersistenceFailureException(exception.Message); } } }
public void UpdateDefaultStatus(HealthAssessmentTemplateType type) { using (IDataAccessAdapter myAdapter = PersistenceLayer.GetDataAccessAdapter()) { var entity = new HafTemplateEntity() { IsDefault = false }; var bucket = new RelationPredicateBucket(HafTemplateFields.Type == (long)type); try { myAdapter.UpdateEntitiesDirectly(entity, bucket); } catch (Exception exception) { throw new PersistenceFailureException(exception.Message); } } }
protected HafTemplateQuestionEntity(SerializationInfo info, StreamingContext context) : base(info, context) { if (SerializationHelper.Optimization != SerializationOptimization.Fast) { _customerHealthQuestions = (CustomerHealthQuestionsEntity)info.GetValue("_customerHealthQuestions", typeof(CustomerHealthQuestionsEntity)); if (_customerHealthQuestions != null) { _customerHealthQuestions.AfterSave += new EventHandler(OnEntityAfterSave); } _hafTemplate = (HafTemplateEntity)info.GetValue("_hafTemplate", typeof(HafTemplateEntity)); if (_hafTemplate != null) { _hafTemplate.AfterSave += new EventHandler(OnEntityAfterSave); } base.FixupDeserialization(FieldInfoProviderSingleton.GetInstance()); } // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor // __LLBLGENPRO_USER_CODE_REGION_END }
/// <summary> Removes the sync logic for member _hafTemplate</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 DesetupSyncHafTemplate(bool signalRelatedEntity, bool resetFKFields) { base.PerformDesetupSyncRelatedEntity(_hafTemplate, new PropertyChangedEventHandler(OnHafTemplatePropertyChanged), "HafTemplate", HafTemplateQuestionEntity.Relations.HafTemplateEntityUsingHaftemplateId, true, signalRelatedEntity, "HafTemplateQuestion", resetFKFields, new int[] { (int)HafTemplateQuestionFieldIndex.HaftemplateId }); _hafTemplate = null; }