Exemple #1
0
        public virtual void AddSubstance(ISubstance substance, int sortOrder, IUnitValue quanity)
        {
            if (ContainsSubstance(substance))
            {
                return;
            }

            _substances.Add(ProductSubstance.Create(sortOrder, this, (Substance)substance, (UnitValue)quanity));
        }
Exemple #2
0
        public virtual void AddSubstance(ProductSubstance substance)
        {
            if (GetSubstances().Contains(substance))
            {
                return;
            }

            GetSubstances().Add(substance);
            substance.Substance.AddProduct(this);
        }
Exemple #3
0
            public ProductRouteCreate Substance(int sortorder, Substance substance, decimal quantity, Unit unit)
            {
                var qty   = new UnitValue(quantity, unit);
                var subst = ProductSubstance.Create(sortorder, _product, substance, qty);

                _product.AddSubstance(subst);

                var product = _product;

                _product = null;
                return(new ProductRouteCreate(product));
            }