Presentation is loading. Please wait.

Presentation is loading. Please wait.

COMP3241 E-Commerce Technologies Richard Henson University of Worcester November 2014.

Similar presentations


Presentation on theme: "COMP3241 E-Commerce Technologies Richard Henson University of Worcester November 2014."— Presentation transcript:

1 COMP3241 E-Commerce Technologies Richard Henson University of Worcester November 2014

2 Week 9: Mechanism of Shopping System, Part 3 n Objectives:  Use a pre-defined control to send data to either the shopping cart or a database, depending on the way the parameters are used  Use a further control to save order data to a database table for use in customer fulfillment  Provide a final link to a payment system that will allow the order to be processed and physically sent to the customer

3 You’ve already achieved a lot: n Database n Scripts n Controls n Connectivity n Just one more step (online order…) and you’ll be there!

4 You’ve designed and created a database containing suitable tables and fields…

5 Used WebXelCart controls to create a “click to buy” system complete with shopping cart

6 (Perhaps…) Used webxelcart controls to complete a login/register customer details system? n If still mystified all should become clear by the end of this lecture…

7 Why all that “Validation” stuff? n Two reasons:  make sure the data is of the right type e.g. telephone number not put in email address text box  make sure only data of the right type gets sent to the cart or database »could get memory overflow… »or failed Database write… »(Neither would impress the customer!)

8 What sort of Button should be used? n Data being presented on a HTML form… n Data being presented on a HTML form… n It should therefore be extracted with a HTML submit button near the bottom of the form… before n It should therefore be extracted with a HTML submit button near the bottom of the form… before  will send the data to a location specified on the form “header” (e.g. runat=“server”)  not to be confused with buttons used to run a small chunk of code

9 What happened to the customer data anyway? n Once you completed the last exercise, you might have expected new order data to be written to the database…  but nothing appeared in “orders” n All the data for the order now resides in the cart:  orderID  customerID  the various aspects of the order needed for the onscreen invoice

10 And the rest of the Data? n What actually happened was that  the order data was written to the cart under the label “orderID”  and the customer details were written to the customers table n The system was not programmed to write order data (yet…) »this won’t happen until they have acknowledge the onscreen order (i.e. they agree to pay…)

11 Why “Save to Cart”? n Data quickly saved locally  and easily accessible when it needs to be extracted »e.g. address fields for screen invoice  If screen invoice not accepted, and “customer” leaves »“customer” data easily removed… »also good for “data protection” – personal data only ever saved to memory

12 Passing the CustomerID Parameter Customer Page WriteToDB scripts Customer ID value sent as e.g. “CustomerID” fields sent To shopping cart Shopping Cart cust data

13 Saving and Displaying the Order n On Screen Invoice is displayed (summary.aspx) n Action only happens when user clicks on “Pay Now”…  Orderdetail Record written  again uses the WriteToDB control  writes “OrderLine” Cart fields to appropriate Table

14 Writing the Order Details to Screen (and Database) Write to DB control Product ID value Shopping Cart Remote DB Contains all data needed to write orderline to disk (with primary key OrderLineID) Customer ID value Screen display Order details

15 More about that multivalue WebXel control property: n Called “field mappings” n You’ve used these a couple of times now:  AddFromDB… populating CartFields from the Products table  WriteToDB… populating CartFields from the customer details form n Either tagged as “Parameters” or “Fields”

16 Using “Field Mappings” with Visual Studio n This feature was intended to take the hard work out of parameter passing…  unfortunately not compatible with Visual Studio “design mode”…  so errors generated!  and “properties” can’t be used the insert values (as they could with “Cart”)  fields could be added as “cartfields” or “databasefields”  need to refer to the WebXel control “help” for exact syntax of controls with “field mappings”

17 Explaining Parameter Passing for a new customer n Customer puts their data into textbox control n Customer presses “submit” button to allow the WriteToDB control to run n Data captured and sent to cart and Database with appropriate fieldnames  CustomerID field essential for both Cart and Customers datatable

18 Converting between DataTypes n Sometimes necessary when passing parameters to change the datatype  known in “C” programming as “casting” n Easy to achieve a cast…  e.g. number to a string would just add.tostring() after the expression  can be used to change data to currency format Variable (integer) Variable (string) Expression plus.tostring()

19 Saving The Order itself n Handled by the WebXelCart:SaveOrder control  works in a similar way to WritetoDB  but writes appropriate cart fields to the ORDERS table n Important differences between WritetoDB and SaveOrder in this coding:  both write cart fields to a database table

20 Payment n Next section presented after invoice has been acknowledged…  would normally transfer through secure connection to a merchant services provider page  once payment has been authorised and taken… »customer returns to “come again soon” page then exits the website »session cookie (i.e. cart) erased

21 The Write Up for assignment 2 (40% of marks; 1150 words)

22 How to Document… n n Projects usually have four phases:   Analysis   Design   Implementation   Evaluation n n Your assignment 2 can be considered to be a mini-project…

23 Analysis n Normally the most important part…  in this case, the analysis has been done for you… n You already know that  you need to produce a shopping cart system from the assignment brief  a payment system doesn’t need to be produced, but there should be a “dummy” payments page

24 Design n This should cover:  web page design  database design  something about the scripts required to interact effectively between: »remote database »local memory storing the cart fields »screen  A test plan…

25 Implementation n Coding n Testing n We’ll talk about this next week… That’s all… for this week


Download ppt "COMP3241 E-Commerce Technologies Richard Henson University of Worcester November 2014."

Similar presentations


Ads by Google