Project 7: Northwind Traders Order Entry 1
Northwinds Order Entry Extend the Select Customer program from Project 6 to permit the user to enter orders. Add orders to the database. Print invoices. Refer the Concept Document for background material: http://www.cse.usf.edu/~turnerr/software_systems_development/ Downloads/Northwind_Call_Center/ Note: This project is just a start. It does not fully implement the system described in the Concept Document. 2
Database Tables Use copies of the Northwind Traders Database tables in your own database on scorpius. Do not use the real Northwind database, which is read only. You should have already added these tables to your scorpius database. If not, see slides 4-6 of http://www.cse.usf.edu/~turnerr/software_systems_development/ 080_Databound_Controls.pdf 3
Orders Table For this project, use only OrderID, CustomerID, and OrderDate. Note that OrderID is an Identity field. 4
Order Details Table For this project, set Discount to 0.00. Other columns will have real values. 5
Products Table For this project, ignore SupplierID, QuantityPerUnit, UnitsInStock, UnitsOnOrder, ReorderLevel, and Discontinued. 6
Entity Classes Define an Entity class corresponding to each database table used by the project. Customers Order Details Orders Products This can be done manually or with the Visual Studio ORM tool. 7
Database Classes Objects of Entity classes encapsulate information corresponding to one row of a database table. Use LINQ with these classes to perform database operations where appropriate. Some databound controls will not need to use LINQ. 8
Home Form Add a button to the Home Form labeled Enter Order. Enabled only when a customer is selected. This button brings up a new form that permits the user to enter an order for the selected customer. 9
Home Form 10
Order Entry Form 11
Order Entry Form The Category dropdown list is bound to the Categories table. Display Member: Category Name Value Member: CategoryID List never changes. When a category is selected, the Product list is set up with products having the selected category. 12
Order Entry Form The Product dropdown list is bound to the Products table, but only lists products in the selected category. We will look at how to do this in class. When a product is selected, its Unit Cost should appear in the Unit Cost textbox, a default value of 1 should appear in the Quantity textbox, and the Add to Order button should be enabled. 13
Adding an Item to the Order After selecting a product, the user can enter a different value into the Quantity textbox if desired. Must be a positive integer. Less than 1000. 14
Order Item Information Set Up 15
Adding an Item to the Order When the user clicks Add to Order, a line item is added to the order as shown in the DataGridView below the dropdown lists. At this time the Submit Order button should be enabled. It should be disabled until the first line item is added to the order. In this project, we will not implement reservations for products in pending orders as described in the concept document. 16
Order with One Line Item 17
Entering an Order The user can continue adding line items indefinitely. The user can click Cancel to delete the current order and return to the Home form. When all items have been entered, the user clicks Submit Order to add this order to the database. One row is added to the Orders table. One row is added to the Order Details table for each line item of the order. 18
Entering an Order When the user clicks Submit Order the Print Invoice button is enabled. The Submit Order button is now disabled. The text on the Cancel button becomes Return. User can no longer cancel the order. 19
Ready to Submit Order 20
After Order Entered 21
Print Invoice The Print Invoice button outputs order information to a printer. Use a Print Dialog to let the user select a printer. Always print all pages. OK to assume that the invoice fits on one page. Use a fixed width font for line items so that columns of numbers can be aligned. The Print Invoice requirement has been deleted. 22
Invoice The Print Invoice requirement has been deleted. 23
Implementation Specifications Use a DataGridView to show the line items of the order on the Order Entry form. Use a DataTable to hold the order information as the order is being entered. Do not put anything into the database until the user clicks Submit Order. 24
Implementation Specifications Declare the DataTable as a member of the Order Entry Form class. Add columns programatically in the form class constructor. Add rows to the DataTable as line items are added to the order. 25
Implementation Specifications Bind the DataGridView to the DataTable in the form class constructor. Set DataGridView column widths and style programatically 26
Ground Rules You may work with one other person. OK to work alone if you prefer. If you do work as a pair Both members are expected to contribute. Submit a single program. Both members should understand the program in detail. It is OK to discuss the project, but... Do not share your work with other students. Before or after submitting the project. Do not copy any other student s work. Don t look at anyone else s program. 27
Due Date Project is due before midnight, Wed. night, April 28. Sunday night, May 2 Deliverables: Entire project folder, zipped Please use Windows Send to command to zip the folder. Submit your project using the Blackboard Assignment for this class. If done as a pair, only one member should submit the project. Include both names in the assignment comments and in source file comments. Other student submit just a comment with both names. End of Presentation 28