Ejemplo n.º 1
0
        public Result RemoveInvoiceLine(int invoiceLineId)
        {
            var result = ValidInput2(invoiceLineId);

            if (result.Success)
            {
                var lineItemToRemove = LineItems.Single(i => i.InvoiceLineId == invoiceLineId);
                LineItems.Remove(lineItemToRemove);
            }

            return(result);
        }
Ejemplo n.º 2
0
        public void Handle(StockRequestConfirmedMessage message)
        {
            Process(message, m =>
            {
                var lineItem            = LineItems.Single(li => li.ProductId == m.ProductId);
                lineItem.StockConfirmed = true;

                if (IsCancelled)
                {
                    ReturnStock(lineItem);
                }
                else
                {
                    CheckForSuccess();
                }
            });
        }