Esempio n. 1
0
        private void RegisterMovement(IIngredient ingredient, Measure measure, double quantity, MovementReason reason, string anotherReasonDescription)
        {
            if (reason == MovementReason.Another && string.IsNullOrWhiteSpace(anotherReasonDescription))
            {
                _notifier.Notify("Movement", "'anotherReasonDescription' NO debe estar en blanco si 'reason' es Another", Severity.Error);
                return;
            }

            Movements.Add(new Movement {
                DateTime = DateTime.Now, Ingredient = ingredient, Measure = measure, Quantity = quantity, Reason = reason, AnotherReasonDescription = anotherReasonDescription
            });
        }
Esempio n. 2
0
 public void SubstractIngredientFromStock(IIngredient ingredient, Measure measure, double quantity, MovementReason reason)
 {
     RegisterMovement(ingredient, measure, -quantity, reason, null);
     this.Warehouse.AddToStock(ingredient, measure, -quantity);
 }