예제 #1
0
 private static PaymentDTO GeneratePayment(SqlDataReader reader, AccountDTO account, PaymentDTO payment, InvoiceDTO invoice)
 {
     account.SetID(Convert.ToInt32(reader["accountID"]));
     invoice.SetID(Convert.ToInt32(reader["invoiceID"]));
     payment.SetCustomer(account);
     payment.SetInvoice(invoice);
     payment.SetID(Convert.ToInt32(reader["paymentID"]));
     payment.SetID(Convert.ToInt32(reader["amount"]));
     payment.SetPaymentDate(Convert.ToDateTime(reader["paymentDate"]));
     return(payment);
 }
예제 #2
0
 private static ProductSelectionDTO GenerateSelection(SqlDataReader reader, ProductDTO product, InvoiceDTO inv, ProductSelectionDTO selection)
 {
     product.SetId(Convert.ToInt32(reader["productID"]));
     selection.SetID(Convert.ToInt32(reader["selectionID"]));
     selection.SetProduct(product);
     inv.SetID(Convert.ToInt32(reader["invoiceID"]));
     selection.SetInvoice(inv);
     selection.SetOrigPrice(Convert.ToDecimal(reader["originalPrice"]));
     selection.SetOrigSize(Convert.ToInt32(reader["originalSize"]));
     selection.SetQuantity(Convert.ToInt32(reader["quantity"]));
     return(selection);
 }
예제 #3
0
 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);
 }