All pastes #973457 Raw Edit

Something

public text v1 · immutable
·published 2008-04-06 03:22 UTC
rendered paste body
Imports System.Transactions

Friend Class Orders
    Public Shared Function ProcessFinalSale(ByVal MemberID As Integer, _
                                       ByVal CreditCardNumber As String, _
                                       ByVal PaymentTypeID As Integer, _
                                       ByVal GST As Decimal, _
                                       ByVal SubTotal As Decimal, _
                                       ByVal Cart As DataSet) As Integer

        Dim InvoiceNumber As Integer = -1
        Using scope As New TransactionScope

            InvoiceNumber = Invoices.AddInvoice(MemberID, CreditCardNumber, PaymentTypeID, GST, SubTotal)

            For Each aRow As DataRow In Cart.Tables(0).Rows
                InvoiceDetails.AddInvoiceDetail(InvoiceNumber, aRow("PID"), aRow("Qty"), aRow("Price"))
            Next

            scope.Complete()

        End Using

        Return InvoiceNumber
    End Function
End Class