Esempio n. 1
0
        public void AddProduct(Product product, int quantity, decimal price)
        {
            if (!this.AddProductScopeIsValid(product, quantity, price))
                return;

            Price = price;
            Quantity = quantity;
            Product = product;
            ProductId = product.Id;

            Product.UpdateQuantityOnHand(Product.QuantityOnHand - quantity);
        }
Esempio n. 2
0
        public void AddProduct(Product product, int quantity, decimal price)
        {
            if (!this.AddProductScopeIsValid(product, quantity, price))
            {
                return;
            }

            Price     = price;
            Quantity  = quantity;
            Product   = product;
            ProductId = product.Id;

            Product.UpdateQuantityOnHand(Product.QuantityOnHand - quantity);
        }
Esempio n. 3
0
        public void MarkAsAccomplished()
        {
            Accomplished = DateTime.Now;
            Status       = MovementStatus.Accomplished;

            switch (TypeOfMovement)
            {
            case MovementType.Entry:
                Product.UpdateQuantityOnHand(Product.QuantityOnHand + Amount);
                break;

            case MovementType.Exit:
                Product.UpdateQuantityOnHand(Product.QuantityOnHand - Amount);
                break;

            default:
                throw new InvalidOperationException("Tipo de movimentação inválida");
            }
        }