Пример #1
0
		/// <summary> Removes the sync logic for member _categories</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 DesetupSyncCategories(bool signalRelatedEntity, bool resetFKFields)
		{
			this.PerformDesetupSyncRelatedEntity( _categories, new PropertyChangedEventHandler( OnCategoriesPropertyChanged ), "Categories", NW26.RelationClasses.StaticProductsRelations.CategoriesEntityUsingCategoryIdStatic, true, signalRelatedEntity, "Products", resetFKFields, new int[] { (int)ProductsFieldIndex.CategoryId } );
			_categories = null;
		}
Пример #2
0
		/// <summary> setups the sync logic for member _categories</summary>
		/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
		private void SetupSyncCategories(IEntityCore relatedEntity)
		{
			if(_categories!=relatedEntity)
			{
				DesetupSyncCategories(true, true);
				_categories = (CategoriesEntity)relatedEntity;
				this.PerformSetupSyncRelatedEntity( _categories, new PropertyChangedEventHandler( OnCategoriesPropertyChanged ), "Categories", NW26.RelationClasses.StaticProductsRelations.CategoriesEntityUsingCategoryIdStatic, true, new string[] {  } );
			}
		}
Пример #3
0
		protected ProductsEntity(SerializationInfo info, StreamingContext context) : base(info, context)
		{
			if(SerializationHelper.Optimization != SerializationOptimization.Fast) 
			{
				_orderDetails = (EntityCollection<OrderDetailsEntity>)info.GetValue("_orderDetails", typeof(EntityCollection<OrderDetailsEntity>));
				_categories = (CategoriesEntity)info.GetValue("_categories", typeof(CategoriesEntity));
				if(_categories!=null)
				{
					_categories.AfterSave+=new EventHandler(OnEntityAfterSave);
				}
				_suppliers = (SuppliersEntity)info.GetValue("_suppliers", typeof(SuppliersEntity));
				if(_suppliers!=null)
				{
					_suppliers.AfterSave+=new EventHandler(OnEntityAfterSave);
				}
				this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance());
			}
			// __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
			// __LLBLGENPRO_USER_CODE_REGION_END
			
		}