示例#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);
        }
示例#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);
        }
示例#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");
            }
        }