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

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