Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSCI 4230 Homework #3 Group Three Samer Al Jefri * Kevin Odom * David Hood * JD * Phil.

Similar presentations


Presentation on theme: "CSCI 4230 Homework #3 Group Three Samer Al Jefri * Kevin Odom * David Hood * JD * Phil."— Presentation transcript:

1 CSCI 4230 Homework #3 Group Three Samer Al Jefri * Kevin Odom * David Hood * JD * Phil

2 SITE WALKTHROUGH Section One:

3

4 USER INTERFACE DESIGN Section Two:

5 Phase II Design Elements (#1) Home Page (#2) Phase III Navigation (#2)

6 SITE REQUIREMENTS & IMPLEMENTATION OF CODE Section Three:

7 Sign-in Page Sign-in Components Use Valid E-mail Address Store Info In Session Initiate Shopping Session Return To Previous Page

8 Input Field Validation Controls <asp:RegularExpressionValidator ID="loginRegExValidator" runat="server" ControlToValidate="txtUserName" ErrorMessage="Please, enter a valid email address." ValidationExpression="^\w+[\w\.]*\@(\w+\.)+((com)|(net)|(org)|(edu))$" /> Submission Button

9 protected void cmdLogin_Click(object sender, EventArgs e) { //Clear session for new user Session.Clear(); //Save the user id to the Session Session["userID"] = txtUserName.Text; // Goto default page unless a different path is requested string path = "Default.aspx"; if (Request.Params["returnTo"] != null) { path = Request.Params["returnTo"]; } Response.Redirect(path); }

10 Shipping Page Shipping Components Remove Leading & Trailing Whitespace Reject Invalid Characters From Input Ensure Input Length is Reasonable Use Server-side Code For Field Validation

11 Input Field Validation Controls <asp:RequiredFieldValidator ID="nameRequiredFieldValidator" runat="server" ErrorMessage="Required“ ControlToValidate="txtName“ Display="Dynamic"/> <asp:RegularExpressionValidator ID="nameRegExValidator" runat="server" ErrorMessage="Please only enter letters, numbers, spaces, or periods." ControlToValidate="txtName“ ValidationExpression="\s*[a-zA-Z\s\.]+\s*" Display="Dynamic" /> <asp:RegularExpressionValidator ID="nameRegExFirstLast" runat="server" Display="Dynamic" ErrorMessage="Please enter a first and last name, no middle names" ControlToValidate="txtName“ ValidationExpression="\s*[A-Za-z]+\s+[A-Za-z]+\s*" />

12 <asp:RegularExpressionValidator ID="street1RegExValidator" runat="server" ErrorMessage="Please enter a street number and name“ ControlToValidate="txtStreet1“ ValidationExpression="^\d+\s+[A-Za-z\s\.]+“ Display="Dynamic" /> <asp:RequiredFieldValidator ID="zipRequiredFieldValidator" runat="server“ ErrorMessage="Required“ ControlToValidate="txtZip“ Display="Dynamic" /> <asp:RegularExpressionValidator ID="zipRegExValidator" runat="server" ErrorMessage="Please enter in the form of #####.“ ControlToValidate="txtZip“ ValidationExpression="^\d{5}\s*$“ Display="Dynamic" />

13 protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Page.Form.DefaultFocus = txtName.ClientID; Page.Form.DefaultButton = cmdShipFormSubmit.UniqueID; // Populate fields with existing shipping info if (Session["ShippingData"] != null) { ShippingData shipping = (ShippingData)Session["ShippingData"]; txtName.Text = shipping.FullName; txtStreet1.Text = shipping.Street1; txtStreet2.Text = shipping.Street2; txtCity.Text = shipping.City; ddState.SelectedValue = shipping.State; txtZip.Text = shipping.Zip; }}}

14 protected void cmdShipFormSubmit_Click(object sender, EventArgs e) { //check for valid page if (!Page.IsValid) { return; } ShippingData shipping = new ShippingData(); shipping.FullName = txtName.Text.ToString(); shipping.Street1 = txtStreet1.Text.ToString(); shipping.Street2 = txtStreet2.Text.ToString(); shipping.City = txtCity.Text.ToString(); shipping.State = ddState.SelectedValue.ToString(); shipping.Zip = txtZip.Text.ToString(); Session["ShippingData"] = shipping; Response.Redirect("Checkout.aspx"); }

15 Invalid Submission

16 Phase III DATABASE ACCESS & SESSION TRACKING SLIDES HERE (1, 3, 4, and 5 – David) (6, 7, and 8 – Samer)

17 David Hood Default Page * Sign-in Page * Shopping Cart * CartData class

18 The CartData Class Static Methods –getCartFromSession() –saveCartToSession() Public Methods –addItem() –removeItem() –reset() –setQuantity() –getTotal() –exists() –getCartTable()

19 Default Page User Not Logged In User Logged in

20 Default Page Login Restriction Returns Boolean value indicating if user is logged in.

21 Default Page Adding an item to the cart

22 The Shopping Cart

23 Cart GridView control binding

24 COLLABORATION & DEVELOPMENT TOOLS Section Four:

25 Team Web Site, Yahoo Groups, and Google Code slides here


Download ppt "CSCI 4230 Homework #3 Group Three Samer Al Jefri * Kevin Odom * David Hood * JD * Phil."

Similar presentations


Ads by Google