Ejemplo n.º 1
0
        private void FixupProductSubcategory(ProductSubcategory previousValue)
        {
            if (previousValue != null &&
                previousValue.Products.Contains(this))
            {
                previousValue.Products.Remove(this);
            }

            if (ProductSubcategory != null)
            {
                if (!ProductSubcategory.Products.Contains(this))
                {
                    ProductSubcategory.Products.Add(this);
                }
                if (ProductSubcategoryID != ProductSubcategory.ProductSubcategoryID)
                {
                    ProductSubcategoryID = ProductSubcategory.ProductSubcategoryID;
                }
            }
            else if (!_settingFK)
            {
                ProductSubcategoryID = null;
            }
        }
Ejemplo n.º 2
0
        private void FixupProductSubcategory(ProductSubcategory previousValue)
        {
            if (previousValue != null
                && previousValue.Products.Contains(this))
            {
                previousValue.Products.Remove(this);
            }

            if (ProductSubcategory != null)
            {
                if (!ProductSubcategory.Products.Contains(this))
                {
                    ProductSubcategory.Products.Add(this);
                }
                if (ProductSubcategoryID != ProductSubcategory.ProductSubcategoryID)
                {
                    ProductSubcategoryID = ProductSubcategory.ProductSubcategoryID;
                }
            }
            else if (!_settingFK)
            {
                ProductSubcategoryID = null;
            }
        }