Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Project 6: Northwind Orders. 2 The Northwind Traders Database The Northwind Traders database was created by Microsoft for training and demonstration.

Similar presentations


Presentation on theme: "1 Project 6: Northwind Orders. 2 The Northwind Traders Database The Northwind Traders database was created by Microsoft for training and demonstration."— Presentation transcript:

1 1 Project 6: Northwind Orders

2 2 The Northwind Traders Database The Northwind Traders database was created by Microsoft for training and demonstration purposes. There are 13 tables in the database In this project we are only concered with three of them. And only a few of the columns in those three tables.

3 The Northwind Traders Database You will need to create the tables of the Northwind Traders Database in your local database. For how to do this, see: http://www.cse.usf.edu/~turnerr/Web_Application_Design/ 150_Northwind_Traders_Database.pdf http://www.cse.usf.edu/~turnerr/Web_Application_Design/ 150_Northwind_Traders_Database.pdf 3

4 4 Northwind Traders Database These are the tables that we will use.

5 5 Table Customers In table Customers, we will be concerned with CustomerID and CompanyName. CustomerID is the primary key.

6 6 Table Orders Table Orders has a row for each order that has been entered. The customer for each order is identified by the CustomerID column. This is the same CustomerID that appears in the CustomerID column of table Customers.

7 Table Order Details 7 Table Order Details has a row for each line item of each order in table Orders. The OrderID identifies the order to which the Order Detail applies.

8 Table Order Details The table name consists of two words. You will need to enclose the name in square brackets when you refer to it in a SQL query. Example: select * from [order details] Try it for yourself! 8

9 9 Assignment Write an ASP.NET app that permits the user to determine the total value of all orders that have been entered for a specified customer. The user identifies a customer by typing the first few letters of the CompanyName (not CustomerID) into a TextBox.

10 10 Requirements If there are multiple customers whose CompanyName matches the letters entered by the user, the app will display a DropDownList with those companies' names as choices. The user can then select the company from the DropDownList. If there is only one company whose CompanyName matches the letters entered by the user, that company is immediately selected. The DropDown list is empty and disabled. If no company matches, the app displays an error message.

11 11 Requirements When the user has uniquely identified a company, the app determines the total value of all orders in the database for that company and displays the result. Total value of each oder item is the amount that Northwind Traders billed the customer: UnitPrice * Quantity – Discount Amount Column Discount in table Order Details is a fraction of UnitPrice * Quantity Discount Amount is Discount * (UnitPrice * Quantity)

12 Computing Total Value Cost calculations should be done in dollars and cents, like an accountant would do with a calculator. Intermediate results should be in Decimal with two decimal places. It is OK to use integer types in cost calculations. Use Decimal for anything that can have a fractional value. Example: Decimal base_cost = Decimal.Round(UnitPrice*Quantity, 2); Decimal discount_amt = Decimal.Round(base_cost*(Decimal)Discount, 2); Decimal net_cost = base_cost - discount_amt ; 12

13 13 Initial Page User enters one or more initial letters of company name.

14 14 After user has entered initial letters User presses Tab or Enter, or clicks outside the TextBox.

15 15 After tabbing out of the TextBox User can select a company name from the drop down list.

16 16 Selecting from the DropDownList User selects an item from the DropDownList.

17 17 Result Displayed App displays the total value of orders for the selected customer. User can now select another customer from the DropDownList or enter new initial letters into the TextBox.

18 18 User selects another customer from the DropDownList.

19 19 New Result App displays total value of orders for newly selected customer.

20 20 User enters letters that uniquely identify a customer. When user tabs out of the TextBox, app immediately displays total value of orders from that customer. DropDownList is empty and disabled.

21 21 User enters letters with no matching customer name. App displays error message. DropDownList is empty and disabled.

22 22 User Resizes Browser Window

23 23 User Resizes Browser Window Page content remains centered.

24 24 Requirements Page layout should match the examples. Use CSS styling as shown and discussed in class.

25 25 Requirements Cursor should be in the TextBox when the page is initially shown on the browser. User can start typing immediately without having to click on the TextBox. Remove any leading and trailing spaces from the text that the user enters before looking for matching company names. See C# string class Trim method. When the user tabs out of the TextBox after making a change, any previous output disappears. If there are no non-space characters in the TextBox, nothing more happens. Don't look for matches to a zero length string.

26 26 Requirements DropDownList has a dummy initial item "Select Customer". If user selects that item, any previous output disappears, but nothing else should happen. DropDownList is unchanged.

27 27 Design Matters Apply the principles of object oriented design that have been shown and discussed in class. Define classes for Customer, Order, and OrderDetail. Use objects of these classes where that information is needed. Projects will be graded on software design as well as functionality.

28 28 Submission Submit your web site files via Canvas Assignments. Zip your web site folder using the Windows “Send to Compressed Folder” command. Submit the.zip file

29 29 Ground Rules You may work with one or two other students. OK to work alone if you prefer. If you do collaborate All group members are expected to contribute. Only one group member should submit the website files in Canvas. Include a comment with the names of all group members. Other group members submit just a comment with the names of all group members.

30 30 Ground Rules Do not share your work with other students (outside your group.) Before or after submitting the project. OK to discuss the project. OK to look at others’ web sites with a browser. Do not copy any other student’s code. Or even look at it. Do not let anyone copy or examine your code.

31 31 Ground Rules Except for code posted on the class web site Do not copy code from the Internet or any other source. Write your own code.

32 32 Due Date Project is due by 11:59 PM, Wednesday, March 23. After Spring Break Project submitted after the deadline will be subject to a penalty of 10 points per hour or part thereof. End of Presentation


Download ppt "1 Project 6: Northwind Orders. 2 The Northwind Traders Database The Northwind Traders database was created by Microsoft for training and demonstration."

Similar presentations


Ads by Google