⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 checkout.aspx

📁 visual studio.net学习资料
💻 ASPX
字号:

<!-- ===========================================================================

  Copyright (C) 2000 Microsoft Corporation
  All rights reserved

  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
  OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
  LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND/OR
  FITNESS FOR A PARTICULAR PURPOSE.

  File name: CheckOut.aspx

  Application: Conference registration

  Tested: with IE5.5 / Windows 2000

============================================================================ -->

<%@ Page Language="vb" %>
<%@ Register TagPrefix="Conference" TagName="Header" Src="_Header.ascx" %>
<%@ Register TagPrefix="Conference" TagName="Menu" Src="_Menu.ascx" %>

<script language="VB" runat="server">
           
    '*******************************************************
    '
    ' The Page_Load event on this page is used to load the
    ' ShoppingCart DataGrid *the first time* the page is 
    ' accessed.
    '
    ' Note that subsequent postbacks to the page *do not*
    ' reload the Datagrid.  Instead, we rely on the control's
    ' built-in viewstate management to rebuild the control
    ' on the server.
    '
    ' Other source code to examine:  
    '     Conference.ShoppingCartDB.GetShoppingCartID() Method
    '     Conference.ShoppingCartDB.GetItems() Method
    '
    '*******************************************************
           
    Sub Page_Load(sender As Object, e As EventArgs)    
            
      ' TO DO: Populate datagrid with shopping cart data 
        
    End Sub

    '*******************************************************
    '
    ' The SubmitBtn_Click event handle is used to order the
    ' items within the current shopping cart.  It then
    ' displays the orderid and order status to the screen
    ' (hiding the "SubmitBtn" button to ensure that the
    ' user can't click it twice).
    '
    ' Other source code to examine:  
    '     Conference.ShoppingCartDB.GetShoppingCartID() Method
    '     Conference.OrdersDB.PlaceOrder() Method
    '
    '*******************************************************

    Sub SubmitBtn_Click(sender As Object, e As EventArgs) 

        Dim cart As New Conference.ShoppingCartDB
            
        ' Calculate end-user's shopping cart ID
        Dim cartID as String = cart.GetShoppingCartId()

        ' Calculate end-user's customerID
        Dim customerId as String = User.Identity.Name
            
        If (cartID <> "" And customerID <> "") Then

            ' Place the order            
            Dim ordersDatabase As Conference.OrdersDB = new Conference.OrdersDB()
            Dim orderId As Integer = ordersDatabase.PlaceOrder(customerId, cartId)
              
            'Update labels to reflect the fact that the order has taken place
            Header.Text="Check Out Complete!"
            Message.Text = "<b>Your Order Number Is: </b>" & orderID
            SubmitBtn.Visible = False

        End If
        
    End Sub

</script>

<html>
    <head>
        <link rel="stylesheet" type="text/css" href="Conference.css">
    </head>

    <body background="images/sitebkgrd.gif" leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" marginheight="0" marginwidth="0">

    <!-- HEADER AND MENUS -->

    <table width="100%" border=0>

      <tr><td><Conference:Header runat="server"/></td></tr>
      <tr><td>
          <table width="100%" border=0>
            <tr><td valign="top">
                  <Conference:Menu runat="server"/>
                </td>
                <td>


    <!-- CONTENT -->
                
                    <table height="100%" valign="top" align="left" cellspacing=0 cellpadding=0 width="100%" border=0>
       
                        <tr height="100%" valign="top">
              
                            <td nowrap>
                            
                                <br>
                                
                                <form runat="server">

                                    <img align=left width="32" src="images/1x1.gif">

                                    <table cellspacing=0 cellpadding=0 width="100%" border=0>
                                        <tr>
                                            <td class=ContentHeader>
                                                <img align=left height="32" width="60" src="images/1x1.gif"><asp:Label ID="Header" runat="server">Review and Submit Your Order</asp:label><br>
                                            </td>
                                        </tr>
                                    </table>
                                      
                                    <img align="left" height="1" width="92" src="images/1x1.gif">
                                
                                    <table valign=top height="100%" cellspacing=0 cellpadding=0 width="550" border=0>
                                
                                        <tr valign=top height="100%">
                                        
                                            <td width="100%" class="TextNormal">
                                            
                                                <br>
                                                
                                                <asp:Label ID="Message" runat="server">Please check all the information below to be sure it's correct.</asp:label>
                                                
                                                <br><br>

                                                <asp:DataGrid id="MyDataGrid" runat="server" width="90%" BorderColor="black" GridLines="Vertical" cellpadding="4" cellspacing="0" Font-Name="Verdana" Font-Size="8pt" ShowFooter="True" HeaderStyle-CssClass="cartlistheader" FooterStyle-CssClass="cartlistfooter" ItemStyle-CssClass="CartListItem" AlternatingItemStyle-CssClass="CartListItemAlt" AutoGenerateColumns="False">

                                                    <property name="Columns">
                                                        <asp:BoundColumn HeaderText="Product Name" DataField="ModelName" />
                                                        <asp:BoundColumn HeaderText="Model Number" DataField="ModelNumber" />
                                                        <asp:BoundColumn HeaderText="Quantity" DataField="Quantity" />
                                                        <asp:BoundColumn HeaderText="Price" DataField="UnitCost" DataFormatString="{0:c}" />
                                                        <asp:BoundColumn HeaderText="Subtotal" DataField="ExtendedAmount" DataFormatString="{0:c}" />
                                                    </property>

                                                </asp:DataGrid>

                                                <br><br>
                                                   
                                                <b>Total: </b> <asp:Label ID="TotalLbl" runat="server"/><p>

                                                <!-- Hotel -->  

                                                <br><br>
                                          
                                                <b>Hotel reservation</b><br>                                                  

                                                <a href="hotel_reservation.aspx?HotelID=1">Hotel Full</a>

                                                <br>

						<a href="hotel_reservation.aspx?HotelID=2">Hotel Empty</a>

                                                <br><br>

                                                <asp:button id="SubmitBtn" Text="Submit" OnClick="SubmitBtn_Click" runat="server"/></p>
                                                
                                            </td>
                                        </tr>
                                    </table>
                                </form>
                            </td>
                        </tr>
                    </table>

    <!-- END OF CONTENT -->  

                </td>

             </tr>

          </table>

      </td></tr>

    </table>


    <!-- END OF HEADER AND MENU -->    

    </body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -