定货信息页面
这个定货信息页面是在用户在Order 页面按下Complete Order(完成定货)按钮之后出现的。它包含两个记录集: OrderConfirm和OrderTotals。这个Session变量OrderID是在Orders.asp页面上创建的,它们都被传递给存储过程。这个OrderConfirm存储过程连接了Orders表格、OrderDetails表格和Customer 表格。这个OrderTotals记录集是计算总的定货。定货信息页面如图25所示。定货信息页面的数据绑定和服务器行为如图26、图27所示。
||||||Email Order SB(电子邮件定货服务器行为)
定货信息页面还包括了E-mail SB,它可以在网页装载的时候发送一个确认电子邮件。这个服务器可以从charon.co.uk/Downloads/EmailOrder.mxp下载。很简单地可以插入SB到定货信息页面并且从你的数据库选择适当的区域即可。电子邮件定货SB对话框如图28所示。
||||||电子邮件定货SB具体代码如下:
Alter Procedure spCustomerOrderDetails
--Date: 11/23/2000
--Author: Rick Curtis
--Task: Receives the value of spInsertOrder from the ASP page and retrieves the correct Order info
@OrderID int
AS
set nocount on
SELECT Orders.OrderID, Orders.OrderDate, Orders.Timekey, Orders.Paid, OrderDetails.ProductID, Products.ProductName, OrderDetails.Price, OrderDetails.Quantity, OrderDetails.Size, OrderDetails.Color, OrderDetails.Total, Orders.Deleted, Customers.FirstName, Customers.LastName, (Customers.FirstName + ' ' + Customers.LastName) AS FullName, Customers.Class, Customers.Room, Customers.Building, (Room + ' ' + Building) AS Address, Customers.City, Customers.State, Customers.PostalCode, Customers.Phone, Customers.Email, Customers.VoiceMail
FROM Orders INNER JOIN OrderDetails
ON Orders.OrderID = OrderDetails.OrderID INNER JOIN
Products ON OrderDetails.ProductID = Products.ProductID INNER JOIN
Customers ON Orders.CustomerID = Customers.CustomerID
WHERE Orders.OrderID = @OrderID
Alter Procedure spOrderTotals
--Date: 11/23/2000
--Author: Rick Curtis
--Task: Calculates Totals from OrderDetails
@OrderID int
As
SELECT Orders.OrderID, SUM(OrderDetails.Price * OrderDetails.Quantity) AS Total, Orders.Freight, Orders.SalesTax, SUM(OrderDetails.Price * OrderDetails.Quantity) + Orders.Freight + Orders.SalesTax AS GrandTotal, COUNT(OrderDetails.ProductID) AS ItemCount FROM Orders INNER JOIN OrderDetails ON Orders.OrderID = OrderDetails.OrderID WHERE Orders.OrderID = @OrderID
GROUP BY Orders.OrderID, Orders.Freight, Orders.SalesTax return
好了,电子商务在中国属于刚刚起步,www.4u2v.com准备这个教材,是希望通过这种方法能帮助你开发更好电子商务网站,这就是本教材的目的。如果您对这有兴趣,请到我们的技术支持中心,www.4u2v.net,我们共同商讨。