OBJECTIVES

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

ASSIGNMENT

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:

  • New: Opens a new order form
  • Open: shows an input box prompting for the order number to open
  • Close: closes the current order form
  • Save: saves the current order form
  • Delete: deletes the current order
  • Exit.: exits the program

The buttons on the order form will do the following

  • Open: loads the order that corresponds to the number entered in the order form Order ID field
  • Delete: deletes the current order
  • Clear: will reset the form to its initial state by restoring all the defaults
  • Save: will save the current order

b) The following validation should be in place

  • Order ID must be an integer value that can only increment in 100
  • Customer Name cannot be blank
  • Customer Phone has to be 10 digits
  • Order date must be a valid date
  • Quantity ordered must be an integer value greater than or equal to one.
  • Price must be from the menu and cannot be entered by the user.
  • Billing and shipping info cannot be blank depending on which option is selected
  • All validation has to be performed by the appropriate business class
  • Sales Tax is 7.825%.

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.

Controller/Facade Class

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.

Order 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.

Order Detail Class

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.

Word document (IN THE FOLLOWING ORDER)

  • Use the Microsoft Word template provided with the assignment
  • Add a table of content after the first page
  • Add a completed Test Data table (Similar to the one included in the handout)
  • Add Print Screens of your test inputs and outputs
  • Program design (UML):
    • Add Class diagram showing all instance variables, methods, procedures, functions, etc.
  • Add a sheet Titled extra credit listing the extra credit (if any) that was done

EXTRA CREDIT

  • Create a user-defined control and use it. The control will replace the detail line total labels and changes color from the default white to yellow when the total per line is greater than $20.00 and change back to white when the total per line is less than $20.00.
  • Load and Unload your controls dynamically for the order detail items. Add a button titled Add Line and a button titled Remove Line, when clicked the button adds a new detail line item to your panel (the detail line should have all your controls, line label / item combobox / qty textbox / price label / total label). The dynamic control should handle all
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.