Hi There.
This is What i am trying to do. I am working on a hotel booking system. I have to be able to place orders of 1 or more items that will be charged to the Room. I am using a ASP front end and a SQL database. I have the controller class, and the data access class done in vb for the .dll. What i need to know is when i pass a record set from the ASP page. What do i need to do in the Businesslogic/workflow layer? I want to open that recordset and get the values so i can pass them to the data access layer. How can i do this in a loop so i get all the records? Once the processing is done in sql, I return a Unit Cost so i can do some processing to return a total cost for that order. The values i am passing to sql are ItemId and Units. Should i do price totaling in SQL or in vb. If in VB how do i do this. Here is the code I am trying. I dont know if it is right.
Public Function PlaceBillableItemOrder(ByVal Order As ADODB.Recordset, ByVal RoomNumber As Integer, ByVal LastName As String) As Currency
Dim MyOrder As BookingBillables
Dim ItemId As Integer
Dim Units As Integer
Dim TempTotal
Set MyOrder = New BookingBillables
While Order.EOF = False
Set ItemId = Order.Fields(ItemId)
Set Units = Order.Units(Units)
Set PlaceBillableItemOrder = MyOrder.PlaceBillableItemOrder(RoomNumber, LastName, ItemId, Units)
Set TempTotal = TempTotal + PlaceBillableItemOrder
Order.MoveNext
wend
Set PlaceBillableItemOrder = TempTotal
Set MyOrder = Nothing
End Function
I need to return a total value for the order to the ASP page. Please help me if you can.
This is What i am trying to do. I am working on a hotel booking system. I have to be able to place orders of 1 or more items that will be charged to the Room. I am using a ASP front end and a SQL database. I have the controller class, and the data access class done in vb for the .dll. What i need to know is when i pass a record set from the ASP page. What do i need to do in the Businesslogic/workflow layer? I want to open that recordset and get the values so i can pass them to the data access layer. How can i do this in a loop so i get all the records? Once the processing is done in sql, I return a Unit Cost so i can do some processing to return a total cost for that order. The values i am passing to sql are ItemId and Units. Should i do price totaling in SQL or in vb. If in VB how do i do this. Here is the code I am trying. I dont know if it is right.
Public Function PlaceBillableItemOrder(ByVal Order As ADODB.Recordset, ByVal RoomNumber As Integer, ByVal LastName As String) As Currency
Dim MyOrder As BookingBillables
Dim ItemId As Integer
Dim Units As Integer
Dim TempTotal
Set MyOrder = New BookingBillables
While Order.EOF = False
Set ItemId = Order.Fields(ItemId)
Set Units = Order.Units(Units)
Set PlaceBillableItemOrder = MyOrder.PlaceBillableItemOrder(RoomNumber, LastName, ItemId, Units)
Set TempTotal = TempTotal + PlaceBillableItemOrder
Order.MoveNext
wend
Set PlaceBillableItemOrder = TempTotal
Set MyOrder = Nothing
End Function
I need to return a total value for the order to the ASP page. Please help me if you can.