Пример #1
0
        public void AddEntry(InvoiceEntry entry)
        {
            if (Entries.Contains(entry))
            {
                throw new Exception("Trying to add same entry twice");
            }

            Entries.Add(entry);
        }
Пример #2
0
        public void AddEntry(InvoiceEntry entry)
        {
            if (!Invoices.ContainsKey(entry.InvoiceId))
            {
                AddInvoice(new Invoice
                {
                    ClientId  = Id,
                    InvoiceId = entry.InvoiceId,
                    Date      = entry.Date
                });
            }

            Invoices[entry.InvoiceId].AddEntry(entry);
        }