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