Example #1
0
        public void AddLineItem(PurchaseOrderLineItem item)
        {
            if (!IsInBudget(item))
            {
                throw new InvalidOperationException("Item exceeds budget");
            }

            LineItems.Add(item);
        }
Example #2
0
 public bool IsInBudget(PurchaseOrderLineItem item)
 {
     return(item.Total + TotalSpent <= MaxValue);
 }