0
|
1 <%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="CheckOut.aspx.cs" Inherits="PetShop.Web.CheckOut" Title="Check Out" %>
|
|
2 <%@ Register Src="Controls/CartList.ascx" TagName="CartList" TagPrefix="PetShopControl" %>
|
|
3 <%@ Register Src="Controls/AddressConfirm.ascx" TagName="AddressConfirm" TagPrefix="PetShopControl" %>
|
|
4 <%@ Register Src="Controls/AddressForm.ascx" TagName="AddressForm" TagPrefix="PetShopControl" %>
|
|
5
|
|
6 <asp:Content ID="cntPage" ContentPlaceHolderID="cphPage" Runat="Server" EnableViewState="false">
|
|
7 <div align="center" class="checkoutPosition">
|
|
8
|
|
9 <script type="text/javascript" language="javascript">
|
|
10 function ClientValidate(source, arguments)
|
|
11 {
|
|
12 var dtNow = new Date();
|
|
13 var tmp = new String(arguments.Value);
|
|
14 var dtCard = new Date();
|
|
15
|
|
16 dtCard.setFullYear(tmp.split("/")[1]);
|
|
17 dtCard.setMonth (tmp.split("/")[0]-1);
|
|
18 dtCard.setDate(30);
|
|
19
|
|
20 arguments.IsValid = dtNow < dtCard;
|
|
21 }
|
|
22 </script>
|
|
23
|
|
24 <table border="0" cellpadding="0" cellspacing="0" class="checkoutContent" width="100%">
|
|
25 <tr>
|
|
26 <td>
|
|
27 <div class="label">
|
|
28 <asp:Label ID="lblMsg" runat="server" EnableViewState="false"></asp:Label>
|
|
29 </div>
|
|
30 <asp:Wizard ID="wzdCheckOut" runat="server"
|
|
31 DisplaySideBar = "False"
|
|
32 OnActiveStepChanged = "wzdCheckOut_ActiveStepChanged"
|
|
33 OnFinishButtonClick = "wzdCheckOut_FinishButtonClick"
|
|
34 SkinID = "wzdCheckOut">
|
|
35 <WizardSteps>
|
|
36 <asp:WizardStep ID="wzdStep1" runat="server" Title="Billing Address">
|
|
37 <asp:Panel ID="panFicusStep1" runat="server" DefaultButton="StartNextButton">
|
|
38 <PetShopControl:AddressForm ID="billingForm" runat="server" />
|
|
39 <table border="0" cellpadding="0" cellspacing="0" class="checkoutButtonBg" width="100%">
|
|
40 <tr>
|
|
41 <td></td>
|
|
42 <td align="right">
|
|
43 <asp:LinkButton ID="StartNextButton" runat="server"
|
|
44 CommandName = "MoveNext"
|
|
45 CssClass = "continue"
|
|
46 Text = "Next" />
|
|
47 </td>
|
|
48 </tr>
|
|
49 </table>
|
|
50 </asp:Panel>
|
|
51 </asp:WizardStep>
|
|
52 <asp:WizardStep ID="wzdStep2" runat="server" Title="Shipping Address">
|
|
53 <asp:Panel ID="panFicusStep2" runat="server" DefaultButton="StepNextButton">
|
|
54 <div class="checkOutLabel">
|
|
55 <asp:CheckBox ID="chkShipToBilling" runat="server"
|
|
56 AutoPostBack = "True"
|
|
57 OnCheckedChanged = "chkShipToBilling_CheckedChanged"
|
|
58 Text = "Ship to billing address" />
|
|
59 </div>
|
|
60 <PetShopControl:AddressForm ID="shippingForm" runat="server" />
|
|
61 <table border="0" cellpadding="0" cellspacing="0" class="checkoutButtonBg" width="100%">
|
|
62 <tr>
|
|
63 <td align="left">
|
|
64 <asp:LinkButton ID="StepPreviousButton" runat="server"
|
|
65 CausesValidation = "False"
|
|
66 CommandName = "MovePrevious"
|
|
67 CssClass = "back"
|
|
68 Text = "Previous" />
|
|
69 </td>
|
|
70 <td align="right">
|
|
71 <asp:LinkButton ID="StepNextButton" runat="server"
|
|
72 CommandName = "MoveNext"
|
|
73 CssClass = "continue"
|
|
74 Text = "Next"/>
|
|
75 </td>
|
|
76 </tr>
|
|
77 </table>
|
|
78 </asp:Panel>
|
|
79 </asp:WizardStep>
|
|
80 <asp:WizardStep ID="wzdStep3" runat="server" Title="Payment Information">
|
|
81 <asp:Panel ID="panFicusStep3" runat="server" DefaultButton="StepNextButton2">
|
|
82 <table border="0" cellpadding="0" cellspacing="0">
|
|
83 <tr>
|
|
84 <td class="label">Credit Card Number<br />
|
|
85 <asp:TextBox ID="txtCCNumber" runat="server" CssClass="checkoutTextbox" Width="330px">4444123412341234</asp:TextBox><br />
|
|
86 <asp:RequiredFieldValidator ID="valCCNumber" runat="server"
|
|
87 ControlToValidate = "txtCCNumber"
|
|
88 Display = "Dynamic"
|
|
89 ErrorMessage = "Please enter card number." />
|
|
90 <asp:RegularExpressionValidator ID="valCCNumber1" runat="server"
|
|
91 ControlToValidate="txtCCNumber"
|
|
92 Display = "Dynamic"
|
|
93 ErrorMessage = "Card number invalid."
|
|
94 ValidationExpression = "^([0-9]{15,16})$" /> </td>
|
|
95 </tr>
|
|
96 <tr>
|
|
97 <td class="label">Expiration Date (MM/YYYY)<br />
|
|
98 <asp:TextBox ID="txtExpDate" runat="server" CssClass="checkoutTextbox" Width="155px">12/2009</asp:TextBox><br />
|
|
99 <asp:RequiredFieldValidator ID="valExpDate" runat="server"
|
|
100 ControlToValidate="txtExpDate"
|
|
101 Display="Dynamic"
|
|
102 ErrorMessage="Please enter expiration date." />
|
|
103 <asp:RegularExpressionValidator ID="valExpDate1" runat="server"
|
|
104 ControlToValidate = "txtExpDate"
|
|
105 ErrorMessage = "Invalid date format."
|
|
106 ValidationExpression = "^((0[1-9])|(1[0-2]))\/(\d{4})$"
|
|
107 Display = "Dynamic" />
|
|
108 <asp:CustomValidator ID="valExpDate2" runat="server"
|
|
109 ClientValidationFunction = "ClientValidate"
|
|
110 ControlToValidate = "txtExpDate"
|
|
111 Display = "Dynamic"
|
|
112 ErrorMessage = "Expiration date invalid."
|
|
113 OnServerValidate = "ServerValidate" />
|
|
114 </td>
|
|
115 </tr>
|
|
116 <tr>
|
|
117 <td class="label">Credit card Type<br />
|
|
118 <asp:DropDownList ID="listCCType" runat="server" CssClass="checkoutDropdown">
|
|
119 <asp:ListItem>Visa</asp:ListItem>
|
|
120 <asp:ListItem>Master Card</asp:ListItem>
|
|
121 <asp:ListItem>American Express</asp:ListItem>
|
|
122 <asp:ListItem>Discovery</asp:ListItem>
|
|
123 </asp:DropDownList>
|
|
124 </td>
|
|
125 <td> </td>
|
|
126 </tr>
|
|
127 </table>
|
|
128 <p> </p>
|
|
129 <table border="0" cellpadding="0" cellspacing="0" class="checkoutButtonBg" width="100%">
|
|
130 <tr>
|
|
131 <td align="left">
|
|
132 <asp:LinkButton ID="LinkButton1" runat="server"
|
|
133 CausesValidation="False"
|
|
134 CommandName="MovePrevious"
|
|
135 CssClass="back" Text="Previous" />
|
|
136 </td>
|
|
137 <td align="right">
|
|
138 <asp:LinkButton ID="StepNextButton2" runat="server"
|
|
139 CommandName="MoveNext"
|
|
140 CssClass="continue" Text="Next" />
|
|
141 </td>
|
|
142 </tr>
|
|
143 </table>
|
|
144 </asp:Panel>
|
|
145 </asp:WizardStep>
|
|
146 <asp:WizardStep ID="wzdStep4" runat="server" StepType="Finish" Title="Confirmation">
|
|
147 <asp:Panel ID="panFicusStep4" runat="server" DefaultButton="FinishButton">
|
|
148 <div class="checkOutLabel">
|
|
149 Your order will not be processed until you select "Submit Order" below.<br /><br />
|
|
150 <strong>Billing address:<br /></strong>
|
|
151 <PetShopControl:AddressConfirm ID="billingConfirm" runat="server" /><br />
|
|
152 <strong>Shipping address:<br /></strong>
|
|
153 <PetShopControl:AddressConfirm ID="shippingConfirm" runat="server"/>
|
|
154 </div>
|
|
155 <div class="checkOutLabel">
|
|
156 A total of <span class="labelBold">
|
|
157 <asp:Literal ID="ltlTotal" runat="server"></asp:Literal></span> will be charged to your credit card, ending with <span class="labelBold">
|
|
158 <asp:Literal ID="ltlCreditCard" runat="server"></asp:Literal></span>.
|
|
159 </div>
|
|
160 <table border="0" cellpadding="0" cellspacing="0" class="checkoutButtonBg" width="100%">
|
|
161 <tr>
|
|
162 <td align="left">
|
|
163 <asp:LinkButton ID="FinishPreviousButton" runat="server"
|
|
164 CausesValidation = "False"
|
|
165 CommandName = "MovePrevious"
|
|
166 CssClass = "back"
|
|
167 Text = "Previous" />
|
|
168 </td>
|
|
169 <td align="right">
|
|
170 <asp:LinkButton ID="FinishButton" runat="server"
|
|
171 CommandName = "MoveComplete"
|
|
172 CssClass = "submit"
|
|
173 Text = "Submit Order" />
|
|
174 </td>
|
|
175 </tr>
|
|
176 </table>
|
|
177 </asp:Panel>
|
|
178 </asp:WizardStep>
|
|
179 <asp:WizardStep ID="wzdStep5" runat="server" AllowReturn="False" StepType="Complete" Title="Receipt">
|
|
180 <div class="checkOutLabel">
|
|
181 Thank you for your order!<br /><br />
|
|
182 <PetShopControl:CartList ID="CartListOrdered" runat="server" />
|
|
183 <br />
|
|
184 <p>
|
|
185 A total of <strong><asp:Literal ID="ltlTotalComplete" runat="server" /></strong>
|
|
186 is being charged to your credit card, ending with
|
|
187 <strong><asp:Literal ID="ltlCreditCardComplete" runat="server"></asp:Literal></strong>.
|
|
188 </p>
|
|
189 <p>If you have any questions regarding this order, please contact our customer service at anytime.</p>
|
|
190 <p>The .NET Pet Shop Team</p>
|
|
191 </div>
|
|
192 </asp:WizardStep>
|
|
193 </WizardSteps>
|
|
194 <HeaderStyle HorizontalAlign="Left" />
|
|
195 <HeaderTemplate><%= wzdCheckOut.ActiveStep.Title %></HeaderTemplate>
|
|
196 <StartNavigationTemplate></StartNavigationTemplate>
|
|
197 <StepNavigationTemplate></StepNavigationTemplate>
|
|
198 <FinishNavigationTemplate></FinishNavigationTemplate>
|
|
199 </asp:Wizard>
|
|
200 </td>
|
|
201 </tr>
|
|
202 </table>
|
|
203
|
|
204 </div>
|
|
205 </asp:Content>
|
|
206
|