Exemplo n.º 1
0
        private void FixupProductGroup(ProductGroup previousValue)
        {
            if (previousValue != null && previousValue.Products.Contains(this))
            {
                previousValue.Products.Remove(this);
            }

            if (ProductGroup != null)
            {
                if (!ProductGroup.Products.Contains(this))
                {
                    ProductGroup.Products.Add(this);
                }
                if (ProductGroupId != ProductGroup.Id)
                {
                    ProductGroupId = ProductGroup.Id;
                }
            }
        }
Exemplo n.º 2
0
        private void FixupParentGroup(ProductGroup previousValue)
        {
            if (previousValue != null && previousValue.Children.Contains(this))
            {
                previousValue.Children.Remove(this);
            }

            if (ParentGroup != null)
            {
                if (!ParentGroup.Children.Contains(this))
                {
                    ParentGroup.Children.Add(this);
                }
                if (ProductGroupId != ParentGroup.Id)
                {
                    ProductGroupId = ParentGroup.Id;
                }
            }
        }