Dear Experts,
I have 4 ASP pages. Im using Dreamweaver MX 2004 and SQL Server 2000. The process needs to locate the Customer in the database first, then proceeds with creating order and order details.
1. locate.asp: to search for Customer in the database
Contains a text box to enter Customer ID and a Submit Button
2. Result.asp:
Displays the customer record based on the Customer ID entered
Provides a link to Order.asp page, this link passes the CustomerID to the Order.asp
page
3. Order.asp
Contains a text box for Order Date, a Multiline text field for Order Remarks, a hidden
text box for CustomerID, and a Submit button.
When the Submit button is clicked, it creates a new Order record in the Order table.
Then, after clicking Submit button it takes you to the next page, OrderDetail.asp
4. OrderDetail.asp
This page supposed to capture the OrderID that was created from the last page,
Order.asp.
Contains 11 check boxes labeled with different product names for each check box and
a Submit button.
The value of each check box would be the Product ID for each product.
When the Submit button is clicked, the Order ID and the check box values needs to be inserted into OrderDetails table side by side as multiple records.
The Database structure is as followed:
Customer Table
----------------
CustomerID
LastName
FirstName
Order Table
------------------
OrderID
OrderDate
OrderRemarks
CustomerID
OrderDetails Table
-------------------
OrderDetailsID (auto increment number)
OrderID
ProductID
Product Table
----------------
ProductID
ProductName
Example:
Customer Table
CustomerID LastName FirstName
--------------------------
----------
----
1 John Smith
2 May Lee
3. Peter Williams
Order Table
OrderID OrderDate OrderRemarks CustomerID
--------------------------
----------
----------
----------
---
1 4-1-2007 Important Customer 2
2 4-2-2007 None 1
3 4-3-2007 Urgent! Bluh.. 2
OrderDetails Table
OrderDetailsID OrderID ProductID
--------------------------
----------
----------
------
1 2 3
2 2 5
3 1 4
4 1 2
5 1 3
Product Table
ProductID ProductName
--------------------------
----------
----
1 Pen
2 Box
3 Shirt
4 CD
5 Paper
6 board
My Question is:
On OrderDetail.asp page, How do I capture the OrderID that was created on Order.asp page?
On Order Detail.asp page, How do I insert the OrderID and ProductID into the OrderDetails Table side by side as Multiple records with one submit.
Any suggestion on change in design is welcome. The only thing fixed is The user needs to first find the Customer with CustomerID, then proceeds with making orders.
Would a drop down list box be easier to work with than several check boxes?
Thank you!
Start Free Trial