Exemple #1
0
        private void SetRents(Invoice invoice)
        {
            List <InvoiceDetail> invoiceDetails = new InvoiceDetailDAO().GetInvoiceDetails(invoiceId: invoice.Id);
            RentDAO rentDAO = new RentDAO();

            foreach (InvoiceDetail invoiceDetail in invoiceDetails)
            {
                try
                {
                    invoice.AddRent(rentDAO.GetRents(id: invoiceDetail.RentId).First());
                }
                catch (InvalidOperationException ex)
                {
                    DebugLog.WriteLine(ex);
                }
            }
        }