1. To learn how to break code into smaller more manageable procedures and functions
2. To learn how to use arrays / lists / collections to pass and retrieve data
3. To learn how to use exception handling to create error tolerant code
4. To learn how to use classes and OOP to separate Logic from the UI
5. To learn how to write to files
6. To learn how to code for MDI menus
Purpose
a) To learn how to design, write, and implement a Visual Basic program using a two-tier architecture. Your projects will be comprised of objects associated with both a graphical user interface and a business model.
Problem
a) Enter, process, save, and retrieve multiple customer orders for the HALOSTORE project. All information must be saved and retrieved using classes associated with a business model. All business logic, including data validation, must occur within the corresponding business object.
b) The user interface will be connected to a business model that you will build and implement using Visual Basic class modules.
Program Design
a) This project consists of the following principal components. The Tier 1 layer uses (1) frmMain as the MDI parent and (2) frmOrder, as the order entry form. The Tier 2 layer uses (3) clsController, serving as the gateway/facade to the business model, (4) clsOrder, used to hold the general order information, (5) clsOrderDetail, used to hold the details for each type of item ordered. see image.
b) As shown in the accompanying figure, this project has only one connection between the user interface and the business model. In this case, the connection will be implemented in the MDI parent form. Each new child form automatically links to this connection
MDI Form
a) Use the skeleton code that is provided, modify the project MDI File menu as follows:
The buttons on the order form will do the following
b) The following validation should be in place
c) For saving duplicate orders, provide a message box that asks for permission to overwrite the old values include buttons for Yes and No (default).
d) Delete will remove the corresponding order from the collection and reset the Order form to a new order state.
Build a controller class (clsController) to function as the gateway between your user interface and the remainder of your business model. This class is responsible for managing all orders. Include functionality to retrieve, add, change, and delete orders as discussed in class.
uild an Order class (clsOrder) to store, retrieve, and manage all information regarding the order, including order details (see below). All order data must be saved as private variables. Use public property variables, sub procedures, and functions, as necessary to access this data. This class will be responsible for validation its own data elements.
Build an Order Detail class (clsOrderDetail) to store, retrieve, and manage all information regarding the details for each type of item ordered. All order details must be saved as private variables. Use public property variables, sub procedures, and functions, as necessary to access this data. This class will be responsible for validating its own data elements.