private static InvoiceDTO GenerateInvoice(SqlDataReader reader, InvoiceDTO invoice, AccountDTO account, ShippmentDTO shipping) { invoice.SetID(Convert.ToInt32(reader["invoiceID"])); account.SetID(Convert.ToInt32(reader["accountID"])); shipping.SetID(Convert.ToInt32(reader["shippingID"])); invoice.SetCustomer(account); invoice.SetShippment(shipping); invoice.SetQuantity(Convert.ToInt32(reader["totalQuantity"])); invoice.SetShippingCost(Convert.ToDecimal(reader["shippingCost"])); invoice.SetTotal(Convert.ToDecimal(reader["totalProductCost"])); invoice.SetTax(Convert.ToDecimal(reader["totalTax"])); invoice.SetTotal(Convert.ToDecimal(reader["totalAmount"])); invoice.SetOrderDate(Convert.ToDateTime(reader["orderDate"])); invoice.SetPaymentDate(Convert.ToDateTime(reader["paymentDate"])); invoice.SetStatus(Convert.ToInt32(reader["paymentStatus"])); invoice.SetEmail(reader["customerMail"].ToString()); invoice.SetArrivalDate(Convert.ToDateTime(reader["arrivalDate"])); invoice.SetPostDate(Convert.ToDateTime(reader["postageDate"])); Debug.Print("InvoiceDAL: Invoice ID " + invoice.GetID()); return(invoice); }