608 Project 5 CREATING A WEB PORTAL FOR A BOOKSTORE
Table 27-6 Structure of the BWOrders Table
Column Name |
Data Type |
|
|
Length |
Allow Nulls |
ISBNNo |
char |
|
|
|
10 |
0 |
OrderNo |
char |
|
|
|
5 |
0 |
DateOfOrder |
datetime |
|
|
|
8 |
0 |
CustomerName |
varchar |
|
|
Y |
0 |
|
|
|
50 |
CustomerAddress1 |
varchar |
|
L |
0 |
CustomerAddress2 |
varchar |
F |
50 |
0 |
|
|
|
CustomerCity |
varchar |
|
|
|
20 |
0 |
CustomerState |
A |
|
|
20 |
0 |
varchar |
|
|
|
RequestedBy |
E |
|
|
|
20 |
0 |
varchar |
|
|
|
Status |
T |
|
|
|
20 |
0 |
varcharM |
|
CreditCardType |
char |
|
|
|
10 |
0 |
CreditCardNumber |
varchar |
|
|
|
20 |
0 |
|
|
|
|
|
|
|
Similar to the Status and OrderedBy fields of the DTOrders table, the Status and RequestedBy fields of the BWOrders table store the status of delivery of the book and the details of the retailer who ordered for the book, respectively.
In addition, the BWOrders table contains the credit card information of the customer who orders for a book on the Web site of Bookers Paradise.
Database Schema
Having created the design of the tables of Bookers Paradise, Deepthoughts Publications and Black and White Publications, you need to establish relationships between the tables of the organizations. Based on these relationships, a detailed database schema is created. I will first discuss the relationships between the tables of Bookers Paradise.
PROJECT CASE STUDY AND DESIGN |
Chapter 27 |
609 |
|
|
|
|
The Relationships between the Tables of Bookers Paradise
The relationships between the tables of Bookers Paradise are shown in Figure 27-1.
FIGURE 27-1 Database schema for Bookers Paradise
Table 27-7 explains the relationships between the tables of Bookers Paradise shown in Figure 27-1.
Table 27-7 Relationships in the Tables of Bookers Paradise Database
Table1 |
Table2 |
Type |
Description |
BookerCustDetails |
BookersOrders |
One-to-many |
One customer can place one or |
|
|
|
more orders. However, one |
|
|
|
order can contain orders from |
|
|
|
only one customer. |
|
|
|
|
610 Project 5 CREATING A WEB PORTAL FOR A BOOKSTORE
The Relationships between the Tables of Deepthoughts Publications
The relationships between the tables of Deepthoughts Publications are explained in Table 27-8.
Table 27-8 Relationships in the Tables of Deepthoughts Publications Database
Table1 |
Table2 |
Type |
Description |
DTCatalog |
DTOrders |
Many-to-many |
One order can be placed for one |
|
|
|
book. However, one order can |
|
|
|
contain one or more books. |
|
|
|
|
This relationship is shown in Figure 27-2.
FIGURE 27-2 Database schema for Deepthoughts Publications
The Relationships between the Tables of Black and White Publications
The relationships between the tables of Black and White Publications are similar to those of Deepthoughts Publications. Figure 27-3 shows the relationships of Black and White Publications.
PROJECT CASE STUDY AND DESIGN |
Chapter 27 |
611 |
|
|
|
|
FIGURE 27-3 Database schema for Black and White Publications
The relationships shown in Figure 27-3 are explained in Table 27-9.
Table 27-9 Relationships in the Tables of Black and White Publications Database
Table1 |
Table2 |
Type |
Description |
BWCatalog |
BWOrders |
One-to-many |
One order can be placed for one |
|
|
|
book. However, one order can |
|
|
|
contain one or more books. |
|
|
|
|
After you finalize the database schema, you can finalize the interface of your application. Finalizing the interface of the application includes deciding on the Web forms to be included in the application.This will help the development team to have a framework to work on.
Web Forms Design
The Web site for Bookers Paradise includes five forms, the Main form, the Results form, the Orders form, the Search form, and the Construction form.The following section discusses these forms in detail.
612 Project 5 CREATING A WEB PORTAL FOR A BOOKSTORE
TIP
In this chapter, I will only detail the layout of these forms. You will learn to create these forms in Chapter 30, “Developing Web Service Clients.”
The Main Form
The Main form is the first form displayed when a user visits the site of Bookers Paradise. This form is the home page of the site of Booker’s Paradise. The Main form consists of one button control, five hyperlink controls, one list control, one text box control, and two table controls. After adding these controls to the form, you need to change the properties of these controls. You will learn to change the properties of the controls in Chapter 30.
Once the controls are added to the form, the Main form looks as shown in Figure 27-4.
FIGURE 27-4 The layout of the Main form
The Main form allows you to search for information about all the books or only books based on criteria. When the user selects the criteria and clicks on the Go button in the Main form, the Results page is displayed.
PROJECT CASE STUDY AND DESIGN |
Chapter 27 |
|
613 |
|
|
|
|
|
|
The Results Form
The Results form shows the result of the search performed by the user. In addition, the Results page allows the user to order a book. The Results page includes a data grid, a label, and a hyperlink control.
To add these controls to the form, drag the controls from the Web Forms toolbox. When the controls are added, the Results form looks as shown in Figure 27-5.
FIGURE 27-5 The layout of the Results form
In the Results page, the user can choose a book to order. To order a book, a user needs to click on the Order button.This takes the user to the Orders page.
The Orders Form
The Orders form accepts details of the user who wishes to order a book on the Web site of Booker’s Paradise. Figure 27-6 shows the layout of the Orders form.
614 Project 5 CREATING A WEB PORTAL FOR A BOOKSTORE
FIGURE 27-6 The layout of the Orders form
As you can see in Figure 27-6, the Orders form includes 1 button control, 2 hyperlink controls, 12 label controls, 1 list control, 5 RequiredFieldValidator controls, and 10 text box controls.
The Search Form
The Main form in the site of Booker’s Paradise allows a user to select criteria to search for a book. When a user selects criteria in the list box, the user needs to specify a value for the criteria. In case the user forgets to specify a value, the user is taken to the Search page.
The Search page prompts the user to specify the criteria and a value for the criteria. To do this, the Search page includes a label control, two button controls, four radio buttons, and four text box controls.
Figure 27-7 shows the layout of the Search form.
PROJECT CASE STUDY AND DESIGN |
Chapter 27 |
615 |
|
|
|
|
FIGURE 27-7 The layout of the Search form
The Construction Form
The Main form, as you saw in Figure 27-4, includes hyperlink controls. When a user clicks on any of the hyperlink controls, the user is taken to the Construction page. Figure 27-8 shows the Construction page.
FIGURE 27-8 The layout of the Construction form
616 Project 5 CREATING A WEB PORTAL FOR A BOOKSTORE
The Construction form contains a hyperlink control and two label controls. The hyperlink on the Construction page takes you to the Main form.
Flowcharts for the Web Forms Modules
After seeing the design of all the forms in the Web client application for Booker’s Paradise, you can create the flowcharts for these forms. This will help you understand the working of the client application, making it easier for you to write the code for the client application. To begin, create a flowchart for the Main form, which is the home page for the Web site.
Flowchart for the Main Form
In the Main page, the user selects criteria, specifies a value for the criteria, and queries for the information based on the criteria. In addition, the user may choose to click on any of the hyperlinks on the Main form. Based on this functionality, a flowchart for the Main form is created. Figure 27-9 shows the flowchart for the Main form.
FIGURE 27-9 The flowchart for the Main for m
PROJECT CASE STUDY AND DESIGN |
Chapter 27 |
617 |
|
|
|
|
Flowchart for the Results Form
The Results form allows a user to select a book to order. Based on this, the flowchart for the Results page is shown in Figure 27-10.
FIGURE 27-10 The flowchart for the Results for m
Flowchart for the Orders Form
The Orders page accepts the information about the customer and passes this information to the database of the publisher. In addition, the information about the book that is ordered is passed to the database of the publisher. To do this, the Orders form works as shown in Figure 27-11.
FIGURE 27-11 The flowchart for the O rders form