You are on page 1of 250

2015

COMPUTING A2 PROJECT
WJEC COMPUTING: CG4 PROJECT - DEKKO WINDOWS
DILLON WILSON
Contents
Analysis
Background Page 1
Investigation and Analysis Page 2
Problem Definition Page 6
Objectives Page 7

Design
Output and Input Content and format Page 8
Files and data structures, methods of access Page 20
Validation Page 24
Processing stages Page 29
Evaluation criteria Page 52

Maintenance Documentation
Form links Page 53
Annotated listings Page 59

Testing
Testing strategy Page 141
Test plan & data Page 142
Actual test results Page 159

Evaluation
Evaluation of test results Page 217
Solution satisfies the objectives Page 218
Solution satisfies the evaluation criteria Page 221
Future improvements Page 224

User Documentation
Installation Page 226
Use Page 229
Background
For my computing A2 project I will create a software system that uses a database. The files
will be in third normal form which will involve foreign keys in addition to link files. This will
allow me to display a good knowledge of programming and explore complicated scenarios
that are resolved with computer science. I have chosen to create an order management
system for a business that deals with many customers and many orders. This will enable a
file structure involving multiple entities that have different kinds of relationships (one-to-
many).

The business I have selected to be the focus of my computing project is Dekko Windows.
Dekko window systems is a uPVC window and door manufacturer based in Stockport,
Manchester. The company manufacture windows and doors that adhere to specific styles
however all items are bespoke in dimensions and additional options. This will create
challenges as each item ordered will be unique, but it will enable be to display a good
understanding of complex problems that can be solved using computing. The business is
large and has a nationwide customer base. The business operates as a middleman, seeking
the parts and materials from suppliers to make the items ordered for dekkos own
customers. The customers of dekko are both businesses and consumers. This means that an
independent window fitters, large scale window suppliers, large hardware chain (such as
B&Q, whom stock standard sized windows and doors), construction contractors or regular
customers could create an order with dekko. This will create challenges within the ordering
system.

Using this business will be good as I will be able to carry out research into how the current
computer system works. This will aid the creation of my software, but enable me to improve
on the features that are found to be cumbersome and counter-intuitive. I will use the
current system documentation in addition to the outputs and stock lists to research and
devise a structure for my system.

1
Problem Investigation
Before beginning programming it is best practice to carry out an investigation into how the current system
runs. This is usually followed by an analysis, which initiates the core planning of features the system must
include. I will use this approach to create my software solution.
To fully understand the scope of the required function I have conducted a discussion with a worker from
Dekko. From our conversation I deduced that the ordering process operates in the way displayed by my
flow diagram below.

To assist my understanding of the system currently in place, I have obtained the following documentation.
These order sheets show all the details that dekko must hold so they are able to manufacture the item to
the customers requirements. I have chosen to use the currently available documentation as its easy to
understand and will provide insight into the record structure I will need to create. Another benefit of this
method is it reliability; the documents show clear information and are as is, an opinion or discussion may
lead to misinterpretations of the system.
To gain as much information as possible the use of an interview provided wider knowledge surrounding
the mechanism of the whole operation. This was helpful as the documentation I was able to gain was very
limited, however the discussion led to important details regarding the system and dekko processes orders
that are now vital influences on the design of my system. One possible issue with the discussion held is the
misinterpretation of the system by the staff member from dekko. In this instance the feedback and
information given made sense and seemed logical in manner, therefore I can deduce this is most likely an
accurate representation of the operations carried out at dekko.

2
On both these works order
reports, produced by dekkos
software, the details of the item
to be made for the order is
specified.

At the top of the report, the order details, such as


reference number, order id and customer name
provide context for the item being made.

On each report, a CAD drawing is shown of the final


item. This shows the worker where cuts need to be
made, and the orientation of handles, openers and
vents.

On the upper left of each report is a main options


table. This specifies the parts required to build the
item and the details such as number of openers,
overall size and styles.

On the bottom half of each report, a detailed


sections required table is populated. This is done
automatically by the software with the intentions of
specifying the cuts of each length of PVC required.
This could be a possible limitation to my software.

The first report shows a typical window item. The


second report shows a door with side panel
assembly. Both these reports are printed on A4
paper and used by the labourers when
manufacturing each item.

On the second report an additional table accessories


required is created and output. This is because this
item has further non-typical required stock.

3
Problem Analysis
The program investigation has now been undertaken and the findings must be used to begin planning and preparation
for the system I will design. My initial impressions of the problem are that the current system dekko uses focuses on two
main aspects of the business. Firstly, the order management system, which involves collection of customer details,
customers orders and stocked parts that the items will be made from. Secondly, the design aspect of the process. This
element involved sitting with the customer and using CAD design software to represent the final assembled item the
customer wishes to order.
This is an important process; without it the order makes little sense. With the ordered items visualised it enhances the
customer experience, something which dekko finds essential. This will draw issues to my software solution and I have
two viable options. The first is to omit the design tool, saving time, effort and unnecessary programming at the expense
of having a half functional system. The second option would be to create similar CAD (computer automated design) tools
that enable the system to operate the same as it currently does at dekko. This option would involve incredible amounts
of time to only become the counter part of the main important function. Both these options appear polar opposites and
neither is satisfactory alone. To combat this I intend to create a half-way hybrid. In essence, a suite of CAD tools that is
able to design a door or window with a basic range of options. This will allow the final system to operate effectively
without consuming unreasonable lengths of time.

The most important finding of the investigation was the nature of the orders. Each item ordered consists of
many different parts and the number of parts is not static. In other words, the items created consist of a
dynamic number of stock parts. This is shown in the sketch below.

4
To address this issue I intend to use a link file of some sort, creating the links between each item on an
order and the stock within the system.
The current system in place at dekko, carries out several functions. Through conducting the investigation I
have concluded the following attributes are required to be stored in the systems database that I will
create. All information below will be input to the system by an employee.
Customers The system stores customer details including address for delivery and business name (where
required).
Orders Each order is placed for a customer. The order contains many items. In addition to this
information, the order specifies the due date, total costs, cost breakdowns and various other information
regarding the order.
Items on orders: Quantity and description of the item on the order. The item also holds reference to each
item of stock required and the required quantity of the stock for its construction.
Stocked Parts The stocked parts are all for different purposes, different types of stock parts in essence.
The stock items have an individual acquisition cost, which helps determine the end charge to the customer.
The stock parts also come in different colours and are from an array of different manufacturers.
The outputs required for the system, that carries out the functionality dekko requires, range from basic to
complex. The most basic of outputs are customers details and stock details. These will involve reading
data from flat files. Other outputs will feature order details and item details. These outputs will cross load
data from multiple files. The outputs they give must be easy to understand, yet provide sufficient
information to the end user. Two outputs that are important in maintaining workflow are orders by due
date and orders by customer. These both provide details into the order and the items within, however
the first output does not provide an overwhelming portion of detail, such as delivery required or labour
costs. These are both outputs I aim to include in my final working solution.
The data overturn for the whole system is very quick. The customers can be one time and the orders are all
processed in a matter of weeks. This means that the software solution must meet several requirements.
The first necessity of the system is the ability to enter data quickly. This is important when adding new
customers. The customer data is never deleted (except to comply with data protection laws) to streamline
future purchases. Each order should be retained within the system for historical reference, however the
orders that have been processed and dispatched should not appear on outputs where the objective is to
analyse current orders. The system must also be able to handle a large number of orders and customers.
This is because the orders work cycle refreshes every 4 weeks, meaning that every four weeks the orders
on the system are completely new and the old ones have been processed.

5
Problem Definition
The software I intend to create will be for a large uPVC window and door manufacturing
company, Dekko Windows. The software will be used by office staff and fabricators. The
customers either call or visit the office where the order is created. In each order there will
be multiple required products, all of which are bespoke. Once this data is recorded the
software should create Jobs in which the item attributes are detailed and can be viewed
by the fabricators and hence manufactured.

The software required by the company will be expected to deal with a large number of
customers, jobs and stock. The stock level is required to automatically be updated when a
job is marked as complete. This will enable the company to keep track of stock levels and
will give them an advantage to their current system.

The company provides many different options and styles for products which are designed.
The windows that are created are all for different building types and the customer will
request products to specific dimensions. These dimensions are then used to create an item,
window or door, which will fit into the cavity in the building wall, when fitted by the
customer, who is often a building contractor or window fitter.

The current system in use requires staff to search individual part names upon selection from
a customer. This means they must have vast knowledge of the stock used and remember
the descriptive name. The new system I will design for Dekko Windows, will aim to simplify
this process and follow a categorisation system that enables faster selection.

The Details of a customer are always retained by Dekko Windows to streamline future
purchases and business deals with them. Not having to re-enter customer details with each
order is essential so a customer file of some sort is required.

Since the software at dekko has two key duties, there will be a restriction on how my
software performs these. The software I will create will have very good functions with
respect to order management. The CAD design function wont be as adequate. This is due to
the complexity of code that would be required to create such functions. The program I will
create will have computer automated design functions but only enable the design of basic
windows and doors. Another limitation to the system that I will make is the scheduling
ability of item jobs. At dekko this process is automated and optimised for the most efficient
order of jobs being carried out. The algorithms which do these tasks at dekko have been
engineered by logistics experts so for me to replicate such a system would be nearly
impossible. Instead a simple calendar view will show orders by due date for the line
managers analysis. It would then be a manual task to sort and assign workers with jobs.

6
Program Objectives
When designing, coding and testing my software I will work towards a specific set of objectives. The
objectives will detail the key requirements of the final software package, however this will not
provide a limit for any additional objectives the software carries out or meets. The objectives
detailed below will also be used as evaluation criteria at the end of the project. This will determine
whether the software is successful and has been created to meet its purpose.

1. The software will enable office staff to order uPVC windows and doors from the company
factory on behalf of customers. The order should hold enough information so that the
labourers can create the uPVC products without direct communication with the customer.
2. The system design should use meaningful button and label text to describe the function
accurately. For example a button which closes the current screen should be named Close
or Exit.
3. The system should use logical organisation categories, for example different data views,
such as orders or customers, should be under a View menu category.
4. The staff should have the option to create new customers, new orders, new jobs (i.e. a
window or door required for the customers order) and new stock parts.
5. The staff should be able to edit orders, customer details. This will allow correction of
incorrect data for customers.
6. The package should provide all available options for the uPVC products such as handles,
glass type and colour specification from drop down boxes in the product designer view.
7. The package should allow customers details to be stored in the system for future purchase
streamlining, i.e. they will not have to provide all their details, and the office worker will not
have to carry out re-entry of data.
8. The system should contain a view orders section where the orders and jobs can be viewed
by the labourers, thus manufacturing can take place. From this view the parts required and
overall constructed item should be detailed. The due date, quantity and any additional item
notes should be displayed.
9. Each part should have an individual tax rate and cost. This will allow the system to calculate
production costs so the office worker is well advised when settling a final order cost.
10. The manufacture name should be stored along with a reorder quantity in the stock file. This
should then be used to provide a summary of low stock and name for reorder by staff when
looked at from a summary view.
11. The software should provide a method of adding new stock types that can then be included
in orders. Old stock types should not be allowed to be deleted so that historical orders can
be viewed, however the option to discontinue a part should be available.

7
Output Content and Input Capture Content
Before I begin programming my software I will design the input and output
screens. This will enable the programming and design to be more focused
activities that adhere to the best suited pre-designed plans.

Below I have created a flow relationship diagram. This shows how each
screen in my program will be linked, in essence, the possible flow of
navigation.

Load Screen

Main Menu The main menu


will feature tabs,
Orders Customer Stock Orders each with different
Outlook Management Management Overview controls

Edit Stock
Edit Add Order
Customer
Add Stock
Add CAD
customer Viewer
Change
stock Level
CAD Tool

Low Stock

In the design of my software I will adhere to a strict colour palate. Since


Dekko has the corporate colour of light green, I will use this amongst greys,
blacks and red for any errors.
DEKKO GREEN LIGHT GREY DARK GREY
COLOUR COLOUR COLOUR
8
Input Designs - Add Customer Form

Add Customer Form x


Add Customer
Title \/

Forename

Surname

Address Line 1

Line 2

Line 3

Postcode

Business Name

Email

Phone

Cancel Save Details

Any customer who makes an order with dekko will have


their details inputted through this form. The data will then
be used to streamline future purchases. The form uses a
drop down box to select the title.

Textbox Button
KEY
Caption Option box

9
Input Designs - Add Stock Form
Add Customer Form x
Add Customer

Name

Part Type \/

Colour \/

Unit of Measure \/

Manufacturer

Cost

Re-Order Level

Current Stock Level

Additional Details

Cancel Add Part

This form will be used to create new stock items. The system
will use dropdown box selection to ensure the description of
each stock item is as consistent as possible, irrelevant of which
staff inputted the stock information.

Textbox Button
KEY
Caption Option box

10
Input Designs - Create Order Form

Create Order Form x


Order Details Items On Order
Items On Order Add Item To Order
Order ID: 1001
Description:
Order Date: 1/1/15 Width:

Height
Width

No.
ID Item Description Height:
Due Date:
Quantity:
Add Item
Select Customer

Add parts to Item


Customer List box Quant.

Quantity

Item ID
Add part ~>
Filter: Parts on order
Add part
<~ Remove Part
Confirm Customer

Name: Order Cost Confirm Order


Address: Parts Cost: 0.00
Grand Total: 0.00
Postcode: Labour Cost:
Additional Costs:
. Delivery .
Collection
Email:
Additional Cost
Phone:
Details:
Order Paid in full?
Confirm Tax Cost: 0.00 Save Order

This form will be the main screen where the orders are created
for the customers. This form will open up all the files and use
each one to load and save information. The many different
control will enable the order to be created as easily as possible.

Textbox Button
KEY
Caption Option box

11
Input Designs - CAD Window Form

CAD TOOL x
Item Specification
Width:

Height:

Vertical Bars:

Vertical openers:

Opener position:

Item Required stock


Length of PVC:

M2 of Glass:

Handles:

Hinges:

Save

Cancel

The design canvas. The drawn item


will be auto sized to best fill the
canvas.

This form will be used to design windows. The form will be


focused around the CAD drawing generated through the inputs
on the right hand side. The inputs will use textboxes and when
the text is input/changed the drawing on the CAD canvas will
automatically be re-drawn.

Textbox Button
KEY
Caption Position Control

12
Input Designs - CAD Door Form

CAD TOOL x
Item Specification
Width:

Height:

Glass Style: \/

Panels openers:

Handle position:

Item Required stock


Length of PVC:

M2 of Facia:

Handles:

Hinges:

Save

Cancel

The design canvas. The drawn item


will be auto sized to best fill the
canvas.

This form will be used to design doors. The form will be focused
around the CAD drawing generated through the inputs on the
right hand side. The inputs will use textboxes and when the text
is input/changed the drawing on the CAD canvas will
automatically be re-drawn.

Textbox Button
KEY
Caption Position Control

13
Input Designs - Other Inputs

{System Input Dialog} x

[Input the quantity]

Cancel OK

All other inputs to the system will use a default system design
input dialog. Shown in [] is the required action from the user
and will vary to appropriately reflect the required input.
{} denotes the title of the dialog and this will reflect the action
of the function, i.e. for stock level updates, it will read Stock
Level Update.
Doing this will ensure a familiar input format is used and will
mean the system is easy to use (as less control interfaces to
learn for the user).

Textbox Button
KEY
Caption Position Control

14
Output Designs Main Menu

DEKKO WINDOWS x
Orders Outlook Tab Customer Management Stock Management Order Viewer

Items On Order
Select Order Date
Items On Order

JAN FEB MARCH

Height
Width
Item

No.
ID
Description
APRIL MAY JUNE

Parts for Items


JULY AUGUST SEPTEMBER

Quantity

Item ID
Parts on order
OCTOBER NOVEMBER DECEMBER

The main focus will be a This form will enable staff to


calendar. This will allow the user select any date. After doing so
to click a particular day of a the details of all the orders will
month, the orders will then load be displayed including each
into the controls on the right. item, and all the stock required.

Textbox Button
KEY
Caption Option box

15
Output Designs - View Orders by customer form

Orders by Customer x
Order Details Items On Order

Items On Order
Order ID:

Order Date:

Height
Width
Due Date:

No.
ID Item Description

Select Order
Filter
Select Customer:
Parts for Items
Customer List box

Quantity

Item ID
Select Order: Parts on order

Order List box

This form will enable staff to search for customers then select
any orders they have made. After doing so the details of the
order will be displayed including each item, and all the stock
required.

Textbox Button
KEY
Caption Option box

16
KEY
View all Stock x
Filter

Textbox

Caption
Stock Table

Button

Option box
Stock Stock Stock Stock
Stock Name Stock Price
Type Colour Manufacturer Level

Stock ID

17
This view will enable staff to view all the stock in the database. This view will be
useful for checking whether a stock part exists. The use of a filter will enable the
staff to type in a keyword, such as the type or colour, and any results that have
Output Designs - View all Stock form

that string within will be shown in the updated table.


Output Designs - View all Orders form

All Orders x
Order Details Items On Order

Items On Order
Order ID:

Order Date:

Height
Width
Due Date:

No.
ID Item Description

Search Order

Filter
Parts for Items
Select Order:

Quantity

Item ID
Order List box Parts on order

This form will enable staff to search order then select the ID.
After doing so the details of the order will be displayed
including each item, and all the stock required. This form will
be most useful for the labourers when they make the item.
This view will enable them to type in their order number and
see all the details relating to that order.

Textbox Button
KEY
Caption Option box

18
KEY
View all Customers x
Filter

Textbox

Caption
Customers Table

Button

Option box
Customer Name Phone
List box
Address Email
No.

Customer ID
Business Name

19
Business Customer?
This view will enable staff to view all the customers in the database. This view will
be useful for checking whether a customer already has their details stored with
dekko. The use of a filter will enable the staff to type in a keyword, such as the
forename or a postcode, and any results that have that string within will be
shown in the updated table.
Output Designs - View all Customers form
ER Diagram
The diagram below shows how the data files will link.

Stock File

Part Job Link File Customer File

Job items File Order File

Schema Primary Key, Foreign Key


Customer File (CustomerID, Forename, Surname, AddressLin1, AddressLin2, AddressLin3,
Postcode, Business Customer)

Order File (OrderID, Customer ID, DateOrdered, DateDue, ManufacturingCost, LabourCost,


DeliveryCost, TotalCost)

JobFile (JobID, OrderID, Quantity, JobDesciption, JobStatus, ItemWidth, ItemHeight)

JobPartLink (JobID, PartID, Quantity)

Stock (PartID, PartType, PartName, PartManufacturer, PartPrice, PartTax, StockLevel,


StockUnits, PartColour, PartDescription, Re-orderLevel)

20
Data File Structures
The following tables reflect the data files I will use with my software. Each file will have a
primary key (except the link file). I will use a record structure of fixed length with each file.
This will save time; opening fixed length records is quicker and the programming routines
are much simpler to develop. The records will all contain fields and the database as a whole
will be in third normal form.

File Name: CUSTOMER FILE


File extension: .DAT
Data storage method Sequential
Data Variable Type Length Used For
CustomerID Integer 4 Primary key
Forename String 15 Stores customers name
Surname String 15 Stores customers second name
AddressLin1 String 30 Stores first line of customers address
AddressLin2 String 30 Stores second line of customers address
AddressLin3 String 30 Stores third line of customers address
Postcode String 7 Stores customer postcode
Business Customer Boolean 2 Whether is a business customer (true = yes)
TelephoneNum Integer 11 The contact telephone number for the
customer
The customer file will be used to store all details of both business customers and normal
customers. The primary key, customer ID, will be used within the order file to show which
customer an order belongs to. A customer can have many orders, but an order can only
have one customer.

21
File Name: STOCK FILE
File extension: .DAT
Data storage method Sequential
Data Variable Type Length Used For
PartID Integer 4 Primary key
PartType String 15 Stores the type the part is (pvc, glass etc)
PartName String 15 The name of the part
PartManufacturer String 15 The manufacturer/supplier of the part
PartPrice Currency 4 The cost in GBP per unit
StockLevel Integer 4 The current stock level of the part
StockUnits String 8 The units the stock is measured in (metres,
mms etc.)
PartColour String 8 The colour of the part (closest match, e.g.
Silver, grey)
PartDescription String 80 A complete description of the part (if
required)
Re-orderLevel Integer 4 The stock level at which the stock should be
re-ordered.
The stock file will store all details regarding each item of stock. The stocked items will be
used to create items that are assigned to specific orders. The stock record will contain all
details regarding each stock part, including the name of the manufacturer.

File Name: JOB-STOCK LINK


File extension: .DAT
Data storage method Serial
Data Variable Type Length Used For
JobID Integer 4 Foreign Key
PartID Integer 4 Foreign Key
Quantity Integer 2 The quantity of the stock needed for the job
This file will act as a link between the stock and the item required for order. There will be no
primary key field in this record. The quantity field serves to minimise duplicate records in
the event of two or more stock parts being required for a job.

22
File Name: ORDER FILE
File extension: .DAT
Data storage method Serial
Data Variable Type Length Used For
OrderID Integer 4 Primary key
Customer ID Integer 4 Foreign key
DateOrdered Date 6 The date the order was placed on
DateDue Date 6 The date the order is required before
ManufacturingCost Currency 4 The cost of all the parts on the order
LabourCost Currency 4 The cost of the labour hours to make the
items
DeliveryCost Currency 4 The cost for the item delivery if required.
TotalCost Currency 4 The grand total of the order payable by the
customer
AdditionalCharges Currency 4 Any additional charges that should be
incurred/deducted
AdditionalCharges String 60 The reason for the addition/deduction
Reason
OrderStatus String 10 The current status of the order
PaidinFull Boolean 2 Whether or not the order has been paid for in
full by the customer
The order file will host the details regarding costs and dates for each order. It will create a
link between each order and the customer the order belongs to.

File Name: JOB FILE


File extension: .DAT
Data storage method Serial
Data Variable Type Length Used For
JobID Integer 4 Primary key
OrderID Integer 4 Foreign key
Quantity Integer 2 The quantity of the item to be made
JobDesciption String 60 A brief description of the item to be made
ItemWidth Real 4 The width of the item in metres
ItemHeight Real 4 The height of the item in metres
MiscProperty1 String 15 The type of item ordered will be stores here.
MiscProperty2 String 15 The number of panels the item is made from
MiscProperty3 String 15 The number of openers the item has
MiscProperty4 Integer 4 Number of handles and hinge side
The misc. property fields listed above will be used in different ways depending on the type
of item. The used for summary is a general idea of the fields use. In this file, the order ID will
act as foreign key, linking each item back to its parent order.

23
Input Validation
The program I intend to create will also require many inputs from the user. Some inputs will be
strings, others will need to be numerical responses. If the user provides an incorrect type of input
the system would crash. I will use validation routines to ensure errors and invalid inputs are handled
without causing imminent failure. I will also use verification checks to ensure required data is keyed
in and fields are not left blank. This will ensure that customers cannot be created without a name or
address and that orders must have items within them. Other circumstances will require validation of
input format, e.g. a phone number must be 11 digits long. These checks will be used to minimalize
instances of incorrect data entry; phone numbers are long and random in nature so length checks
will aim to provide a simple and quick check that all digits have been keyed in.

Below I have outlined the areas of input that will require validation.

User Interface Validation Program Response to


Input name Reason for validation
Screen Type invalid input
Title Add customer Presence Title is a required field Error message: Please
check and has been missed Input Customer Title.
out. Program returns and waits
for input.
Forename Add customer Presence Forename is a required Error message: Please
check field and has been Input Customer Forename.
missed out. Program returns and waits
for input.
Surname Add customer Presence Surname is a required Error message: Please
check field and has been Input Customer Surname.
missed out. Program returns and waits
for input.
Address Add customer Presence Address is a required Error message: Please
check field and has been Input Customer Address.
missed out. Program returns and waits
for input.
Phone Add customer Presence Phone number must be Error message: Please
number check and inputted and 11 digits check and input a valid
length check long. phone number - must be 11
digits long. Program
returns and waits for input.
Order due Create order Range check The date for an order Error message: Please
date due by, must be in the Select a date in the future
future. Program returns and waits
for input.
Items list Create order Range check To ensure items have Error message: Please add
been added to the order. at least one item to make
an order. Program returns
and waits for input.
Stock list Create order Range check To ensure stock has Error message: Please add
been added to the order. at least one item of stock to
make an order. Program
returns and waits for input.

24
Additional Update stock Range check To ensure the additional Error message: Please
stock value level stock units value is valid. Input Valid stock level.
[Must be Greater than 0]
Part units Add stock Presence To ensure units of Error message: Please
check measurement have been Input Part Units. Program
selected. returns and waits for input.
Part Add stock Presence To ensure manufacturer Error message: Please
manufacturer check name has been recorded Input Manufacturer.
Program returns and waits
for input.
Part cost Add stock Range check To ensure the cost is Error message: Please
greater that 0.00 Input Valid Cost. [Must be
Greater than 0.00]
Program returns and waits
for input.
Part re-order Add stock Range check To ensure the re-order Error message: Please
level level exceeds one unit. Input Valid Re-order Value.
[Must be Greater than 0]
Program returns and waits
for input.
Part type Add stock Presence To ensure the part type Error message: Please
check has been selected. Input Part Type. Program
returns and waits for input.

25
Validation Routines - Data Flow Diagrams
Presence Check Length Check

Input data Input data

Is data null Is data length <>


Yes YES
value? 11?

No No

Data is handled and User receives error Data is handled and User receives error
processed by message: Please processed by message: Please
program provide input. program provide valid input.

Routine ends Routine ends

Data Format Check Date In Future Check

Input data Input data

Is data a valid type? NO Is date >= (current


NO
date + 1 day)

YES YES
User receives error User receives error
Data is handled and Data is handled and
message: Please message: Please
processed by processed by
provide valid data chose date that lies
program program
type. in the future.

Routine ends Routine ends

26
Validation Routines PSEUDO Code
Presence Check
DECLARE INPUT = USER INPUT

DECLARE PROCESS DATA BOOLEAN

IF CONDITION INPUT <> NULL VALUE THEN

PROCESS DATA = TRUE

OTHERWISE

PROCESSS DATA = FALSE

END CONDITION

Length Check
DECLARE INPUT = USER INPUT

DECLARE LENGTH IS INTEGER

DECLARE PROCESS DATA BOOLEAN

LENGTH = INPUT.characterlength

IF LENGTH <> 11 THEN

PROCESS DATA = FALSE

OTHERWISE

PROCESSS DATA = TRUE

END CONDITION

27
Data Format Check
DECLARE INPUT = USER INPUT

DECLARE PROCESS DATA BOOLEAN

IF CONDITION INPUT.datatype <> INTEGER THEN

PROCESS DATA = FALSE

OTHERWISE

PROCESSS DATA = TRUE

END CONDITION

Date in Future Check


DECLARE INPUT = USER INPUT

DECLARE MINDATE = DATE

DECLARE PROCESS DATA BOOLEAN

MINDATE = TODAYSDATE + (DATE.1day)

IF CONDITION INPUT < MINDATE THEN

PROCESS DATA = FALSE

OTHERWISE

PROCESSS DATA = TRUE

END CONDITION

28
Processing Stages
Prior to programming my software I will create routines that will outline thee structure and key
functions that will eventually create the final package. This will consist of two formats. I will create
data flow charts and PSUDEO code routines. These will be used to help guide and structure my
programs code, reducing time spent debugging; any detrimental issues should be ironed out while
these documents are formed.

Key Data Flow Diagrams

Decision Process

Start/End Data File

Key PSUEDO Code Routines


DECLARE Creates Variable in RAM

IF CONDITION Standard IF Statement

OTHERWISE Alternative actions

DO WHILE Standard do whle condition

REPEAT LOOP Jumps back to the most recent DO WHILE and runs again.

EXIT CONDITION Ends a conditional statement

SHOW MESSAGE Shows a system dialog message to the user

OPEN FILE (filename) Opens up the data file specified for I/O actions

INSERT RECORD Inserts the RAM record into the open data file

CLOSE SYSTEM FILE Closes the data file that is currently open

EVENT Triggered by a user interaction with the UI

29
Add Customer Form - Data Flow Diagram
Save details trigger

Load Customer User Inputs


Details inputs into From screen
ram record UI

Verify Customer
Details Inputted

Are Inputs Message: Inputs not


NO
present? present

YES

Validate Customer
Details Inputted

Are Inputs Message: Inputs not


NO
Valid? valid

YES

Open Customer File Customer File

Check Next
available Customer
ID

Put new record into


position

Close file

Message: Could not


Save Sucsessful? NO
save customer error

YES

Success Message
box

Close New
Customer Screen

End
30
Add Stock Form - Data Flow Diagram
Save details trigger

Load Stock Details User Inputs


inputs into ram From screen
record UI

Verify Stock Details


Inputted

Are Inputs Message: Inputs not


NO
present? present

YES

Validate Stock
Details Inputted

Are Inputs Message: Inputs not


NO
Valid? valid

YES

Open Stock File Stock File

Check Next
available Stock ID

Put new record into


position

Close file

Message: Could not


Save Sucsessful? NO
save customer error

YES

Success Message
box

Close New Stock


Screen

End
31
CAD Tool - Data Flow Diagram

Change of inputs
detected

Calculate New
height

Change height to
Is it within Message: Not
No nearest range limit
range? within range
(upper or lower)

Yes

Calculate New
width

Change width to
Is it within Message: Not
No nearest range limit
range? within range
(upper or lower)

Yes

Draw Window using


shapes

Are there any


vertical bars?

Yes

Draw all vertical


No
bars

Which side are


the handles on?

Left Right

Draw Handles on Draw Handles on


left right

End drawing item

32
Create Order - Data Flow Diagram
Save Order button

Message: Please
Is customer
NO check and confirm
verified?
selected customer.

YES

Has date been Message: Please


NO
selected? select order date

YES Close Order File

Message: Order
Is number of
NO must have more
items <= 1
than one item.

YES Close Job File

Message: Order
Is number of
NO must have more
stock <= 1
than one stock part.

YES Close Link File

Order file
Open order file

Successful order
NO
save?
Open job file Job file

YES

Message: Error
Open job link file Message: Order
Job link file occurred, please try
saved!
again.

Insert order details


record Close Order Screen

Insert new job


record End

Number of items-- 1 No

Insert stock link to


job item to link file

Yes
Number of stock
Yes
parts -- 1

Is number of
stock parts > 0?

No

Is number of
items > 0?

33
Create Order - Data Flow Diagram
Low stock form load

Open stock file

Open job link file

Load stock record X

Is stock level =<


reorder level?

YES

Load job link record


Y = ++ 1
Y

Is stock ID
NO
match?

YES

Required(X) = ++1

Is EOF link file? NO

YES

SuggestedToOrder(X) = Required(X) +
ReorderQuantity * 0.5 + ReOrderQunatity

Is EOF stock file? NO x = ++1

YES

Display results in UI

End

34
PROCESSING STAGES - ADD CUSTOMER
The add customer routine will be used to add new customers into the system.
DECLARE NEWDETAILS EQUALS STRUCTURE CUSTOMER
DECLARE CUSTOMERFILEI/OCHANNEL EQUALS STRUCTURE INTEGER
DECLARE SHOULDSAVECSUTOMER EQUALS STRUCTURE BOOLEAN
SHOULDSAVECSUTOMER EQUALS FALSE
IF CONDITION TITLE VALUE DOES NOT EQUAL TEXT() THEN
SHOULDSAVECSUTOMER EQUALS TRUE
OTHERWISE
SHOULDSAVECSUTOMER EQUALS FALSE
SHOW MESSAGE: PLEASE INPUT CUSTOMER TITLE
EXIT CONDITION
CLOSE SYSTEM FILE I/OCHANNEL:CONDITION
IF CONDITION FORNAME VALUE DOES NOT EQUAL TEXT() THEN
SHOULDSAVECSUTOMER EQUALS TRUE
OTHERWISE
SHOULDSAVECSUTOMER EQUALS FALSE
SHOW MESSAGE: PLEASE INPUT CUSTOMER FORNAME
EXIT CONDITION
CLOSE SYSTEM FILE I/OCHANNEL:CONDITION
IF CONDITION SURNAME VALUE DOES NOT EQUAL TEXT() THEN
SHOULDSAVECSUTOMER EQUALS TRUE
OTHERWISE
SHOULDSAVECSUTOMER EQUALS FALSE
SHOW MESSAGE: PLEASE INPUT CUSTOMER SURNAME
EXIT CONDITION
CLOSE SYSTEM FILE I/OCHANNEL:CONDITION
IF CONDITION ADD1 VALUE DOES NOT EQUAL TEXT() THEN
SHOULDSAVECSUTOMER EQUALS TRUE
OTHERWISE
SHOULDSAVECSUTOMER EQUALS FALSE
SHOW MESSAGE: PLEASE INPUT CUSTOMER ADDRESS LINE 1
EXIT CONDITION
CLOSE SYSTEM FILE I/OCHANNEL:CONDITION
IF CONDITION ADD2 VALUE DOES NOT EQUAL TEXT() THEN
SHOULDSAVECSUTOMER EQUALS TRUE
OTHERWISE
SHOULDSAVECSUTOMER EQUALS FALSE
SHOW MESSAGE: PLEASE INPUT CUSTOMER ADDRESS LINE 2
EXIT CONDITION
CLOSE SYSTEM FILE I/OCHANNEL:CONDITION
IF CONDITION ADD3 VALUE DOES NOT EQUAL TEXT() THEN
SHOULDSAVECSUTOMER EQUALS TRUE
OTHERWISE
SHOULDSAVECSUTOMER EQUALS FALSE
SHOW MESSAGE: PLEASE INPUT CUSTOMER ADDRESS LINE 3
EXIT CONDITION
CLOSE SYSTEM FILE I/OCHANNEL:CONDITION
IF CONDITION POSTCODE VALUE DOES NOT EQUAL TEXT() THEN
SHOULDSAVECSUTOMER EQUALS TRUE
OTHERWISE
SHOULDSAVECSUTOMER EQUALS FALSE
SHOW MESSAGE: PLEASE INPUT CUSTOMER POSTCODE
EXIT CONDITION
CLOSE SYSTEM FILE I/OCHANNEL:CONDITION
IF CONDITION TELEPHONE VALUE DOES NOT EQUAL TEXT() THEN
SHOULDSAVECSUTOMER EQUALS TRUE
OTHERWISE
SHOULDSAVECSUTOMER EQUALS FALSE
SHOW MESSAGE: PLEASE INPUT CUSTOMER PHONE NUMBER
EXIT CONDITION
CLOSE SYSTEM FILE I/OCHANNEL:CONDITION
IF CONDITION EMAIL VALUE DOES NOT EQUAL TEXT() THEN
SHOULDSAVECSUTOMER EQUALS TRUE
OTHERWISE
35
SHOULDSAVECSUTOMER EQUALS FALSE
SHOW MESSAGE: PLEASE INPUT CUSTOMER EMAIL ADDRESS
EXIT CONDITION
CLOSE SYSTEM FILE I/OCHANNEL:CONDITION
IF CONDITION BUSINESSNAME VALUE EQUALS TEXT() AND BCUST-CHECKBOXCONTROL VALUE EQUALS 1 THEN
SHOULDSAVECSUTOMER EQUALS FALSE
SHOW MESSAGE: PLEASE INPUT CUSTOMER'S BUSINESS NAME
OTHERWISE
SHOULDSAVECSUTOMER EQUALS TRUE
END CONDITION
CLOSE SYSTEM FILE I/OCHANNEL:CONDITION
IF CONDITION SHOULDSAVECSUTOMER EQUALS TRUE THEN
CUSTOMERFILEI/OCHANNEL EQUALS AVAILABLEFILEINTEGER
OPEN FILE CUSTOMERFILEPATH FOR READ/WRITE EQUALS STRUCTURE CUSTOMERFILEI/OCHANNEL LENGTH EQUALS CUSTOMERFILELENGTH
CUSTOMERFILENEXTRECORD EQUALS FILELENGTH CUSTOMERFILEPATH / CUSTOMERFILELENGTH + 1
NEXTCUSTOMERPIN EQUALS CUSTOMERFILENEXTRECORD + 1000
NEWDETAILS CUSTOMERID EQUALS NEXTCUSTOMERPIN
NEWDETAILS TITLE EQUALS TITLE VALUE
NEWDETAILS FORNAME EQUALS FORNAME VALUE
NEWDETAILS SURNAME EQUALS SURNAME VALUE
NEWDETAILS ADDRESSLINE1 EQUALS ADD1 VALUE
NEWDETAILS ADDRESSLINE2 EQUALS ADD2 VALUE
NEWDETAILS ADDRESSLINE3 EQUALS ADD3 VALUE
NEWDETAILS POSTCODE EQUALS POSTCODE VALUE
NEWDETAILS PHONENUMBER EQUALS TELEPHONE VALUE
NEWDETAILS EMAIL EQUALS EMAIL VALUE
IF CONDITION BCUST-CHECKBOXCONTROL VALUE EQUALS 1 THEN
NEWDETAILS BUSINESSCUSTOMER EQUALS TRUE
NEWDETAILS BUSINESSNAME EQUALS BUSINESSNAME VALUE
OTHERWISE
NEWDETAILS BUSINESSCUSTOMER EQUALS FALSE
NEWDETAILS BUSINESSNAME EQUALS TEXT(-)
CLOSE SYSTEM FILE I/OCHANNEL:CONDITION
INSERT RECORD CUSTOMERFILEI/OCHANNEL, CUSTOMERFILENEXTRECORD, NEWDETAILS
CLOSE SYSTEM FILE I/OCHANNEL:CUSTOMERFILEI/OCHANNEL
CLOSE WINDOW
CLOSE SYSTEM FILE I/OCHANNEL:CONDITION
END CONDITION
CONDITION CANCEL-CONTROLCLICKEVENT
CLOSE WINDOW
END CONDITION

36
PROCESSING STAGES ADD STOCK
The add stock routine will be used on the add stock screen, to add new items of stock
into the system.
DECLARE NEWSTOCK EQUALS STRUCTURE STOCK
DECLARE STOCKFILEI/OCHANNEL EQUALS STRUCTURE INTEGER
DECLARE NEXTSTOCKID EQUALS STRUCTURE INTEGER
DECLARE SAVESTOCK EQUALS STRUCTURE BOOLEAN
IF PARTNAME VALUE EQUALS NOT EQUAL TEXT() THEN:
SAVESTOCK EQUALS TRUE
OTHERWISE
SAVESTOCK EQUALS FALSE
SHOW MESSAGE: PLEASE INPUT PART NAME
EXIT CONDITION
IF PARTCOLOUR VALUE EQUALS NOT EQUAL TEXT(PLEASE SELECT)THEN:
SAVESTOCK EQUALS TRUE
OTHERWISE
SAVESTOCK EQUALS FALSE
SHOW MESSAGE: PLEASE INPUT COLOUR DESCRIPTION
EXIT CONDITION
IF PARTTYPE VALUE EQUALS NOT EQUAL TEXT(PLEASE SELECT)THEN:
SAVESTOCK EQUALS TRUE
OTHERWISE
SAVESTOCK EQUALS FALSE
SHOW MESSAGE: PLEASE INPUT PART TYPE
EXIT CONDITION
IF STOCKUNITS VALUE EQUALS NOT EQUAL TEXT(PLEASE SELECT)THEN:
SAVESTOCK EQUALS TRUE
OTHERWISE
SAVESTOCK EQUALS FALSE
SHOW MESSAGE: PLEASE INPUT PART UNITS
EXIT CONDITION
IF MANUFACTURER VALUE EQUALS NOT EQUAL TEXT() THEN:
SAVESTOCK EQUALS TRUE
OTHERWISE
SAVESTOCK EQUALS FALSE
SHOW MESSAGE: PLEASE INPUT MANUFACTURER
EXIT CONDITION
IF VALUE FOR PARTCOST VALUE EQUALS GREATER THAN 0 THEN:
SAVESTOCK EQUALS TRUE
OTHERWISE
SAVESTOCK EQUALS FALSE
SHOW MESSAGE: PLEASE INPUT VALID COST [MUST BE GREATER THAN 0.00]
EXIT CONDITION
IF VALUE FOR REORDER VALUE EQUALS GREATER THAN 0 THEN:
SAVESTOCK EQUALS TRUE
OTHERWISE
SAVESTOCK EQUALS FALSE
SHOW MESSAGE: PLEASE INPUT VALID RE-ORDER VALUE [MUST BE GREATER THAN 0]
EXIT CONDITION
IF VALUE FOR STOCKLEVEL VALUE EQUALS GREATER THAN 0 THEN:
SAVESTOCK EQUALS TRUE
OTHERWISE
SAVESTOCK EQUALS FALSE
SHOW MESSAGE: PLEASE INPUT VALID STOCK LEVEL [MUST BE GREATER THAN 0]
EXIT CONDITION
IF SAVESTOCK EQUALS TRUE THEN:
STOCKFILEI/OCHANNEL EQUALS AVAILABLEFILEINTEGER
OPEN FILE STOCKFILEPATH FOR READ/WRITE EQUALS STRUCTURE STOCKFILEI/OCHANNEL LENGTH EQUALS STOCKFILELENGTH
STOCKFILENEXTRECORD EQUALS FILELENGTH STOCKFILEPATH / STOCKFILELENGTH + 1
NEXTSTOCKID EQUALS STOCKFILENEXTRECORD + 1000
NEWSTOCK PARTID EQUALS NEXTSTOCKID
NEWSTOCK PARTNAME EQUALS PARTNAME VALUE
NEWSTOCK PARTCOLOUR EQUALS PARTCOLOUR VALUE
NEWSTOCK PARTTYPE EQUALS PARTTYPE VALUE
37
NEWSTOCK STOCKUNITS EQUALS STOCKUNITS VALUE
NEWSTOCK PARTMANUFACTURER EQUALS MANUFACTURER VALUE
NEWSTOCK PARTPRICE EQUALS VALUE FOR PARTCOST VALUE
NEWSTOCK REORDERLEVEL EQUALS VALUE FOR REORDER VALUE
NEWSTOCK STOCKLEVEL EQUALS VALUE FOR STOCKLEVEL VALUE
NEWSTOCK PARTDESCRIPTION EQUALS ADDITIONALINFO VALUE
NEWSTOCK DISCONTINUED EQUALS FALSE
INSERT RECORD STOCKFILEI/OCHANNEL, STOCKFILENEXTRECORD, NEWSTOCK
CLOSE SYSTEM FILE I/OCHANNEL:STOCKFILEI/OCHANNEL
CLOSE WINDOW
RUN CONDITION MAINMENU LOADALLSTOCKTABLE

38
PROCESSING STAGES CAD TOOL
The CAD tool will be used to create and view windows CAD designs. This routine
will use an array of shapes in the user interface named shapes(1) to shapes(x),
where x is 100.

DECLARE VSECTIONS EQUALS STRUCTURE INTEGER


DECLARE POSITION EQUALS STRUCTURE INTEGER

CONDITION WINDOW RENDER


IF WINDOWHSIDE EQUALS 2 THEN:
RIGHT VALUE EQUALS TRUE
X POSITION VALUE EQUALS FALSE
OTHERWISE
RIGHT VALUE EQUALS FALSE
X POSITION VALUE EQUALS TRUE

RUN CONDITION REDRAW


END CONDITION

CONDITION WINDOW LOAD


IF CADWINDOWEDIT EQUALS TRUE THEN:
THISPROGRAMWINDOW WIDTH EQUALS 14625
WINDOWWIDTH-VARIABLE EQUALS 1
WINDOWHEIGHT-VARIABLE EQUALS 1
POSITION EQUALS 1
OTHERWISE
THISPROGRAMWINDOW WIDTH EQUALS 11640
POSITION EQUALS WINDOWOPOSITION
VSECTIONS EQUALS WINDOWVOPENERS
END CONDITION

IF VALUE FOR HEIGHT VALUE EQUALS LESS THAN 0.1 THEN:


SHOW MESSAGE: WINDOW MUST BE AT LEAST 20CM IN HEIGHT
HEIGHT VALUE EQUALS 0.2
WINDOWHEIGHT-VARIABLE EQUALS VALUE FOR HEIGHT VALUE
RUN CONDITION REDRAW
END CONDITION

PROCEDURE CONDITION: REDRAW


DECLARE SCALEVAL EQUALS STRUCTURE REAL
IF WINDOWWIDTH-VARIABLE EQUALS GREATER THAN WINDOWHEIGHT-VARIABLE THEN:
SCALEVAL EQUALS WINDOWWIDTH-VARIABLE + WINDOWWIDTH-VARIABLE * 0.1 + 0.01
CADWINDOW PICTURE BOX SCALEWIDTH-VARIABLE EQUALS SCALEVAL
CADWINDOW PICTURE BOX SCALEHEIGHT-VARIABLE EQUALS SCALEVAL
OTHERWISE
SCALEVAL EQUALS WINDOWHEIGHT-VARIABLE + WINDOWHEIGHT-VARIABLE * 0.1 + 0.01
CADWINDOW PICTURE BOX SCALEWIDTH-VARIABLE EQUALS SCALEVAL
CADWINDOW PICTURE BOX SCALEHEIGHT-VARIABLE EQUALS SCALEVAL
END CONDITION

WINDOWFRATHISPROGRAMWINDOW SHAPE WIDTH EQUALS WINDOWWIDTH-VARIABLE


WINDOWFRATHISPROGRAMWINDOW SHAPE HEIGHT EQUALS WINDOWHEIGHT-VARIABLE
WINDOWFRATHISPROGRAMWINDOW SHAPE X POSITION EQUALS SCALEVAL / 2 - WINDOWWIDTH-VARIABLE / 2
WINDOWFRATHISPROGRAMWINDOW SHAPE Y POSITION EQUALS SCALEVAL / 2 - WINDOWHEIGHT-VARIABLE / 2
INSIDEGLASS SHAPE WIDTH EQUALS WINDOWWIDTH-VARIABLE - 0.05
INSIDEGLASS SHAPE HEIGHT EQUALS WINDOWHEIGHT-VARIABLE - 0.05
INSIDEGLASS SHAPE X POSITION EQUALS SCALEVAL / 2 - WINDOWWIDTH-VARIABLE / 2 + 0.05 2
INSIDEGLASS SHAPE Y POSITION EQUALS SCALEVAL / 2 - WINDOWHEIGHT-VARIABLE / 2 + 0.05 2
DECLAREAR-COUNTVALUE EQUALS STRUCTURE INTEGER
FORR-COUNTVALUE EQUALS UP TO 5
VERTICALBARAR-COUNTVALUE VISIBLE EQUALS FALSE
39
NEXT FORR-COUNTVALUE
VBAR-COUNTVALUE EQUALS 1
FORR-COUNTVALUE EQUALS UP TO WINDOWVBARS
VERTICALBARAR-COUNTVALUE VISIBLE EQUALS TRUE
VERTICALBARAR-COUNTVALUE WIDTH EQUALS 0.05 2
VERTICALBARAR-COUNTVALUE HEIGHT EQUALS INSIDEGLASS SHAPE HEIGHT
VERTICALBARAR-COUNTVALUE Y POSITION EQUALS SCALEVAL / 2 - WINDOWHEIGHT-VARIABLE / 2 + 0.05 2
VERTICALBARAR-COUNTVALUE X POSITION EQUALS SCALEVAL / 2 - WINDOWWIDTH-VARIABLE - 0.05 / 2 +AR-COUNTVALUE * WINDOWWIDTH-VARIABLE -
0.05 - WINDOWVBARS * 0.05 2 / WINDOWVBARS + 1 + 0.025 *AR-COUNTVALUE - 0.05 2
VERTICALBARAR-COUNTVALUE -COLOUR ISWHITE
VERTICALBARAR-COUNTVALUE STYLE EQUALS 1
VERTICALBARAR-COUNTVALUE FILL-COLOUR EQUALS &HE0E0E0
VERTICALBARAR-COUNTVALUE FILLSTYLE EQUALS 0
NEXT FORR-COUNTVALUE
DECLARE VOPENER-COUNTVALUE EQUALS STRUCTURE INTEGER
FOR VOPENER-COUNTVALUE EQUALS UP TO 6
VERTICALOPENERVOPENER-COUNTVALUE VISIBLE EQUALS FALSE
HANDLE IMAGE VOPENER-COUNTVALUE VISIBLE EQUALS FALSE
NEXT FOR VOPENER-COUNTVALUE
DECLARE OPENER WIDTH EQUALS STRUCTURE REAL
IF RIGHT VALUE EQUALS TRUE THEN:
VOPENER-COUNTVALUE EQUALS 1
FOR VOPENER-COUNTVALUE EQUALS POSITION TO WINDOWVOPENERS + POSITION - 1
WINDOWHSIDE EQUALS 2
VERTICALOPENERVOPENER-COUNTVALUE VISIBLE EQUALS TRUE
HANDLE IMAGE VOPENER-COUNTVALUE VISIBLE EQUALS TRUE
OPENER WIDTH EQUALS WINDOWWIDTH-VARIABLE - 0.05 - WINDOWVBARS * 0.05 2 / WINDOWVBARS + 1
VERTICALOPENERVOPENER-COUNTVALUE WIDTH EQUALS OPENER WIDTH - 0.05 2 - 0.05 4
VERTICALOPENERVOPENER-COUNTVALUE X POSITION EQUALS SCALEVAL / 2 - WINDOWWIDTH-VARIABLE / 2 + OPENER WIDTH * VOPENER-
COUNTVALUE - 1 + 0.025 * VOPENER-COUNTVALUE + 0.05 4
VERTICALOPENERVOPENER-COUNTVALUE Y POSITION EQUALS SCALEVAL / 2 - WINDOWHEIGHT-VARIABLE / 2 + 0.05 2 + 0.05 4
VERTICALOPENERVOPENER-COUNTVALUE HEIGHT EQUALS INSIDEGLASS SHAPE HEIGHT - 0.05 2
VERTICALOPENERVOPENER-COUNTVALUE STYLE EQUALS 1
VERTICALOPENERVOPENER-COUNTVALUE -COLOUR EQUALS WHITE
VERTICALOPENERVOPENER-COUNTVALUE BORDER WIDTH EQUALS 2
HANDLE IMAGE VOPENER-COUNTVALUE WIDTH EQUALS 0.03
HANDLE IMAGE VOPENER-COUNTVALUE HEIGHT EQUALS 0.13
HANDLE IMAGE VOPENER-COUNTVALUE Y POSITION EQUALS SCALEVAL / 2 - 0.05
HANDLE IMAGE VOPENER-COUNTVALUE X POSITION EQUALS SCALEVAL / 2 - WINDOWWIDTH-VARIABLE / 2 + OPENER WIDTH * VOPENER-
COUNTVALUE - 1 + 0.025 * VOPENER-COUNTVALUE - 0.028 + OPENER WIDTH
NEXT FOR VOPENER-COUNTVALUE
OTHERWISE
VOPENER-COUNTVALUE EQUALS 1
FOR VOPENER-COUNTVALUE EQUALS POSITION TO WINDOWVOPENERS + POSITION - 1
WINDOWHSIDE EQUALS 1
VERTICALOPENERVOPENER-COUNTVALUE VISIBLE EQUALS TRUE
HANDLE IMAGE VOPENER-COUNTVALUE VISIBLE EQUALS TRUE
OPENER WIDTH EQUALS WINDOWWIDTH-VARIABLE - 0.05 - WINDOWVBARS * 0.05 2 / WINDOWVBARS + 1
VERTICALOPENERVOPENER-COUNTVALUE WIDTH EQUALS OPENER WIDTH - 0.05 / 2 - 0.05 / 4
VERTICALOPENERVOPENER-COUNTVALUE X POSITION EQUALS SCALEVAL / 2 - WINDOWWIDTH-VARIABLE / 2 + OPENER WIDTH * VOPENER-
COUNTVALUE - 1 + 0.025 * VOPENER-COUNTVALUE + 0.05 / 2
VERTICALOPENERVOPENER-COUNTVALUE Y POSITION EQUALS SCALEVAL / 2 - WINDOWHEIGHT-VARIABLE / 2 + 0.05 2 + 0.05 4
VERTICALOPENERVOPENER-COUNTVALUE HEIGHT EQUALS INSIDEGLASS SHAPE HEIGHT - 0.05 2
VERTICALOPENERVOPENER-COUNTVALUE STYLE EQUALS 1
VERTICALOPENERVOPENER-COUNTVALUE -COLOUR ISWHITE
VERTICALOPENERVOPENER-COUNTVALUE BORDERWIDTH-VARIABLE -VARIABLE EQUALS 2
HANDLE IMAGE VOPENER-COUNTVALUE WIDTH EQUALS 0.03
HANDLE IMAGE VOPENER-COUNTVALUE HEIGHT EQUALS 0.13
HANDLE IMAGE VOPENER-COUNTVALUE Y POSITION EQUALS SCALEVAL / 2 - 0.05
HANDLE IMAGE VOPENER-COUNTVALUE X POSITION EQUALS SCALEVAL / 2 - WINDOWWIDTH-VARIABLE -VARIABLE / 2 + OPENER WIDTH *
VOPENER-COUNTVALUE - 1 + 0.025 * VOPENER-COUNTVALUE - 0.001
NEXT FOR VOPENER-COUNTVALUE

PVCMETRES TEXTVALUE EQUALS WINDOWWIDTH-VARIABLE -VARIABLE * 2 + 2 * WINDOWHEIGHT-VARIABLE + WINDOWVBARS * WINDOWHEIGHT-VARIABLE


SQRMETRESGLASS TEXTVALUE EQUALS WINDOWWIDTH-VARIABLE -VARIABLE * WINDOWHEIGHT-VARIABLE
HANDLES TEXTVALUE EQUALS WINDOWVOPENERS
HINGES TEXTVALUE EQUALS WINDOWVOPENERS * 3
METRESOFPVC EQUALS WINDOWWIDTH-VARIABLE * 2 + 2 * WINDOWHEIGHT-VARIABLE + WINDOWVBARS * WINDOWHEIGHT-VARIABLE
40
AREAOFGLASS EQUALS WINDOWWIDTH-VARIABLE * WINDOWHEIGHT-VARIABLE
HANDLESNUMBER EQUALS WINDOWVOPENERS
HINGES EQUALS WINDOWVOPENERS * 3
END CONDITION

41
PROCESSING STAGES CREATE ORDER
The create order routine will be the focus of the system, the routine below will
be used to add new customer orders.
DECLARE ADDITEMSENABLED EQUALS STRUCTURE BOOLEAN
DECLARE CUSTOMERID EQUALS STRUCTURE INTEGER
DECLARE JOB--COUNTVALUE EQUALS STRUCTURE INTEGER
DECLARE ITEMIDINDEX EQUALS STRUCTURE INTEGER
DECLARE DATESELECTED EQUALS STRUCTURE BOOLEAN
DECLARE RECORD-COUNTVALUE EQUALS STRUCTURE INTEGER
DECLARE LOADCUSTOMER EQUALS STRUCTURE CUSTOMER
DECLARE CUSTOMERFILEI/OCHANNEL EQUALS STRUCTURE INTEGER
CUSTOMERFILEI/OCHANNEL EQUALS AVAILABLEFILEINTEGER
RECORD-COUNTVALUE EQUALS 1
OPEN FILE CUSTOMERFILEPATH FOR READ/WRITE EQUALS STRUCTURE CUSTOMERFILEI/OCHANNEL LENGTH EQUALS CUSTOMERFILELENGTH
DO WHILE NOT ENDOFFILE CUSTOMERFILEI/OCHANNEL
LOAD RECORD CUSTOMERFILEI/OCHANNEL, RECORD-COUNTVALUE , LOADCUSTOMER
IF ID EQUALS NOT EQUAL 0 THEN:
DECLARE CONTAINS EQUALS STRUCTURE INTEGER
CONTAINS EQUALS ISWITHINSTRING:-LOADCUSTOMER CUSTOMERID, ID
IF LOADCUSTOMER CUSTOMERID EQUALS NOT EQUAL 0 AND CONTAINS EQUALS GREATER THAN 0 THEN:
CUSTOMER LISTCONTROLBOX ADDITEM TRIMOFFWHITESPACE LOADCUSTOMER CUSTOMERID AND TEXT(, TEXT( AND TRIMOFFWHITESPACE
LOADCUSTOMER FORNAME )AND TRIMOFFWHITESPACE LOADCUSTOMER SURNAME
OTHERWISE IF LOADCUSTOMER CUSTOMERID EQUALS NOT EQUAL 0 THEN:
CUSTOMER LISTCONTROLBOX ADDITEM TRIMOFFWHITESPACE LOADCUSTOMER CUSTOMERID AND TEXT(, TEXT( AND TRIMOFFWHITESPACE
LOADCUSTOMER FORNAME )AND TRIMOFFWHITESPACE LOADCUSTOMER SURNAME
RECORD-COUNTVALUE EQUALS RECORD-COUNTVALUE + 1
REPEAT LOOP
CLOSE SYSTEM FILE I/OCHANNEL:CUSTOMERFILEI/OCHANNEL
END CONDITION

DECLARE PART-COUNTVALUE EQUALS STRUCTURE INTEGER


DECLARE TOTALPARTS EQUALS STRUCTURE INTEGER
DECLARE TOTALCOST EQUALS STRUCTURE CURRENCY
DECLARE LABOURCOST EQUALS STRUCTURE CURRENCY
DECLARE GRANDTOTAL EQUALS STRUCTURE CURRENCY
DECLARE ADDITIONALCHARGES EQUALS STRUCTURE CURRENCY
DECLARE VAT EQUALS STRUCTURE CURRENCY
ADDITIONALCHARGES EQUALS VALUE FOR ADDITIONALCHARGES VALUE
LABOURCOST EQUALS VALUE FOR LABOURCOST VALUE
TOTALCOST EQUALS 0
TOTALPARTS EQUALS COST2 LISTCONTROLBOX LIST-COUNTVALUE
FOR PART-COUNTVALUE EQUALS UP TO TOTALPARTS
TOTALCOST EQUALS TOTALCOST + COST2 LISTCONTROLBOX LIST PART-COUNTVALUE - 1
NEXT FOR PART-COUNTVALUE
TOTALCOST TEXTVALUE EQUALS TOTALCOST
VAT EQUALS TOTALCOST + LABOURCOST * 0.2
GRANDTOTAL EQUALS VAT + TOTALCOST + LABOURCOST + ADDITIONALCHARGES
VAT TEXTVALUE EQUALS VAT
GRANDTOTAL TEXTVALUE EQUALS GRANDTOTAL
END CONDITION

PROCEDURE CONDITION: WINDOW LOAD


DECLARE TEMPORDER EQUALS STRUCTURE ORDER
DECLARE ORDERFILEI/OCHANNEL EQUALS STRUCTURE INTEGER
JOB--COUNTVALUE EQUALS 1
RUN CONDITION CUSTOMERSELECTION TEXT(0
RUN CONDITION SEARCHPARTS TRIMOFFWHITESPACE SEARCH VALUE , TRIMOFFWHITESPACE COLOUR VALUE , TRIMOFFWHITESPACE TYPE VALUE
ITEMS LISTCONTROLBOX ADDITEM TEXT(CLICK TO ADD ITEM)
ADDITEMSENABLED EQUALS TRUE
DATEPICKER MINDATE EQUALS DATEVALUE NOW
42
ORDERFILEI/OCHANNEL EQUALS AVAILABLEFILEINTEGER
OPEN FILE ORDERFILEPATH FOR READ/WRITE EQUALS STRUCTURE ORDERFILEI/OCHANNEL LENGTH EQUALS ORDERFILELENGTH
ORDERFILENEXTRECORD EQUALS FILELENGTH ORDERFILEPATH / ORDERFILELENGTH + 1
CLOSE SYSTEM FILE I/OCHANNEL:ORDERFILEI/OCHANNEL
ORDERID TEXTVALUE EQUALS ORDERFILENEXTRECORD + 1000
END CONDITION

PROCEDURE CONDITION: PROCESSORDER-CONTROLCLICKEVENT


DECLARE TEMPJOB- EQUALS STRUCTURE JOB-
DECLARE JOB-FILEI/OCHANNEL EQUALS STRUCTURE INTEGER
DECLARE NUMBEROFITEMS EQUALS STRUCTURE INTEGER
DECLARE ITEM-COUNTVALUE EQUALS STRUCTURE INTEGER
DECLARE NUMBEROFPARTS EQUALS STRUCTURE INTEGER
DECLARE PART-COUNTVALUE EQUALS STRUCTURE INTEGER
DECLARE TEMPITEMSORDER EQUALS STRUCTURE JOB-PARTLINK
DECLARE JOB-PARTLINKFILEI/OCHANNEL EQUALS STRUCTURE INTEGER
DECLARE NEWORDER EQUALS STRUCTURE ORDER
DECLARE ORDERFILEI/OCHANNEL EQUALS STRUCTURE INTEGER
DECLARE SAVEORDER EQUALS STRUCTURE BOOLEAN
IF CUSTOMERDETAILS-CHECKBOXCONTROL VALUE EQUALS 1 THEN:
SAVEORDER EQUALS TRUE
OTHERWISE
SAVEORDER EQUALS FALSE
SHOW MESSAGE: PLEASE CONFIRM CUSTOMER DETAILS
EXIT CONDITION

IF DATESELECTED EQUALS TRUE THEN:


SAVEORDER EQUALS TRUE
OTHERWISE
SAVEORDER EQUALS FALSE
SHOW MESSAGE: PLEASE SELECT A DATE IN THE FUTURE
EXIT CONDITION

IF ITEMID LISTCONTROLBOX LIST-COUNTVALUE EQUALS GREATER THAN 0 THEN:


SAVEORDER EQUALS TRUE
OTHERWISE
SAVEORDER EQUALS FALSE
SHOW MESSAGE: PLEASE ADD AT LEAST ONE ITEM TO MAKE AN ORDER
EXIT CONDITION

IF ITEMPARTS LISTCONTROLBOX LIST-COUNTVALUE EQUALS GREATER THAN 0 THEN:


SAVEORDER EQUALS TRUE
OTHERWISE
SAVEORDER EQUALS FALSE
SHOW MESSAGE: PLEASE ADD AT LEAST ONE STOCK PART TO MAKE AN ORDER
EXIT CONDITION

IF VALUE FOR LABOURCOST VALUE EQUALS GREATER THAN 0 THEN:


SAVEORDER EQUALS TRUE
OTHERWISE
SAVEORDER EQUALS FALSE
SHOW MESSAGE: PLEASE INPUT A LABOUR COST
EXIT CONDITION

IF SAVEORDER EQUALS TRUE THEN:


ORDERFILEI/OCHANNEL EQUALS AVAILABLEFILEINTEGER
OPEN FILE ORDERFILEPATH FOR READ/WRITE EQUALS STRUCTURE ORDERFILEI/OCHANNEL LENGTH EQUALS ORDERFILELENGTH
NEWORDER ORDERID EQUALS ORDERFILENEXTRECORD + 1000
NEWORDER ORDERDATE EQUALS DATEVALUE NOW
NEWORDER ADDITIONALCHARGES EQUALS VALUE FOR ADDITIONALCHARGES VALUE
NEWORDER ADDITIONALCHARGESDESCRIPTION EQUALS ADDCHARGEDETAILS VALUE
NEWORDER LABOURCOST EQUALS VALUE FOR LABOURCOST VALUE
NEWORDER PARTSCOST EQUALS TOTALCOST TEXTVALUE
NEWORDER CUSTOMERID EQUALS CUSTOMERID
NEWORDER GRANDTOTAL EQUALS GRANDTOTAL TEXTVALUE
NEWORDER DUEDATE EQUALS DATEVALUE DATEORDERDUE TEXTVALUE
NEWORDER TAX EQUALS VAT TEXTVALUE
NEWORDER ORDERSTATUS EQUALS TEXT(PENDING)
IF DELIVERY VALUE EQUALS TRUE THEN: 43
NEWORDER REQUIRESDELIVERY EQUALS TRUE
OTHERWISE
NEWORDER REQUIRESDELIVERY EQUALS FALSE
EXIT CONDITION
IF ORDERPAID-CHECKBOXCONTROL VALUE EQUALS 1 THEN:
NEWORDER ORDERPAID EQUALS TRUE
OTHERWISE
NEWORDER ORDERPAID EQUALS FALSE
EXIT CONDITION

INSERT RECORD ORDERFILEI/OCHANNEL, ORDERFILENEXTRECORD, NEWORDER


ORDERFILENEXTRECORD EQUALS ORDERFILENEXTRECORD + 1
CLOSE SYSTEM FILE I/OCHANNEL:ORDERFILEI/OCHANNEL
NUMBEROFITEMS EQUALS ITEMID LISTCONTROLBOX LIST-COUNTVALUE
JOB-FILEI/OCHANNEL EQUALS AVAILABLEFILEINTEGER
OPEN FILE JOB-FILEPATH FOR READ/WRITE EQUALS STRUCTURE JOB-FILEI/OCHANNEL LENGTH EQUALS JOB-FILELENGTH
FOR ITEM-COUNTVALUE EQUALS UP TO NUMBEROFITEMS
TEMPJOB- JOB-ID EQUALS VALUE FOR ITEMID LISTCONTROLBOX LIST ITEM-COUNTVALUE - 1
TEMPJOB- JOB-DESCRIPTION EQUALS ITEMS LISTCONTROLBOX LIST ITEM-COUNTVALUE - 1
TEMPJOB- ITEMHEIGHT-VARIABLE EQUALS VALUE FOR HEIGHT LISTCONTROLBOX LIST ITEM-COUNTVALUE - 1
TEMPJOB- ITEMWIDTH-VARIABLE EQUALS VALUE FOR WIDTH LISTCONTROLBOX LIST ITEM-COUNTVALUE - 1
TEMPJOB- QUANTITY EQUALS VALUE FOR ITEMQUANTITY LISTCONTROLBOX LIST ITEM-COUNTVALUE - 1
TEMPJOB- ORDERID EQUALS NEWORDER ORDERID
TEMPJOB- JOB-STATUS EQUALS TEXT(PENDING)
TEMPJOB- OSTYLE EQUALS VALUE FOR VOPENERS LISTCONTROLBOX LIST ITEM-COUNTVALUE - 1
TEMPJOB- PANELS EQUALS VALUE FORRS LISTCONTROLBOX LIST ITEM-COUNTVALUE - 1
TEMPJOB- OPOSITION EQUALS VALUE FOR OPOSITION LISTCONTROLBOX LIST ITEM-COUNTVALUE - 1
TEMPJOB- HSIDE EQUALS VALUE FOR OSIDE LISTCONTROLBOX LIST ITEM-COUNTVALUE - 1
INSERT RECORD JOB-FILEI/OCHANNEL, JOB-FILENEXTRECORD, TEMPJOB-
JOB-FILENEXTRECORD EQUALS JOB-FILENEXTRECORD + 1
NEXT FOR ITEM-COUNTVALUE
CLOSE SYSTEM FILE I/OCHANNEL:JOB-FILEI/OCHANNEL
NUMBEROFPARTS EQUALS ITEMPARTS LISTCONTROLBOX LIST-COUNTVALUE
JOB-PARTLINKFILEI/OCHANNEL EQUALS AVAILABLEFILEINTEGER
OPEN FILE JOB-PARTLINKFILEPATH FOR READ/WRITE EQUALS STRUCTURE JOB-PARTLINKFILEI/OCHANNEL LENGTH EQUALS JOB-PARTLINKFILELENGTH
FOR PART-COUNTVALUE EQUALS UP TO NUMBEROFPARTS
TEMPITEMSORDER JOB-ID EQUALS VALUE FOR ITEMID2 LISTCONTROLBOX LIST PART-COUNTVALUE - 1
TEMPITEMSORDER PARTID EQUALS VALUE FOR MID ITEMPARTS LISTCONTROLBOX LIST PART-COUNTVALUE - 1 , 1, 4
TEMPITEMSORDER QUANTITY EQUALS VALUE FOR ITEMPARTSQUANTITY LISTCONTROLBOX LIST PART-COUNTVALUE - 1
INSERT RECORD JOB-PARTLINKFILEI/OCHANNEL, JOB-PARTLINKFILENEXTRECORD, TEMPITEMSORDER
JOB-PARTLINKFILENEXTRECORD EQUALS JOB-PARTLINKFILENEXTRECORD + 1
NEXT FOR PART-COUNTVALUE
CLOSE SYSTEM FILE I/OCHANNEL:JOB-PARTLINKFILEI/OCHANNEL
SHOW MESSAGE: ORDER CREATED
MAINMENU DISPLAY WINDOW
CLOSE WINDOW
END CONDITION

44
PROCESSING STAGES EDIT CUSTOMER
Edit customer routine will be used to modify users data, in compliance with the
data protection act.
DECLARE DETAILS EQUALS STRUCTURE CUSTOMER
DECLARE RECORDLOCATION EQUALS STRUCTURE INTEGER

DECLARE CUSTOMERFILEI/OCHANNEL EQUALS STRUCTURE INTEGER


CUSTOMERFILEI/OCHANNEL EQUALS AVAILABLEFILEINTEGER
OPEN FILE CUSTOMERFILEPATH FOR READ/WRITE EQUALS STRUCTURE CUSTOMERFILEI/OCHANNEL LENGTH EQUALS CUSTOMERFILELENGTH
DETAILS TITLE EQUALS TITLE VALUE
DETAILS FORNAME EQUALS FORNAME VALUE
DETAILS SURNAME EQUALS SURNAME VALUE
DETAILS ADDRESSLINE1 EQUALS ADD1 VALUE
DETAILS ADDRESSLINE2 EQUALS ADD2 VALUE
DETAILS ADDRESSLINE3 EQUALS ADD3 VALUE
DETAILS POSTCODE EQUALS POSTCODE VALUE
DETAILS PHONENUMBER EQUALS TELEPHONE VALUE
DETAILS EMAIL EQUALS EMAIL VALUE
IF BCUST-CHECKBOXCONTROL VALUE EQUALS 1 THEN:
DETAILS BUSINESSCUSTOMER EQUALS TRUE
DETAILS BUSINESSNAME EQUALS BUSINESSNAME VALUE
OTHERWISE
DETAILS BUSINESSCUSTOMER EQUALS FALSE
DETAILS BUSINESSNAME EQUALS TEXT(-)
END CONDITION
INSERT RECORD CUSTOMERFILEI/OCHANNEL, RECORDLOCATION, DETAILS
CLOSE SYSTEM FILE I/OCHANNEL:CUSTOMERFILEI/OCHANNEL
SHOW MESSAGE: CUSTOMER DETAILS SAVED
CLOSE WINDOW

PROCEDURE CONDITION: LOAD SCREEN


DECLARE CUSTOMERFILEI/OCHANNEL EQUALS STRUCTURE INTEGER
DECLARE RECORD-COUNTVALUE EQUALS STRUCTURE INTEGER
DECLARE FOUND EQUALS STRUCTURE BOOLEAN
FOUND EQUALS FALSE
RECORD-COUNTVALUE EQUALS 1
CUSTOMERFILEI/OCHANNEL EQUALS AVAILABLEFILEINTEGER
OPEN FILE CUSTOMERFILEPATH FOR READ/WRITE EQUALS STRUCTURE CUSTOMERFILEI/OCHANNEL LENGTH EQUALS CUSTOMERFILELENGTH
DO WHILE FOUND EQUALS FALSE AND NOT ENDOFFILE CUSTOMERFILEI/OCHANNEL
LOAD RECORD CUSTOMERFILEI/OCHANNEL, RECORD-COUNTVALUE , DETAILS
IF DETAILS CUSTOMERID EQUALS PIN THEN:
FOUND EQUALS TRUE
RECORDLOCATION EQUALS RECORD-COUNTVALUE
END CONDTITION
RECORD-COUNTVALUE EQUALS RECORD-COUNTVALUE + 1
REPEAT LOOP
IF FOUND EQUALS TRUE THEN:
TITLE VALUE EQUALS DETAILS TITLE
FORNAME VALUE EQUALS DETAILS FORNAMEME
SURNAME VALUE EQUALS DETAILS SURNAMEME
ADD1 VALUE EQUALS DETAILS ADDRESSLINE1
ADD2 VALUE EQUALS DETAILS ADDRESSLINE2
ADD3 VALUE EQUALS DETAILS ADDRESSLINE3
POSTCODE VALUE EQUALS DETAILS POSTCODE
TELEPHONE VALUE EQUALS DETAILS PHONENUMBER
EMAIL VALUE EQUALS DETAILS EMAIL
IF DETAILS BUSINESSCUSTOMER EQUALS TRUE THEN:
BCUST-CHECKBOXCONTROL VALUE EQUALS 1
OTHERWISE
BCUST-CHECKBOXCONTROL VALUE EQUALS 0
END CONDITION 45
OTHERWISE
SHOW MESSAGE: NO USER FOUND
CLOSE WINDOW
END CONDITION

46
PROCESSING STAGES LOW STOCK
The low stock screen will open the three order files, in addition to the stock file
to find and suggest order quantities for low stock.
PROCEDURE CONDITION: WINDOW LOAD
DECLARE RECORD-COUNTVALUE EQUALS STRUCTURE INTEGER
DECLARE LOADSTOCK EQUALS STRUCTURE STOCK
DECLARE STOCKFILEI/OCHANNEL EQUALS STRUCTURE INTEGER
DECLARE JOB-LINKFILEI/OCHANNEL EQUALS STRUCTURE INTEGER
DECLARE LOADJOB-LINK EQUALS STRUCTURE JOB-PARTLINK
DECLARE JOB-LINK-COUNTVALUE EQUALS STRUCTURE INTEGER
DECLARE JOB-DETAILS EQUALS STRUCTURE JOB-
DECLARE JOB-FILEI/OCHANNEL EQUALS STRUCTURE INTEGER
DECLARE JOB-FILE-COUNTVALUE EQUALS STRUCTURE INTEGER
DECLARE JOB-SWITHPART EQUALS STRUCTURE INTEGER
DECLARE FOUNDJOB- EQUALS STRUCTURE BOOLEAN
DECLARE REQUIREDQUANTITY EQUALS STRUCTURE INTEGER
DECLARE DISPLAYITEM EQUALS STRUCTURE BOOLEAN
PARTID LISTCONTROLBOX CLEAR
PARTDESCRIPTION LISTCONTROLBOX CLEAR
MANUFACTURER LISTCONTROLBOX CLEAR
STOCKLEVEL LISTCONTROLBOX CLEAR
ITEMREORDERLEVEL LISTCONTROLBOX CLEAR
STOCKFILEI/OCHANNEL EQUALS AVAILABLEFILEINTEGER
RECORD-COUNTVALUE EQUALS 1
OPEN FILE STOCKFILEPATH FOR READ/WRITE EQUALS STRUCTURE STOCKFILEI/OCHANNEL LENGTH EQUALS STOCKFILELENGTH
DO WHILE NOT ENDOFFILE STOCKFILEI/OCHANNEL
LOAD RECORD STOCKFILEI/OCHANNEL, RECORD-COUNTVALUE , LOADSTOCK IF LOADSTOCK STOCKLEVEL EQUALS LESS THAN LOADSTOCK REORDERLEVEL
THEN:
JOB-SWITHPART EQUALS 0
JOB-LINK-COUNTVALUE EQUALS 1
DISPLAYITEM EQUALS FALSE
JOB-LINKFILEI/OCHANNEL EQUALS AVAILABLEFILEINTEGER
OPEN FILE JOB-PARTLINKFILEPATH FOR READ/WRITE EQUALS STRUCTURE JOB-LINKFILEI/OCHANNEL LENGTH EQUALS JOB-PARTLINKFILELENGTH
DO WHILE NOT ENDOFFILE JOB-LINKFILEI/OCHANNEL
LOAD RECORD JOB-LINKFILEI/OCHANNEL, JOB-LINK-COUNTVALUE , LOADJOB-LINK
IF LOADJOB-LINK PARTID EQUALS LOADSTOCK PARTID THEN:
FOUNDJOB- EQUALS FALSE
JOB-FILE-COUNTVALUE EQUALS 1
JOB-FILEI/OCHANNEL EQUALS AVAILABLEFILEINTEGER
OPEN FILE JOB-FILEPATH FOR READ/WRITE EQUALS STRUCTURE JOB-FILEI/OCHANNEL LENGTH EQUALS JOB-FILELENGTH
DO WHILE NOT ENDOFFILE JOB-FILEI/OCHANNEL AND FOUNDJOB- EQUALS FALSE
LOAD RECORD JOB-FILEI/OCHANNEL, JOB-FILE-COUNTVALUE , JOB-DETAILS
IF TRIMOFFWHITESPACE JOB-DETAILS JOB-STATUS EQUALS TEXT(PENDING) THEN:
JOB-SWITHPART EQUALS JOB-SWITHPART + 1
REQUIREDQUANTITY EQUALS LOADJOB-LINK QUANTITY * JOB-DETAILS QUANTITY
FOUNDJOB- EQUALS TRUE
END CONDITION
JOB-FILE-COUNTVALUE EQUALS JOB-FILE-COUNTVALUE + 1
REPEAT LOOP
CLOSE SYSTEM FILE I/OCHANNEL:JOB-FILEI/OCHANNEL
END CONDITION
JOB-LINK-COUNTVALUE EQUALS JOB-LINK-COUNTVALUE + 1
REPEAT LOOP
CLOSE SYSTEM FILE I/OCHANNEL:JOB-LINKFILEI/OCHANNEL

IF LOADSTOCK DISCONTINUED EQUALS TRUE AND REQUIREDQUANTITY EQUALS 0 THEN:


DISPLAYITEM EQUALS FALSE
OTHERWISE
DISPLAYITEM EQUALS TRUE
END CONDITION

IF DISPLAYITEM EQUALS TRUE THEN:


PARTID LISTCONTROLBOX ADDITEM LOADSTOCK PARTID

47
PARTDESCRIPTION LISTCONTROLBOX ADDITEM TRIMOFFWHITESPACE LOADSTOCK PARTNAME )AND TRIMOFFWHITESPACE LOADSTOCK
PARTCOLOUR )AND TRIMOFFWHITESPACE LOADSTOCK PARTTYPE
MANUFACTURER LISTCONTROLBOX ADDITEM LOADSTOCK PARTMANUFACTURER
STOCKLEVEL LISTCONTROLBOX ADDITEM LOADSTOCK STOCKLEVEL )AND LOADSTOCK STOCKUNITS
ITEMREORDERLEVEL LISTCONTROLBOX ADDITEM LOADSTOCK REORDERLEVEL )AND LOADSTOCK STOCKUNITS
PENDINGORDERS LISTCONTROLBOX ADDITEM JOB-SWITHPART
REQUIREDQUANTITY LISTCONTROLBOX ADDITEM REQUIREDQUANTITY )AND LOADSTOCK STOCKUNITS
SUGGESTEDORDERLEVEL LISTCONTROLBOX ADDITEM INT REQUIREDQUANTITY + LOADSTOCK REORDERLEVEL * 0.5 + LOADSTOCK REORDERLEVEL
)AND LOADSTOCK STOCKUNITS
END CONDITION

REQUIREDQUANTITY EQUALS 0
JOB-SWITHPART EQUALS 0
RECORD-COUNTVALUE EQUALS RECORD-COUNTVALUE + 1
REPEAT LOOP
CLOSE SYSTEM FILE I/OCHANNEL:STOCKFILEI/OCHANNEL
END CONDITION

48
PROCESSING STAGES LOAD ORDER
This routine will be used for many outputs, below is a generic usage routine, but
filters etc will be used in conjunction with this.
DECLARE -COUNTVALUE EQUALS STRUCTURE INTEGER
DECLARE STOCK-COUNTVALUE EQUALS STRUCTURE INTEGER
DECLARE JOB-ID EQUALS STRUCTURE INTEGER
DECLARE TEMPJOB- EQUALS STRUCTURE JOB-PARTLINK
DECLARE JOB-PARTLINKFILEI/OCHANNEL EQUALS STRUCTURE INTEGER
DECLARE TEMPSTOCK EQUALS STRUCTURE STOCK
DECLARE STOCKFILEI/OCHANNEL EQUALS STRUCTURE INTEGER
FOR -COUNTVALUE EQUALS 0 TO CALITEMID LISTCONTROLBOX LIST-COUNTVALUE - 1
IF CALITEMID LISTCONTROLBOX SELECTED -COUNTVALUE EQUALS TRUE THEN:
JOB-ID EQUALS CALITEMID LISTCONTROLBOX LIST -COUNTVALUE
EXIT FOR
END CONDITION
NEXT FOR -COUNTVALUE
CALPARTCOST LISTCONTROLBOX CLEAR
CALPARTQUANTITY LISTCONTROLBOX CLEAR
CALPARTDESCRIPTION LISTCONTROLBOX CLEAR
CALSTOCKID LISTCONTROLBOX CLEAR
-COUNTVALUE EQUALS 1
JOB-PARTLINKFILEI/OCHANNEL EQUALS AVAILABLEFILEINTEGER
OPEN FILE JOB-PARTLINKFILEPATH FOR READ/WRITE EQUALS STRUCTURE JOB-PARTLINKFILEI/OCHANNEL LENGTH EQUALS JOB-PARTLINKFILELENGTH
DO WHILE NOT ENDOFFILE JOB-PARTLINKFILEI/OCHANNEL
LOAD RECORD JOB-PARTLINKFILEI/OCHANNEL, -COUNTVALUE , TEMPJOB-
IF TRIMOFFWHITESPACE TEMPJOB- JOB-ID EQUALS TRIMOFFWHITESPACE JOB-ID THEN:
CALSTOCKID LISTCONTROLBOX ADDITEM TEMPJOB- PARTID
STOCK-COUNTVALUE EQUALS 1
STOCKFILEI/OCHANNEL EQUALS AVAILABLEFILEINTEGER
OPEN FILE STOCKFILEPATH FOR READ/WRITE EQUALS STRUCTURE STOCKFILEI/OCHANNEL LENGTH EQUALS STOCKFILELENGTH
DO WHILE NOT ENDOFFILE STOCKFILEI/OCHANNEL
LOAD RECORD STOCKFILEI/OCHANNEL, STOCK-COUNTVALUE , TEMPSTOCK
IF TEMPSTOCK PARTID EQUALS TEMPJOB- PARTID THEN:
CALPARTDESCRIPTION LISTCONTROLBOX ADDITEM TRIMOFFWHITESPACE TEMPSTOCK PARTNAME )AND
TRIMOFFWHITESPACE TEMPSTOCK PARTCOLOUR )AND TRIMOFFWHITESPACE TEMPSTOCK PARTTYPE
CALPARTQUANTITY LISTCONTROLBOX ADDITEM TEMPJOB- QUANTITY
CALPARTCOST LISTCONTROLBOX ADDITEM TEXT() AND TEMPSTOCK PARTPRICE
END CONDITION
STOCK-COUNTVALUE EQUALS STOCK-COUNTVALUE + 1
REPEAT LOOP
CLOSE SYSTEM FILE I/OCHANNEL:STOCKFILEI/OCHANNEL
END CONDITION
-COUNTVALUE EQUALS -COUNTVALUE + 1
REPEAT LOOP
CLOSE SYSTEM FILE I/OCHANNEL:JOB-PARTLINKFILEI/OCHANNEL
END CONDITION

49
PROCESSING STAGES LOAD CUSTOMER
Load customer routines will be used to load customer details when making
orders, so that the customer can be confirmed. The routine will also be used to
load all customers into the all customers table.
DECLARE RECORD-COUNTVALUE EQUALS STRUCTURE INTEGER
DECLARE LOADCUSTOMER EQUALS STRUCTURE CUSTOMER
DECLARE CUSTOMERFILEI/OCHANNEL EQUALS STRUCTURE INTEGER

CUSTOMERFILEI/OCHANNEL EQUALS AVAILABLEFILEINTEGER


OPEN FILE CUSTOMERFILEPATH FOR READ/WRITE EQUALS STRUCTURE CUSTOMERFILEI/OCHANNEL LENGTH EQUALS CUSTOMERFILELENGTH
LOAD RECORD CUSTOMERFILEI/OCHANNEL, RECORD-COUNTVALUE , LOADCUSTOMER
DO WHILE NOT ENDOFFILE CUSTOMERFILEI/OCHANNEL
PIN LISTCONTROLBOX ADDITEM LOADCUSTOMER CUSTOMERID
NAME LISTCONTROLBOX ADDITEM TRIMOFFWHITESPACE LOADCUSTOMER FORNAME )AND TRIMOFFWHITESPACE LOADCUSTOMER SURNAME
IF LOADCUSTOMER BUSINESSCUSTOMER EQUALS TRUE THEN:
BUSINESSTF LISTCONTROLBOX ADDITEM TEXT(YES
OTHERWISE
BUSINESSTF LISTCONTROLBOX ADDITEM TEXT( NO
END CONDITION
BUSINESSNAME LISTCONTROLBOX ADDITEM TRIMOFFWHITESPACE LOADCUSTOMER BUSINESSNAME
ADDRESS LISTCONTROLBOX ADDITEM TRIMOFFWHITESPACE LOADCUSTOMER ADDRESSLINE1 AND TEXT(, TEXT( AND TRIMOFFWHITESPACE LOADCUSTOMER
ADDRESSLINE2 AND TEXT(, TEXT( AND TRIMOFFWHITESPACE LOADCUSTOMER ADDRESSLINE3 AND TEXT(, TEXT( AND TRIMOFFWHITESPACE LOADCUSTOMER
POSTCODE
PHONE LISTCONTROLBOX ADDITEM TRIMOFFWHITESPACE LOADCUSTOMER PHONENUMBER
EMAIL LISTCONTROLBOX ADDITEM TRIMOFFWHITESPACE LOADCUSTOMER EMAIL
RECORD-COUNTVALUE EQUALS RECORD-COUNTVALUE + 1
LOAD RECORD CUSTOMERFILEI/OCHANNEL, RECORD-COUNTVALUE , LOADCUSTOMER
REPEAT LOOP
CLOSE SYSTEM FILE I/OCHANNEL:CUSTOMERFILEI/OCHANNEL
END CONDITION

50
PROCESSING STAGES SEARCH ORDER
The search order routine will be used in many places, but main usage will fall on
the all orders table, on the order management tab. All orders that meet the
criterion selected by the user will be shown in the table.
DECLARE LOADORDER EQUALS STRUCTURE ORDER
DECLARE ORDER-COUNTVALUE EQUALS STRUCTURE INTEGER
DECLARE CUSTOMERIDFOUND EQUALS STRUCTURE BOOLEAN
DECLARE CUSTOMERSEARCH-COUNTVALUE EQUALS STRUCTURE INTEGER
DECLARE CUSTOMERFILEI/OCHANNEL EQUALS STRUCTURE INTEGER
DECLARE ORDERFILEI/OCHANNEL EQUALS STRUCTURE INTEGER
DECLARE LOADCUSTOMER EQUALS STRUCTURE CUSTOMER
DECLARE SEARCHTERM EQUALS STRUCTURE STRING
SEARCHTERM EQUALS INPUTBOX TEXT(INPUT ORDER ID TO SEARCH AN ORDER TEXT(, TEXT(INPUT ORDER ID))

ORDER-COUNTVALUE EQUALS 1
ORDERFILEI/OCHANNEL EQUALS AVAILABLEFILEINTEGER
OPEN FILE ORDERFILEPATH FOR READ/WRITE EQUALS STRUCTURE ORDERFILEI/OCHANNEL LENGTH EQUALS ORDERFILELENGTH
DO WHILE NOT ENDOFFILE ORDERFILEI/OCHANNEL
LOAD RECORD ORDERFILEI/OCHANNEL, ORDER-COUNTVALUE , LOADORDER
IF LOADORDER ORDERID EQUALS VALUE FOR SEARCHTERM AND LOADORDER ORDERID EQUALS NOT EQUAL 0 THEN:
ORDERID LISTCONTROLBOX ADDITEM TRIMOFFWHITESPACE LOADORDER ORDERID
CUSTOMERID LISTCONTROLBOX ADDITEM LOADORDER CUSTOMERID
CUSTOMERFILEI/OCHANNEL EQUALS AVAILABLEFILEINTEGER
CUSTOMERSEARCH-COUNTVALUE EQUALS 1
CUSTOMERIDFOUND EQUALS FALSE
OPEN FILE CUSTOMERFILEPATH FOR READ/WRITE EQUALS STRUCTURE CUSTOMERFILEI/OCHANNEL LENGTH EQUALS CUSTOMERFILELENGTH
DO WHILE NOT ENDOFFILE CUSTOMERFILEI/OCHANNEL AND CUSTOMERIDFOUND EQUALS FALSE
LOAD RECORD CUSTOMERFILEI/OCHANNEL, CUSTOMERSEARCH-COUNTVALUE , LOADCUSTOMER
IF LOADCUSTOMER CUSTOMERID EQUALS LOADORDER CUSTOMERID THEN:
CUSTOMERNAME LISTCONTROLBOX ADDITEM TRIMOFFWHITESPACE LOADCUSTOMER FORNAME )AND
TRIMOFFWHITESPACE LOADCUSTOMER SURNAME
DELIVERYADDRESS LISTCONTROLBOX ADDITEM TRIMOFFWHITESPACE LOADCUSTOMER ADDRESSLINE1 )AND
TRIMOFFWHITESPACE LOADCUSTOMER ADDRESSLINE2 )AND TRIMOFFWHITESPACE LOADCUSTOMER ADDRESSLINE3 )AND
TRIMOFFWHITESPACE LOADCUSTOMER POSTCODE
CUSTOMERIDFOUND EQUALS TRUE
END CONDITION
CUSTOMERSEARCH-COUNTVALUE EQUALS CUSTOMERSEARCH-COUNTVALUE + 1
REPEAT LOOP
IF CUSTOMERIDFOUND EQUALS FALSE THEN:
CUSTOMERNAME LISTCONTROLBOX ADDITEM TEXT(CUSTOMER NO LONGER EXISTS)
END CONDITION
CLOSE SYSTEM FILE I/OCHANNEL:CUSTOMERFILEI/OCHANNEL
ORDERSTATUS LISTCONTROLBOX ADDITEM LOADORDER ORDERSTATUS
PARTSCOST LISTCONTROLBOX ADDITEM TEXT() AND LOADORDER PARTSCOST
LABOURCOST LISTCONTROLBOX ADDITEM TEXT() AND LOADORDER LABOURCOST
TOTALCOST LISTCONTROLBOX ADDITEM TEXT() AND LOADORDER GRANDTOTAL
ADDITIONALCHARGES LISTCONTROLBOX ADDITEM TEXT() AND LOADORDER ADDITIONALCHARGES
ADDITIONALCHARGESDESCRIPTION LISTCONTROLBOX ADDITEM LOADORDER ADDITIONALCHARGESDESCRIPTION
END CONDITION
ORDER-COUNTVALUE EQUALS ORDER-COUNTVALUE + 1
REPEAT LOOP
CLOSE SYSTEM FILE I/OCHANNEL:ORDERFILEI/OCHANNEL
END PROCEDURE CONDITION

51
Evaluation Criteria
To ensue my software package meets the requirements set out in the problem definition and
problem investigation and analysis, I will define a list of specific criteria that my end program should
be able to achieve. Each criterion will be quantifiable, specific and detailed. This will allow me to use
them to analyse the end project.

1. The program should be intuitive in design and should allow use without reference to the
program documentation, specifically the user guide.

2. The program should provide detailed error messages in response to any invalid actions or
program crashes.

3. The navigation should revolve around the tabbed design to ensure the user does not need to
navigate menu to menu to carry out simple tasks.

4. The system should follow a design that adheres to the dekko green outlined in the problem
analysis. This colour should be used throughout and the system should use consistent design.

5. The program should not crash when invalid inputs are given, the program should deal with
this through validation.

6. The program should not allow required information, such as customer name, to be left null
when creating new records.

7. The program should provide all tools and features outlined in previous pages of this
document.

8. The program should support a large number of customers and stock parts, i.e. 400 of each.

9. The user guide should cover all features of the software comprehensively, enabling novice
users to navigate and use the system.

10. It should be easy to create a new order: search tools should aid input of customer pin number
and stock items for each part.

11. The CAD tool should provide a detailed drawing of the end product and enable customer
confirmation that the ordered item is the desired and intended design.

12. Orders that have been marked as complete of due date has passed should be archived and
not shown in regular system outputs.

52
Program Flow Diagram
Over the following pages is a flow diagram showing the possible navigation around the forms that together, create a working software solution.
Due to the large number of forms the diagram is split across multiple pages, but this is addressed clearly, using labelled boxes on the pages.
The software functions around the main menu which consists of multiple tabs. Because of this, it is not possible to show all controls on the main menu
simultaneously, therefore to maintain clarity, each tab is shown in a separate screenshot.

53
Add Customer
Form

Edit Customer
Form

54
Orders Outlook Tab
(Using navigation bar)

55
Main Menu
(Order Viewer Tab)

56
Orders Outlook Tab
(Using navigation bar)

57
Main Menu
(Customer Management Tab)

58
File Variables Module
Option Explicit

Global customerfilepath As String 'Stores the customer file path


Global customerfilelength As Integer 'the byte length of the customer file
Global customerfilenextrecord As Integer 'the next available record position in the customer file

Global orderfilepath As String 'Stores the order file path


Global orderfilelength As Integer 'the byte length of the order file
Global orderfilenextrecord As Integer 'the next available record position in the order file

Global jobfilepath As String 'Stores the job file path


Global jobfilelength As Integer 'the byte length of the job file
Global jobfilenextrecord As Integer 'the next available record position in the job file

Global jobpartlinkfilepath As String 'Stores the job link file path


Global jobpartlinkfilelength As Integer 'the byte length of the job link file
Global jobpartlinkfilenextrecord As Integer 'the next available record position in the joblink file

Global stockfilepath As String 'Stores the stock file path


Global stockfilelength As Integer 'the byte length of the stock file
Global stockfilenextrecord As Integer 'the next available record position in the stock file

List of Variables

Variable Name Type Usage Procedure


customerfilepath String Stores the customer file path Global

customerfilelength Integer the byte length of the customer file Global

customerfilenextrecord Integer the next available record position in the customer file Global

orderfilepath String Stores the order file path Global

orderfilelength Integer the byte length of the order file Global

orderfilenextrecord Integer the next available record position in the order file Global

jobfilepath String Stores the job file path Global

jobfilelength Integer the byte length of the job file Global

59
jobfilenextrecord Integer the next available record position in the job file Global

jobpartlinkfilepath String Stores the job link file path Global


jobpartlinkfilelength Integer the byte length of the job link file Global

jobpartlinkfilenextrecord Integer the next available record position in the joblink file Global

stockfilepath String Stores the stock file path Global

stockfilelength Integer the byte length of the stock file Global

stockfilenextrecord Integer the next available record position in the stock file Global

60
File Records Module
Option Explicit

Type customer 'used to store customer details into a record structure


customerid As Integer 'primary key - unique 4 digit id number
title As String * 3 'the title of the customer
forename As String * 20 'the customers first name
surname As String * 20 'the customers second name
addressline1 As String * 30 'the customers delivery address line 1
addressline2 As String * 30 'the customers delivery address line 2
addressline3 As String * 30 'the customers delivery address line 2
postcode As String * 7 'the customers delivery poscode
businesscustomer As Boolean 'whether the customer is a business asset
phonenumber As String * 14 'the phone number of the customer
email As String * 30 'the customers email address
businessname As String * 30 'the business name (if applicable)
End Type

Type order 'used to store order details into a record structure


orderid As Integer 'primary key - unique 4 digit order id number
customerid As Integer 'foreign key - customers unique 4 digit id number
orderdate As Date 'the date the order was made
duedate As Date 'the date the order is required for
partscost As Currency 'the cost of the stock needed for the order
labourcost As Currency 'the total labour cost for the order
additionalcharges As Currency 'any additional charges that will be made
additionalchargesdescription As String * 200 'the reason for the additional charges
requiresdelivery As Boolean 'whether the order requires delivery or not
orderpaid As Boolean 'whether the order has been paid in full
grandtotal As Currency 'the total cost tobe paid by the customer
tax As Currency 'the proportion of the order that is tax
orderstatus As String * 10 'the current status of the order
End Type

Type job 'used to store job details into a record structure


jobid As Integer 'primary key - unique 4 digit job id number
orderid As Integer 'foreign key - orders unique 4 digit id number
quantity As Integer 'the quantity of the item that needs to be made
jobdescription As String * 30 'the description of the item
itemwidth As Double 'the width of thee item in metres (where required)
itemheight As Double 'the height of thee item in metres (where required)
jobstatus As String * 10 'the status of the item in the manufacturing process
panels As Integer 'the number of panels the item consists of (where required)
ostyle As Integer 'the style of the item (where required)
oposition As Integer 'the position of the opener (where required)
hside As Integer 'the side which the handle needs to be fitted on (where required)
End Type

Type jobpartlink 'used to store job link details into a record structure
jobid As Integer 'foreign key - unique 4 digit job id number
partid As Integer 'primary key - unique 4 digit stock id number
quantity As Integer 'the quantity of the stock required
End Type

Type stock 'used to store stock details into a record structure


partid As Integer 'primary key - unique 4 digit stock id number
parttype As String * 20 'the type of the stock

61
partname As String * 20 'the name of the stock item
partmanufacturer As String * 20 'the name of the stock manufacturers
partprice As Currency 'the cost of the stock item from the manufacturers
stocklevel As Integer 'teh current level of the stock item
stockunits As String * 20 'the units the stock item is mesured in
partcolour As String * 20 'the colour of th stock item
partdescription As String * 100 'a desrciption of the stock item
reorderlevel As Integer 'the level at which the stock required re-ordering
discontinued As Boolean 'flagged to discontinue the stock from the system
End Type

62
Global Variables Module
Option Explicit
'used to pass information betweeen forms
Global nextcustomerpin As Integer 'stores the next available customer pin
Global useridforedit As Integer 'stores the edit user id

'used for default colour settings


Global mygrey As String 'used to make objects grey
Global mygreen As String 'used to make objects green
c
'used for the CAD design tools
Global windowwidth As Double 'stores the door/window width
Global windowheight As Double 'stores the door/window height
Global windowvbars As Integer 'stores the door/window number of 'segments'
Global windowvopeners As Integer 'stores the door/window style/openers
Global windowoposition As Integer 'stores the door/window opener position
Global windowhside As Integer 'stores the door/window handle side
Global cadwindowedit As Boolean 'stores the window edit status
Global caddooredit As Boolean 'stores the door edit status
Global metresofpvc As Integer 'stores the door/windows metres of pvc needed
Global areaofglass As Integer 'stores the windows area of glass
Global areaoffacia As Integer 'stores the doors area of facia
Global handlesnumber As Integer 'stores the door/windows number of handles
Global hinges As Integer 'stores the door/windows number of hinges

List of Variables

Variable Name Type Usage Procedure


nextcustomerpin Integer stores the next available customer pin Global

useridforedit Integer stores the edit user id Global

mygrey String used to make objects grey Global

mygreen String used to make objects green Global

windowwidth Double stores the door/window width Global

windowheight Double stores the door/window height Global

windowvbars Integer stores the door/window number of 'segments' Global

windowvopeners Integer stores the door/window style/openers Global

windowoposition Integer stores the door/window opener position Global

63
windowhside Integer stores the door/window handle side Global
cadwindowedit Boolean stores the window edit status Global

caddooredit Boolean stores the door edit status Global

metresofpvc Integer stores the door/windows metres of pvc needed Global

areaofglass Integer stores the windows area of glass Global

areaoffacia Integer stores the doors area of facia Global

handlesnumber Integer stores the door/windows number of handles Global

hinges Integer stores the door/windows number of hinges Global

64
Add Customer Form

Option Explicit

Private Sub addcustomer_btn_Click() 'Saves the new customer record to the customer file
Dim newdetails As customer 'stores the new details in a record sturcture temporarily
Dim customerfilechannel As Integer 'used for the os to communicate with thehard disk
Dim savecustomer As Boolean 'triggered when the new record has been added
savecustomer = False

If title_txt.text <> "" Then 'Checks that the requiredd details are present before saving
savecustomer = True
Else
savecustomer = False
MsgBox ("Please Input Customer Title.")
Exit Sub
End If

If forename_txt.text <> "" Then 'Checks that the requiredd details are present before saving

65
savecustomer = True
Else
savecustomer = False
MsgBox ("Please Input Customer Forename.")
Exit Sub
End If

If surname_txt.text <> "" Then 'Checks that the requiredd details are present before saving
savecustomer = True
Else
savecustomer = False
MsgBox ("Please Input Customer Surname.")
Exit Sub
End If

If add1_txt.text <> "" Then 'Checks that the requiredd details are present before saving
savecustomer = True
Else
savecustomer = False
MsgBox ("Please Input Customer Address Line 1.")
Exit Sub
End If

If add2_txt.text <> "" Then 'Checks that the required details are present before saving
savecustomer = True
Else
savecustomer = False
MsgBox ("Please Input Customer Address Line 2.")
Exit Sub
End If

If add3_txt.text <> "" Then 'Checks that the required details are present before saving
savecustomer = True
Else
savecustomer = False
MsgBox ("Please Input Customer Address Line 3.")
Exit Sub
End If

If postcode_txt.text <> "" Then 'Checks that the required details are present before saving
savecustomer = True
Else
savecustomer = False
MsgBox ("Please Input Customer Postcode.")
Exit Sub
End If

If telephone_txt.text <> "" Then 'Checks that the required details are present before saving
savecustomer = True
Else
savecustomer = False
MsgBox ("Please Input Customer Phone number.")
Exit Sub
End If

If email_txt.text <> "" Then 'Checks that the required details are present before saving
savecustomer = True
Else
savecustomer = False
MsgBox ("Please Input Customer Email Address.")

66
Exit Sub
End If

If businessname_txt.text = "" And bcust_chk.Value = 1 Then 'Checks that the required details are present before saving
savecustomer = False
MsgBox ("Please Input Customer's Business Name.")
Exit Sub
Else
savecustomer = True

End If

If savecustomer = True Then 'if all the checks have been passed then save the record into the file
customerfilechannel = FreeFile 'Sets the file number to an available one
Open customerfilepath For Random As customerfilechannel Len = customerfilelength 'Opens the customer file for random actions (read/write)
customerfilenextrecord = (FileLen(customerfilepath) / customerfilelength) + 1
nextcustomerpin = customerfilenextrecord + 1000 'sets the new pin for the customer
newdetails.customerid = nextcustomerpin 'sets the fields data to the entered data
newdetails.title = title_txt.text
newdetails.forename = forename_txt.text
newdetails.surname = surname_txt.text
newdetails.addressline1 = add1_txt.text
newdetails.addressline2 = add2_txt.text
newdetails.addressline3 = add3_txt.text
newdetails.postcode = postcode_txt.text
newdetails.phonenumber = telephone_txt.text
newdetails.email = email_txt.text
If bcust_chk.Value = 1 Then 'if business customer, save the business' name too
newdetails.businesscustomer = True
newdetails.businessname = businessname_txt.text
Else
newdetails.businesscustomer = False
newdetails.businessname = "-"
End If
Put customerfilechannel, customerfilenextrecord, newdetails
Close customerfilechannel
Call mainmenu_frm.LoadAllCustomersTable 'refreshes the main menu table
Unload Me 'closes the form
End If
End Sub

Private Sub cancel_btn_Click() 'used to cancel the action and closes the form
Unload Me
End Sub

67
68
Procedure/Subroutine Details

Procedure/Function/Form Purpose Links to Other Procedures


addcustomer_btn_Click Saves the new customer record to the customer file
cancel_btn_Click used to cancel the action and closes the form

List of Variables

Variable Name Type Usage Procedure


newdetails customer stores the new details in a record sturcture temporarily addcustomer_btn_Click

customerfilechannel Integer used for the os to communicate with thehard disk addcustomer_btn_Click

savecustomer Boolean triggered when the new record has been added addcustomer_btn_Click

69
Add Stock Form

Option Explicit

Private Sub addpart_btn_Click() 'used to save the new stock details into a new record in the stock entity
Dim newstock As stock 'a record in ram to store the new details before passing to the file
Dim stockfilechannel As Integer 'used for file communication
Dim nextstockid As Integer 'the next available id number for the stock
Dim savestock As Boolean 'flagged when any checks have failed to prevent saving invalid data

If partname_txt.text <> "" Then 'Checks that the required details are present before saving
savestock = True
Else
savestock = False

70
MsgBox ("Please Input Part Name.")
Exit Sub
End If

If partcolour_com.text <> "Please Select..." Then 'Checks that the required details are present before saving
savestock = True
Else
savestock = False
MsgBox ("Please Input Colour Description.")
Exit Sub
End If

If parttype_com.text <> "Please Select..." Then 'Checks that the required details are present before saving
savestock = True
Else
savestock = False
MsgBox ("Please Input Part Type.")
Exit Sub
End If

If stockunits_com.text <> "Please Select..." Then 'Checks that the required details are present before saving
savestock = True
Else
savestock = False
MsgBox ("Please Input Part Units.")
Exit Sub
End If

If manufacturer_txt.text <> "" Then 'Checks that the required details are present before saving
savestock = True
Else
savestock = False
MsgBox ("Please Input Manufacturer.")
Exit Sub
End If

If Val(partcost_txt.text) > 0 Then 'Checks that the required details are present before saving
savestock = True
Else
savestock = False
MsgBox ("Please Input Valid Cost. [Must be Greater than 0.00]")
Exit Sub
End If

If Val(reorder_txt.text) > 0 Then 'Checks that the required details are present before saving
savestock = True
Else
savestock = False
MsgBox ("Please Input Valid Re-order Value. [Must be Greater than 0]")
Exit Sub
End If

If Val(stocklevel_txt.text) > 0 Then 'Checks that the required details are present before saving
savestock = True
Else
savestock = False
MsgBox ("Please Input Valid stock level. [Must be Greater than 0]")
Exit Sub
End If
If savestock = True Then 'if all the checks have been passed then continue to save the record into the file

71
stockfilechannel = FreeFile 'Sets the file number to an available one
Open stockfilepath For Random As stockfilechannel Len = stockfilelength 'Opens the stock file for random actions (read/write)
stockfilenextrecord = (FileLen(stockfilepath) / stockfilelength) + 1
nextstockid = stockfilenextrecord + 1000
newstock.partid = nextstockid
newstock.partname = partname_txt.text 'sets the fields data to the entered data
newstock.partcolour = partcolour_com.text 'sets the fields data to the entered data
newstock.parttype = parttype_com.text 'sets the fields data to the entered data
newstock.stockunits = stockunits_com.text 'sets the fields data to the entered data
newstock.partmanufacturer = manufacturer_txt.text 'sets the fields data to the entered data
newstock.partprice = Val(partcost_txt.text) 'sets the fields data to the entered data
newstock.reorderlevel = Val(reorder_txt.text) 'sets the fields data to the entered data
newstock.stocklevel = Val(stocklevel_txt.text) 'sets the fields data to the entered data
newstock.partdescription = additionalinfo_txt.text 'sets the fields data to the entered data
newstock.discontinued = False 'sets the fields data to the entered data
Put stockfilechannel, stockfilenextrecord, newstock 'inserts the record into the file in the next available position
Close stockfilechannel 'closes the file after the action is complete
Unload Me 'closes the form
Call mainmenu_frm.LoadAllStockTable 'updates the main menu table
End If
End Sub

Private Sub cancel_btn_Click() 'used to close the form is a new stock item is not needed to be added
Unload Me
End Sub

Private Sub stockunits_com_LostFocus() 'updates the stock units labels anytime the units are changed in the combobox
units1_lb.Caption = stockunits_com.text
units2_lb.Caption = stockunits_com.text
End Sub

72
Procedure/Subroutine Details

Procedure/Function/Form Purpose Links to Other


Procedures
addpart_btn_Click used to save the new stock details into a new record in the stock entity
cancel_btn_Click used to close the form is a new stock item is not needed to be added
stockunits_com_LostFocus updates the stock units labels anytime the units are changed in the
combobox

List of Variables

Variable Name Type Usage Procedure


newstock stock a record in ram to store the new details before passing to the file addpart_btn_Click

stockfilechannel Integer used for file communication addpart_btn_Click

nextstockid Integer the next available id number for the stock addpart_btn_Click

savestock Boolean flagged when any checks have failed to prevent saving invalid data addpart_btn_Click

73
CAD Door Tool Form

Option Explicit
Dim vsections As Integer 'used to store the number of vertial sections (and styles)
Dim position As Integer 'stores the position off the handle

Private Sub cancel_btn_Click() 'closes the form


createorder_frm.Show
Unload Me
End Sub

Private Sub Form_Activate() 'initialises the form, making the controls reflect values passed into the form
If windowhside = 2 Then
right_opt.Value = True
left_opt.Value = False
Else
right_opt.Value = False
left_opt.Value = True
End If
Call redraw
End Sub

74
Private Sub Form_Load() 'sets the tool to door mode
If caddooredit = True Then
Me.Width = 14625
windowwidth = 1
windowheight = 2
position = 1
Else
Me.Width = 11640
style_com.text = windowvopeners
position = windowoposition
End If
End Sub

Private Sub height_txt_lostfocus() 'updates the height and calls a redraw


If Val(height_txt.text) < 1.6 Then
MsgBox ("Door must be at least 1.6m in height")
height_txt.text = 1.6
End If
windowheight = Val(height_txt.text)
Call redraw
End Sub

Private Sub left_opt_Click() 'calls redraw due to change in value


Call redraw
End Sub

Private Sub openerposition_ud_Change() 'calls redraw due to change in opener position


position = openerposition_ud.Value
Call redraw
End Sub

Private Sub right_opt_Click() 'calls redraw due to change in handle orientation


Call redraw
End Sub

Private Sub save_btn_Click() 'closes the form and tells the create order form to grab the details of the window, and to use it respectively
createorder_frm.Show
Call createorder_frm.additemtolistwindow
Unload Me
End Sub

Private Sub style_com_Click() 'calls redraw due to change in style


Call redraw
End Sub

Private Sub vbars_txt_Change() 'calls redraw due to change of panels (only applies to french and folding doors)
If Val(vbars_txt.text) < 1 Then
vbars_txt.text = 1
End If
If Val(vbars_txt.text) > 6 Then
vbars_txt.text = 6
End If
windowvbars = Val(vbars_txt.text - 1)
If windowvopeners > windowvbars + 1 Then
windowvopeners = windowvbars + 1
End If

Call redraw
End Sub

75
Private Sub vopeners_txt_Change() 'calls redraw due to change of styles (doesnt apply to french and folding doors)
windowvopeners = Val(vopeners_txt.text)
windowvbars = Val(vbars_txt.text)
openerposition_ud.Max = Val(vbars_txt.text) + 2 - (Val(vopeners_txt.text))
If windowvopeners > windowvbars Then
windowvopeners = windowvbars + 1
vopeners_txt.text = windowvopeners
End If
Call redraw

End Sub

Private Sub width_txt_lostfocus() 'calls redraw due to change of door width


If Val(width_txt.text) < 0.6 Then
MsgBox ("Door must be at least 0.6m in width")
width_txt.text = 0.6
End If
windowwidth = Val(width_txt.text)
Call redraw
End Sub

Private Sub redraw() 'carried out so the canvas reflects the design changes made by the user controls
Dim scaleval As Double 'the scale to use when drawing the shapes to the canvas
If windowwidth > windowheight Then 'sets the scale value depending on the largest dimension
scaleval = windowwidth + (windowwidth * 0.1) + 0.01
cadwindow_picbox.ScaleWidth = scaleval
cadwindow_picbox.ScaleHeight = scaleval
Else
scaleval = windowheight + (windowheight * 0.1) + 0.01
cadwindow_picbox.ScaleWidth = scaleval
cadwindow_picbox.ScaleHeight = scaleval
End If

windowframe_shp.Width = windowwidth 'sets the size and position of thee canvas shapes
windowframe_shp.Height = windowheight
windowframe_shp.Left = scaleval / 2 - (windowwidth / 2)
windowframe_shp.Top = scaleval / 2 - (windowheight / 2)

insideglass_shp.Width = windowwidth - 0.05 'sets the size and position of thee canvas shapes
insideglass_shp.Height = windowheight - 0.05
insideglass_shp.Left = scaleval / 2 - (windowwidth / 2) + (0.05 / 2)
insideglass_shp.Top = scaleval / 2 - (windowheight / 2) + (0.05 / 2)

Dim vbarcount As Integer 'the number of additional vertical bars that need to be drawn

For vbarcount = 1 To 5
verticalbar(vbarcount).Visible = False
Next vbarcount

vbarcount = 1
For vbarcount = 1 To windowvbars
verticalbar(vbarcount).Visible = True
verticalbar(vbarcount).Width = (0.05 / 2)
verticalbar(vbarcount).Height = insideglass_shp.Height
verticalbar(vbarcount).Top = scaleval / 2 - (windowheight / 2) + (0.05 / 2)
verticalbar(vbarcount).Left = ((scaleval / 2) - ((windowwidth - 0.05) / 2)) + vbarcount * (((windowwidth - 0.05) - ((windowvbars) * (0.05 / 2))) /
(windowvbars + 1)) + (0.025 * vbarcount) - (0.05 / 2)
verticalbar(vbarcount).BackColor = vbWhite

76
verticalbar(vbarcount).BackStyle = 1
verticalbar(vbarcount).FillColor = &HE0E0E0
verticalbar(vbarcount).FillStyle = 0
Next vbarcount

Dim vopenercount As Integer 'the number of v openers that need to be drawn


Dim styleno As Integer 'the style of the decorative glass insert on the door panel

styleno = Val(Mid(style_com.text, 1, 1))


If styleno = 1 Then 'sets the appropriate position depending on the style and loads the respective design into view
style_img.Visible = False
letterbox_shp.Visible = False
windowvopeners = 1
ElseIf styleno = 2 Then
style_img.Visible = True
letterbox_shp.Visible = True
style_img.Picture = LoadPicture(App.Path & "/img/door1.gif")
windowvopeners = 2
ElseIf styleno = 3 Then
style_img.Visible = True
letterbox_shp.Visible = True
style_img.Picture = LoadPicture(App.Path & "/img/door2.gif")
windowvopeners = 3
ElseIf styleno = 4 Then
style_img.Visible = True
letterbox_shp.Visible = True
style_img.Picture = LoadPicture(App.Path & "/img/door3.gif")
windowvopeners = 4
ElseIf styleno = 5 Then
style_img.Visible = True
letterbox_shp.Visible = True
style_img.Picture = LoadPicture(App.Path & "/img/door4.gif")
windowvopeners = 5
ElseIf styleno = 6 Then
style_img.Visible = True
letterbox_shp.Visible = True
style_img.Picture = LoadPicture(App.Path & "/img/door5.gif")
windowvopeners = 6
End If

If windowvbars = 0 Then 'sets the drawing limits to prevent erroneous drawings


If windowwidth < 2 Then
style_img.Height = 0.7 * windowwidth
style_img.Width = (style_img.Height / 1.6)
Else
style_img.Height = 1.6
style_img.Width = (style_img.Height / 1.6)
End If
style_img.Left = (scaleval / 2) - (style_img.Width / 2)
style_img.Top = scaleval / 2 - (windowheight / 2) + (windowheight * 0.075)
letterbox_shp.Width = 0.25
letterbox_shp.Height = 0.06
letterbox_shp.Left = (scaleval / 2) - (letterbox_shp.Width / 2)
letterbox_shp.Top = scaleval / 2 + (windowheight / 2) - 0.3
Else
style_img.Visible = False
letterbox_shp.Visible = False
End If

If right_opt.Value = True Then

77
windowhside = 2
doorhandle_img.Height = 0.18
doorhandle_img.Width = 0.11
doorhandle_img.Picture = LoadPicture(App.Path & "/img/doorhandleright.gif")
doorhandle_img.Left = ((scaleval / 2) - (windowwidth / 2) + windowwidth - 0.17)
doorhandle_img.Top = scaleval / 2 - (windowheight / 2) + (windowheight * 0.5)
Else
windowhside = 1
doorhandle_img.Height = 0.18
doorhandle_img.Width = 0.11
doorhandle_img.Picture = LoadPicture(App.Path & "/img/doorhandleleft.gif")
doorhandle_img.Left = ((scaleval / 2) - (windowwidth / 2) + 0.06)
doorhandle_img.Top = scaleval / 2 - (windowheight / 2) + (windowheight * 0.5)
End If

pvcmetres_lb.Caption = (windowwidth * 2) + (2 * windowheight) + (windowvbars * windowheight) 'calculates the number of each required part type
sqrmetresfacia_lb.Caption = (windowwidth * windowheight) 'calculates the number of each required part type
handles_lb.Caption = 2 'calculates the number of each required part type
hinges_lb.Caption = (windowvbars + 1) * 5 'calculates the number of each required part type

metresofpvc = (windowwidth * 2) + (2 * windowheight) + (windowvbars * windowheight) 'calculates the number of each required part type
areaoffacia = (windowwidth * windowheight) 'calculates the number of each required part type
handlesnumber = 2 'calculates the number of each required part type
hinges = (windowvbars + 1) * 5 'calculates the number of each required part type

End Sub

78
Procedure/Subroutine Details

Procedure/Function/Form Purpose Links to Other


Procedures
cancel_btn_Click closes the form
Form_Activate initialises the form, making the controls reflect values passed into the form
Form_Load sets the tool to door mode
height_txt_lostfocus updates the height and calls a redraw
left_opt_Click calls redraw due to change in value
openerposition_ud_Change calls redraw due to change in opener position
right_opt_Click calls redraw due to change in handle orientation
save_btn_Click closes the form and tells the create order form to grab the details of the window,
and to use it respectively
style_com_Click calls redraw due to change in style
vbars_txt_Change calls redraw due to change of panels (only applies to french and folding doors)
vopeners_txt_Change calls redraw due to change of styles (doesnt apply to french and folding doors)
width_txt_lostfocus calls redraw due to change of door width
redraw carried out so the canvas reflects the design changes made by the user controls

List of Variables

Variable Name Type Usage Procedure


vsections Integer used to store the number of vertial sections (and styles)

position Integer stores the position off the handle

scaleval Double the scale to use when drawing the shapes to the canvas redraw

vbarcount Integer the number of additional vertical bars that need to be drawn redraw

vopenercount Integer the number of v openers that need to be drawn redraw

styleno Integer the style of the decorative glass insert on the door panel redraw

79
CAD Tool Window

Option Explicit
Dim vsections As Integer 'used to store the number of vertial sections (and styles)
Dim position As Integer 'stores the position off the handle

Private Sub cancel_btn_Click() 'closes the form


createorder_frm.Show
Unload Me
End Sub

Private Sub Form_Activate() 'initialises the form, making the controls reflect values passed into the form
If windowhside = 2 Then
right_opt.Value = True
left_opt.Value = False
Else

80
right_opt.Value = False
left_opt.Value = True
End If
Call redraw
End Sub

Private Sub Form_Load() 'sets the tool to window mode (uses recycled code from door cad tool)
If cadwindowedit = True Then
Me.Width = 14625
windowwidth = 1
windowheight = 1
position = 1
Else
Me.Width = 11640
position = windowoposition
vsections = windowvopeners

End If
End Sub

Private Sub height_txt_Change() 'updates the height and calls a redraw


If Val(height_txt.text) < 0.1 Then
MsgBox ("Window must be at least 20cm in height")
height_txt.text = 0.2
End If
windowheight = Val(height_txt.text)
Call redraw
End Sub

Private Sub left_opt_Click() 'calls redraw due to change in value


Call redraw
End Sub

Private Sub openerposition_ud_Change() 'calls redraw due to change in opener position


position = openerposition_ud.Value
Call redraw
End Sub

Private Sub right_opt_Click() 'calls redraw due to change in handle orientation


Call redraw
End Sub

Private Sub save_btn_Click() 'closes the form and tells the create order form to grab the details of the window, and to use it respectively
windowoposition = position
createorder_frm.Show
Call createorder_frm.additemtolistwindow
Unload Me
End Sub

Private Sub vbars_txt_Change() 'sets variables and calls a redraw with more/less vertical bars
windowvbars = Val(vbars_txt.text)
openerposition_ud.Max = Val(vbars_txt.text) + 2 - (Val(vopeners_txt.text))
If windowvopeners > windowvbars + 1 Then
windowvopeners = windowvbars + 1
End If

Call redraw
End Sub

Private Sub vopeners_txt_Change() 'sets variables and calls a redraw with more/less vertical openers

81
windowvopeners = Val(vopeners_txt.text)
windowvbars = Val(vbars_txt.text)
openerposition_ud.Max = Val(vbars_txt.text) + 2 - (Val(vopeners_txt.text))
If windowvopeners > windowvbars Then
windowvopeners = windowvbars + 1
vopeners_txt.text = windowvopeners
End If
Call redraw

End Sub

Private Sub width_txt_Change() 'calls redraw due to change of window width


If Val(width_txt.text) < 0.1 Then
MsgBox ("Window must be at least 20cm in width")
width_txt.text = 0.2
End If
windowwidth = Val(width_txt.text)
Call redraw
End Sub

Private Sub redraw() 'carried out so the canvas reflects the design changes made by the user controls
Dim scaleval As Double 'the scale to use when drawing the shapes to the canvas
If windowwidth > windowheight Then 'sets the scale value depending on the largest dimension
scaleval = windowwidth + (windowwidth * 0.1) + 0.01
cadwindow_picbox.ScaleWidth = scaleval
cadwindow_picbox.ScaleHeight = scaleval
Else
scaleval = windowheight + (windowheight * 0.1) + 0.01
cadwindow_picbox.ScaleWidth = scaleval
cadwindow_picbox.ScaleHeight = scaleval
End If

windowframe_shp.Width = windowwidth 'sets the size and position of thee canvas shapes
windowframe_shp.Height = windowheight
windowframe_shp.Left = scaleval / 2 - (windowwidth / 2)
windowframe_shp.Top = scaleval / 2 - (windowheight / 2)

insideglass_shp.Width = windowwidth - 0.05 'sets the size and position of thee canvas shapes
insideglass_shp.Height = windowheight - 0.05
insideglass_shp.Left = scaleval / 2 - (windowwidth / 2) + (0.05 / 2)
insideglass_shp.Top = scaleval / 2 - (windowheight / 2) + (0.05 / 2)

Dim vbarcount As Integer

For vbarcount = 1 To 5
verticalbar(vbarcount).Visible = False
Next vbarcount

vbarcount = 1
For vbarcount = 1 To windowvbars 'the number of additional vertical bars that need to be drawn
verticalbar(vbarcount).Visible = True
verticalbar(vbarcount).Width = (0.05 / 2)
verticalbar(vbarcount).Height = insideglass_shp.Height
verticalbar(vbarcount).Top = scaleval / 2 - (windowheight / 2) + (0.05 / 2)
verticalbar(vbarcount).Left = ((scaleval / 2) - ((windowwidth - 0.05) / 2)) + vbarcount * (((windowwidth - 0.05) - ((windowvbars) * (0.05 / 2))) /
(windowvbars + 1)) + (0.025 * vbarcount) - (0.05 / 2)
verticalbar(vbarcount).BackColor = vbWhite
verticalbar(vbarcount).BackStyle = 1
verticalbar(vbarcount).FillColor = &HE0E0E0

82
verticalbar(vbarcount).FillStyle = 0
Next vbarcount

Dim vopenercount As Integer 'the number of v openers that need to be drawn

For vopenercount = 1 To 6
vopener(vopenercount).Visible = False
handle_img(vopenercount).Visible = False
Next vopenercount

Dim opener_wdth As Double 'the width of the identical window panes that need to be drawn
If right_opt.Value = True Then
vopenercount = 1
For vopenercount = position To (windowvopeners + (position - 1))
windowhside = 2
vopener(vopenercount).Visible = True
handle_img(vopenercount).Visible = True
opener_wdth = ((((windowwidth - 0.05) - ((windowvbars) * (0.05 / 2))) / (windowvbars + 1)))
vopener(vopenercount).Width = opener_wdth - (0.05 / 2) - (0.05 / 4)
vopener(vopenercount).Left = (((scaleval / 2 - (windowwidth / 2)) + opener_wdth * (vopenercount - 1)) + (0.025 * vopenercount)) + (0.05 / 4)
vopener(vopenercount).Top = scaleval / 2 - (windowheight / 2) + (0.05 / 2) + (0.05 / 4)
vopener(vopenercount).Height = insideglass_shp.Height - (0.05 / 2)
vopener(vopenercount).BackStyle = 1
vopener(vopenercount).BackColor = vbWhite
vopener(vopenercount).BorderWidth = 2
handle_img(vopenercount).Width = 0.03
handle_img(vopenercount).Height = 0.13
handle_img(vopenercount).Top = scaleval / 2 - 0.05
handle_img(vopenercount).Left = (((scaleval / 2 - (windowwidth / 2)) + opener_wdth * (vopenercount - 1)) + (0.025 * vopenercount)) - 0.028 +
opener_wdth
Next vopenercount
Else
vopenercount = 1
For vopenercount = position To (windowvopeners + (position - 1))
windowhside = 1
vopener(vopenercount).Visible = True
handle_img(vopenercount).Visible = True
opener_wdth = ((((windowwidth - 0.05) - ((windowvbars) * (0.05 / 2))) / (windowvbars + 1)))
vopener(vopenercount).Width = opener_wdth - (0.05 / 2) - (0.05 / 4)
vopener(vopenercount).Left = (((scaleval / 2 - (windowwidth / 2)) + opener_wdth * (vopenercount - 1)) + (0.025 * vopenercount)) + (0.05 / 2)
vopener(vopenercount).Top = scaleval / 2 - (windowheight / 2) + (0.05 / 2) + (0.05 / 4)
vopener(vopenercount).Height = insideglass_shp.Height - (0.05 / 2)
vopener(vopenercount).BackStyle = 1
vopener(vopenercount).BackColor = vbWhite
vopener(vopenercount).BorderWidth = 2
handle_img(vopenercount).Width = 0.03
handle_img(vopenercount).Height = 0.13
handle_img(vopenercount).Top = scaleval / 2 - 0.05
handle_img(vopenercount).Left = (((scaleval / 2 - (windowwidth / 2)) + opener_wdth * (vopenercount - 1)) + (0.025 * vopenercount)) - 0.001
Next vopenercount
End If

pvcmetres_lb.Caption = (windowwidth * 2) + (2 * windowheight) + (windowvbars * windowheight) 'calculates the number of each required part type
sqrmetresglass_lb.Caption = (windowwidth * windowheight)
handles_lb.Caption = windowvopeners
hinges_lb.Caption = windowvopeners * 3

metresofpvc = (windowwidth * 2) + (2 * windowheight) + (windowvbars * windowheight) 'calculates the number of each required part type
areaofglass = (windowwidth * windowheight)

83
handlesnumber = windowvopeners
hinges = windowvopeners * 3

End Sub

84
Procedure/Subroutine Details

Procedure/Function/Form Purpose Links to Other


Procedures
cancel_btn_Click closes the form
Form_Activate initialises the form, making the controls reflect values passed into the form
Form_Load sets the tool to window mode (uses recycled code from door cad tool)
height_txt_Change updates the height and calls a redraw
left_opt_Click calls redraw due to change in value
openerposition_ud_Change calls redraw due to change in opener position
right_opt_Click calls redraw due to change in handle orientation
save_btn_Click closes the form and tells the create order form to grab the details of the window,
and to use it respectively
vbars_txt_Change sets variables and calls a redraw with more/less vertical bars
vopeners_txt_Change sets variables and calls a redraw with more/less vertical openers
width_txt_Change calls redraw due to change of window width
redraw carried out so the canvas reflects the design changes made by the user controls

List of Variables

Variable Name Type Usage Procedure


vsections Integer used to store the number of vertial sections (and styles)

position Integer stores the position off the handle

scaleval Double the scale to use when drawing the shapes to the canvas redraw

vbarcount Integer redraw


vopenercount Integer the number of v openers that need to be drawn redraw

opener_wdth Double the width of the identical window panes that need to be drawn redraw

85
Create Order Form

Option Explicit
Dim additemsenabled As Boolean 'whether the add item controls should be enabled or disabled
Dim customerid As Integer 'the id of the customer that the order is for
Dim jobcount As Integer 'the number jobs currently in the job file
Dim itemidindex As Integer 'the highest value for item pin number in the job file
Dim dateselected As Boolean 'to check the date for order has been selected

Private Sub CustomerSelection(id As Integer) 'loads the customer data from the file when customer id is selected
customer_lst.Clear 'Clears the listbox, ready for new data
Dim recordcount As Integer 'the currently open record number in the file
Dim loadcustomer As customer 'temp record in ram to hold open records
Dim customerfilechannel As Integer 'the os file communication channel
customerfilechannel = FreeFile 'Sets the file number to an available one
recordcount = 1
Open customerfilepath For Random As customerfilechannel Len = customerfilelength 'Opens the customer file for random actions (read/write)
Do While Not EOF(customerfilechannel) 'carry out until the end of the file
Get customerfilechannel, recordcount, loadcustomer 'load the record from the file
If id <> 0 Then 'if the record has a valid id
Dim contains As Integer 'used to retun the within string function result
contains = InStr(loadcustomer.customerid, id)
If loadcustomer.customerid <> 0 And contains > 0 Then
customer_lst.AddItem (Trim(loadcustomer.customerid) & ", " & Trim(loadcustomer.forename) & " " & Trim(loadcustomer.surname))
End If

86
Else
If loadcustomer.customerid <> 0 Then
customer_lst.AddItem (Trim(loadcustomer.customerid) & ", " & Trim(loadcustomer.forename) & " " & Trim(loadcustomer.surname))
End If
End If
recordcount = recordcount + 1
Loop
Close customerfilechannel
End Sub

Private Sub totalupprices() 'adds up the costs of the item and updates the controls to reflec the changes
Dim partcount As Integer 'the currently selected part number in the order
Dim totalparts As Integer 'the number of parts in the order
Dim totalcost As Currency 'the total cost of the parts within the order
Dim labourcost As Currency 'the labour cost (entered by the user)
Dim grandtotal As Currency 'the grand total cost (tax + labour + parts +add costs)
Dim additionalcharges As Currency 'any additional charges the customer will have to pay (entered by the user)
Dim vat As Currency 'the total VAT cost
additionalcharges = Val(additionalcharges_txt.text) 'set the values that are inputted
labourcost = Val(labourcost_txt.text)
totalcost = 0
totalparts = cost2_lst.listcount
For partcount = 1 To totalparts 'total up the parts costs
totalcost = totalcost + cost2_lst.List(partcount - 1)
Next partcount
totalcost_lb.Caption = totalcost 'update the captions
vat = (totalcost + labourcost) * 0.2
grandtotal = vat + totalcost + labourcost + additionalcharges
vat_lb.Caption = vat
grandtotal_lb.Caption = grandtotal

End Sub

Private Sub add_btn_Click() 'adds the selected part to the selected itemon the order, usignt the suggested order quntity where appropriate
Dim data As String 'the list box entry to transfer into the parts listbox
Dim cost As Currency 'the cost of the part
Dim counter As Integer 'counts to the position of item in the listbox to transfer
Dim partpos As Integer 'stores the position of item in the listbox to transfer
Dim selectedid As Integer 'the id of the selected item the part is for
Dim quantity As Integer 'the number of the items required to add the part for
Dim itemquantity As Integer 'the quantity of the parts required for each item
Dim tquantity As Integer 'the total quantity required (items * needed for each item)
For counter = 0 To part_lst.listcount - 1 'counts to find the selected part id
If part_lst.Selected(counter) = True Then
partpos = counter
Exit For
End If
Next counter
For counter = 0 To itemid_lst.listcount - 1 'counts to find the selected order id
If itemid_lst.Selected(counter) = True Then
selectedid = itemid_lst.List(counter)
itemquantity = Val(itemquantity_lst.List(counter))
Exit For
End If
Next counter
cost = cost1_lst.List(partpos) 'transfers the information into the order list
data = part_lst.List(partpos)
quantity = Val(partquantity_txt.text)
tquantity = quantity * itemquantity
itemparts_lst.AddItem (Trim(data))

87
cost2_lst.AddItem Val(cost * tquantity)
tquant_lst.AddItem (tquantity)
itempartsquantity_lst.AddItem (quantity)
itemid2_lst.AddItem (selectedid)
partquantity_txt.text = ""
add_btn.Enabled = False
Call totalupprices
End Sub

Private Sub additionalcharges_txt_Change() 'calls an update when the inputs are changed
Call totalupprices
End Sub

Private Sub colour_com_Click() 'calls an search when the input is changed


Call SearchParts(Trim(search_txt.text), Trim(colour_com.text), Trim(type_com.text))
End Sub

Private Sub customer_lst_Click() 'loads the customer details from the file and displays them for confirmation when a customer is selected
Dim indexval As Integer 'the position in the list
Dim counter As Integer 'counts to the position of the item in the list
Dim loadcustomer As customer 'stores the record in ram
Dim customerfilechannel As Integer 'the os file communication channel
Dim recordcount As Integer 'count the position of the open record

For counter = 0 To customer_lst.listcount - 1 'counts to the item position


If customer_lst.Selected(counter) = True Then
indexval = counter
Exit For
End If
Next counter
customerid = Val(Mid(customer_lst.List(indexval), 1, 4))

recordcount = 1
customerfilechannel = FreeFile 'Sets the file number to an available one
Open customerfilepath For Random As customerfilechannel Len = customerfilelength 'Opens the customer file for random actions (read/write)
Do While Not EOF(customerfilechannel)
Get customerfilechannel, recordcount, loadcustomer 'opens the record
If loadcustomer.customerid = customerid Then 'stops the loop when the record is found
Exit Do
End If
recordcount = recordcount + 1
Loop
Close customerfilechannel

name_lb.Caption = loadcustomer.forename 'updates the display controls


surname_lb.Caption = loadcustomer.surname
addr1_lb.Caption = loadcustomer.addressline1
addr2_lb.Caption = loadcustomer.addressline2
addr3_lb.Caption = loadcustomer.addressline3
postcode_lb.Caption = loadcustomer.postcode
email_lb.Caption = loadcustomer.email
phone_lb.Caption = loadcustomer.phonenumber
header_shp(5).BackColor = mygreen
End Sub

Private Sub datepicker_DateClick(ByVal DateClicked As Date) 'handles events that involve user interation with the calendar
If datepicker.Value < DateValue(Now) Then
dateorderdue_lb.ForeColor = vbRed
dateorderdue_lb.Caption = "Date has passed, please choose another"
Else

88
dateorderdue_lb.ForeColor = vbBlack
dateorderdue_lb.Caption = datepicker.Value
dateselected = True
End If
End Sub

Private Sub Form_Load() 'sets up the form for inputs and ensures the controls display data where required
Dim temporder As order 'used to load order records while the next pin is determined
Dim orderfilechannel As Integer 'the channel the os will use to communicate with the order file
jobcount = 1
Call CustomerSelection("0")
Call SearchParts(Trim(search_txt.text), Trim(colour_com.text), Trim(type_com.text))
items_lst.AddItem "Click To Add Item"
additemsenabled = True
datepicker.MinDate = DateValue(Now)
orderfilechannel = FreeFile 'Sets the file number to an available one
Open orderfilepath For Random As orderfilechannel Len = orderfilelength 'Opens the order file for random actions (read/write)
orderfilenextrecord = (FileLen(orderfilepath) / orderfilelength) + 1
Close orderfilechannel
orderid_lb.Caption = orderfilenextrecord + 1000
End Sub

Private Sub Form_Unload(Cancel As Integer) 'opend the main menu when the form is closed
mainmenu_frm.Show

End Sub

Private Sub itemid_lst_Click() 'sets the currently selected order id in ram


Dim hasselected As Boolean 'returns whether the item in listbox is selected
Dim counter As Integer 'counts the position of the selected id
For counter = 1 To itemid_lst.listcount
If itemid_lst.Selected(counter - 1) = True Then
hasselected = True
itemidindex = counter
Exit For
End If
Next counter
If hasselected = True Then: itemparts_frame.Enabled = True
For counter = 0 To 4
header_shp(counter).FillColor = mygreen
Next counter
End Sub

Private Sub itemparts_lst_Click() 'enables the removal of a selected part id


remove_btn.Enabled = True
End Sub

Private Sub items_lst_Click() 'enables the new item controls when new item desired
Dim listcount As Integer 'used to store the position of the instruction list box entry
listcount = items_lst.listcount
If items_lst.Selected(listcount - 1) = True And additemsenabled = True Then
items_lst.RemoveItem (listcount - 1)
items_lst.AddItem "Enter details then click save ->>"
items_lst.Enabled = False
itemquantity_lst.Enabled = False
additemsenabled = False
height_lst.Enabled = False
width_lst.Enabled = False
itemid_lst.Enabled = False
itemtype_com.Enabled = True

89
quantity_txt.Enabled = True
save_btn.Enabled = True
itemdetails_shp.FillColor = &HE0E0E0
itemdetailshead_shp.FillColor = mygreen
End If
End Sub

Private Sub labourcost_txt_Change() 'calls the update costs procedure


Call totalupprices
End Sub

Private Sub part_lst_click() 'deals with the hidden listboxes when a list item is selected in the parts list
Dim indexval As Integer 'the common index value of the item
Dim counter As Integer 'counts to discover the index value
For counter = 1 To part_lst.listcount 'determines the index value
If part_lst.Selected(counter - 1) = True Then
indexval = (counter - 1)
Exit For
End If
Next counter
If Val(type_lst.List(indexval)) = 1 Then
partquantity_txt.text = Val(pvc_lst.List(itemidindex - 1))
ElseIf Val(type_lst.List(indexval)) = 2 Then
partquantity_txt.text = Val(facia_lst.List(itemidindex - 1))
ElseIf Val(type_lst.List(indexval)) = 3 Then
partquantity_txt.text = Val(handles_lst.List(itemidindex - 1))
ElseIf Val(type_lst.List(indexval)) = 4 Then
partquantity_txt.text = Val(hinges_lst.List(itemidindex - 1))
Else
partquantity_txt.text = 1
End If
add_btn.Enabled = True
End Sub

Private Sub processorder_btn_Click() 'saves the order to the files


Dim tempjob As job 'stores each job in a record so it can be passed to the file
Dim jobfilechannel As Integer 'the channel the os uses to communicate with the job file
Dim numberofitems As Integer 'counts the number of items needed for the order
Dim itemcount As Integer 'counts the position of the current item
Dim numberofparts As Integer 'the number of parts needed for the order
Dim partcount As Integer 'counts the position of the current part
Dim tempitemsorder As jobpartlink 'stores each job link in a record so it can be passed to the file
Dim jobpartlinkfilechannel As Integer 'the channel the os uses to communicate with the job link file
Dim neworder As order 'stores each order in a record so it can be passed to the file
Dim orderfilechannel As Integer 'the channel the os uses to communicate with the order file
Dim saveorder As Boolean 'whether the order should be save post validdation checks

If customerdetails_chk.Value = 1 Then 'carry out validation checks and verification checks to ensure the order is valid
saveorder = True
Else
saveorder = False
MsgBox ("Please Confirm Customer Details.")
Exit Sub
End If

If dateselected = True Then


saveorder = True
Else
saveorder = False
MsgBox ("Please Select a date in the future.")

90
Exit Sub
End If

If itemid_lst.listcount > 0 Then


saveorder = True
Else
saveorder = False
MsgBox ("Please add at least one item to make an order.")
Exit Sub
End If

If itemparts_lst.listcount > 0 Then


saveorder = True
Else
saveorder = False
MsgBox ("Please add at least one stock part to make an order.")
Exit Sub
End If

If Val(labourcost_txt.text) > 0 Then


saveorder = True
Else
saveorder = False
MsgBox ("Please input a labour cost.")
Exit Sub
End If

If saveorder = True Then


orderfilechannel = FreeFile 'Sets the file number to an available one
Open orderfilepath For Random As orderfilechannel Len = orderfilelength 'Opens the order file for random actions (read/write)
neworder.orderid = orderfilenextrecord + 1000
neworder.orderdate = DateValue(Now)
neworder.additionalcharges = Val(additionalcharges_txt.text)
neworder.additionalchargesdescription = addchargedetails_txt.text
neworder.labourcost = Val(labourcost_txt.text)
neworder.partscost = totalcost_lb.Caption
neworder.customerid = customerid
neworder.grandtotal = grandtotal_lb.Caption
neworder.duedate = DateValue(dateorderdue_lb.Caption)
neworder.tax = vat_lb.Caption
neworder.orderstatus = "Pending"

If delivery_opt.Value = True Then


neworder.requiresdelivery = True
Else
neworder.requiresdelivery = False
End If
If orderpaid_chk.Value = 1 Then
neworder.orderpaid = True
Else
neworder.orderpaid = False
End If
Put orderfilechannel, orderfilenextrecord, neworder
orderfilenextrecord = orderfilenextrecord + 1
Close orderfilechannel

numberofitems = itemid_lst.listcount
jobfilechannel = FreeFile 'Sets the file number to an available one
Open jobfilepath For Random As jobfilechannel Len = jobfilelength 'Opens the order file for random actions (read/write)
For itemcount = 1 To numberofitems

91
tempjob.jobid = Val(itemid_lst.List(itemcount - 1))
tempjob.jobdescription = items_lst.List(itemcount - 1)
tempjob.itemheight = Val(height_lst.List(itemcount - 1))
tempjob.itemwidth = Val(width_lst.List(itemcount - 1))
tempjob.quantity = Val(itemquantity_lst.List(itemcount - 1))
tempjob.orderid = neworder.orderid
tempjob.jobstatus = "Pending"
tempjob.ostyle = Val(vopeners_lst.List(itemcount - 1))
tempjob.panels = Val(vbars_lst.List(itemcount - 1))
tempjob.oposition = Val(oposition_lst.List(itemcount - 1))
tempjob.hside = Val(oside_lst.List(itemcount - 1))
Put jobfilechannel, jobfilenextrecord, tempjob
jobfilenextrecord = jobfilenextrecord + 1
Next itemcount
Close jobfilechannel

numberofparts = itemparts_lst.listcount
jobpartlinkfilechannel = FreeFile 'Sets the file number to an available one
Open jobpartlinkfilepath For Random As jobpartlinkfilechannel Len = jobpartlinkfilelength 'Opens the order file for random actions
(read/write)
For partcount = 1 To numberofparts
tempitemsorder.jobid = Val(itemid2_lst.List(partcount - 1))
tempitemsorder.partid = Val(Mid(itemparts_lst.List(partcount - 1), 1, 4))
tempitemsorder.quantity = Val(itempartsquantity_lst.List(partcount - 1))
Put jobpartlinkfilechannel, jobpartlinkfilenextrecord, tempitemsorder
jobpartlinkfilenextrecord = jobpartlinkfilenextrecord + 1
Next partcount
Close jobpartlinkfilechannel

MsgBox ("Order Created")


mainmenu_frm.Show
Unload Me
End If
End Sub

Private Sub quantity_txt_Change() 'deals with any change to the quantity text box
If Val(quantity_txt.text) < 1 Then
quantity_txt.text = 1
End If
End Sub

Private Sub remove_btn_Click() 'used when the items are needed to be removed
Dim counter As Integer 'counts to the position of the item in teh listbox
Dim remove As Boolean 'whether the item currently handled should be removed
For counter = 0 To itemparts_lst.listcount
If itemparts_lst.Selected(counter) = True Then
remove = True
Exit For
End If
Next counter
If remove = True Then
itemparts_lst.RemoveItem (counter)
itempartsquantity_lst.RemoveItem (counter)
itemid2_lst.RemoveItem (counter)
cost2_lst.RemoveItem (counter)
tquant_lst.RemoveItem (counter)
End If
remove_btn.Enabled = False
Call totalupprices
End Sub

92
Private Sub save_btn_Click() 'adds the new item to the lists and opens the cad tool if necessary
windowwidth = 1
windowheight = 1
windowvbars = 0
windowvopeners = 0
windowoposition = 0
windowhside = 1
If itemtype_com.text = "Window" Then
Me.Hide
cadwindowedit = True
cadtoolwindow_frm.Show
ElseIf itemtype_com.text = "Door" Then
Me.Hide
caddooredit = True
cadtooldoor_frm.Show
Else
Call additemtolistwindow
End If
End Sub

Private Sub search_txt_Change() 'causes a search to be run on text change


Call SearchParts(Trim(search_txt.text), Trim(colour_com.text), Trim(type_com.text))
End Sub

Private Sub searchcustomer_txt_Change() 'causes a search to be run on text change


Dim text As String
Dim ntext As Integer
text = Trim(searchcustomer_txt.text)
ntext = Val(text)
Call CustomerSelection(ntext)
End Sub

Public Sub SearchParts(searchword As String, partcolour As String, parttype As String) 'carries out a search for parts
Dim wordfilter As Boolean 'whether a word filter has been used
Dim colourfilter As Boolean 'whether a colour filter has been used
Dim typefilter As Boolean 'whether a type filter has been used
Dim recordcount As Integer 'counts the position of the currently open record
Dim loadstock As stock 'stores the record in ram temp while checks are made
Dim stockfilechannel As Integer 'an os communication channel
Dim addtolist As Boolean 'whether to add thee current item record to the results list
'carrry out the searches
colourfilter = False
wordfilter = False
typefilter = False
If Trim(searchword) <> "" Then: wordfilter = True
If Trim(partcolour) <> "All" Then: colourfilter = True
If Trim(parttype) <> "All" Then: typefilter = True
part_lst.Clear 'Clears the listbox, ready for new data
cost1_lst.Clear 'Clears the listbox, ready for new data
addtolist = True
recordcount = 1
stockfilechannel = FreeFile 'Sets the file number to an available one
Open stockfilepath For Random As stockfilechannel Len = stockfilelength 'Opens the stock file for random actions (read/write)
Get stockfilechannel, recordcount, loadstock
Do While Not EOF(stockfilechannel)
addtolist = True
Dim containsword As Integer
containsword = InStr((UCase(loadstock.partid & loadstock.partname & loadstock.parttype & loadstock.partdescription & loadstock.partmanufacturer)),
UCase(Trim(searchword)))

93
If wordfilter = True Then
If containsword > 0 Then
addtolist = True
Else
addtolist = False
GoTo loopend
End If
End If
If typefilter = True Then
If Trim(loadstock.parttype) = Trim(parttype) Then
addtolist = True
Else
addtolist = False
GoTo loopend
End If
End If
If colourfilter = True Then
If Trim(loadstock.partcolour) = (partcolour) Then
addtolist = True
Else
addtolist = False
GoTo loopend
End If
End If
loopend: 'handles the post search aspect of the refinement
If addtolist = True And loadstock.discontinued = False Then
part_lst.AddItem (Trim(loadstock.partid) & " | " & Trim(loadstock.partname) & " (" & Trim(loadstock.partcolour) & ") " &
Trim(loadstock.parttype))
cost1_lst.AddItem Val(loadstock.partprice)
If Trim(loadstock.parttype) = "uPVC Plastic" Then
type_lst.AddItem 1
ElseIf Trim(loadstock.parttype) = "Glass" Or Trim(loadstock.parttype) = "Facia" Then
type_lst.AddItem 2
ElseIf Trim(loadstock.parttype) = "Handle" Then
type_lst.AddItem 3
ElseIf Trim(loadstock.parttype) = "Hinge" Then
type_lst.AddItem 4
Else
type_lst.AddItem 0
End If

End If
recordcount = recordcount + 1
Get stockfilechannel, recordcount, loadstock
addtolist = False
Loop
Close stockfilechannel
If part_lst.listcount = 0 Then: part_lst.AddItem "No Matching Parts"
End Sub

Private Sub type_com_Click() 'causes a search update to occur when the type is changed
Call SearchParts(Trim(search_txt.text), Trim(colour_com.text), Trim(type_com.text))
End Sub

Public Sub additemtolistwindow() 'adds the newly designed cad item to the listboxes including all details
Dim nextjobid As Integer 'the id number of the next job id
Dim tempjob As job 'used to carry out the calcualtion on the next job position
Dim jobfilechannel As Integer 'the channel the os should use to communicate with the hard disk

items_lst.RemoveItem (items_lst.listcount - 1)

94
If itemtype_com.text = "Window" Then
items_lst.AddItem Trim("Window with " & windowvopeners & " opener/s")
width_lst.AddItem windowwidth
height_lst.AddItem windowheight
vbars_lst.AddItem windowvbars
vopeners_lst.AddItem windowvopeners
oposition_lst.AddItem windowoposition
oside_lst.AddItem windowhside
pvc_lst.AddItem metresofpvc * Val(quantity_txt.text)
facia_lst.AddItem areaofglass * Val(quantity_txt.text)
handles_lst.AddItem handlesnumber * Val(quantity_txt.text)
hinges_lst.AddItem hinges * Val(quantity_txt.text)
ElseIf itemtype_com.text = "Door" Then
items_lst.AddItem Trim("Door - Style Number: " & windowvopeners)
width_lst.AddItem windowwidth
height_lst.AddItem windowheight
vbars_lst.AddItem windowvbars
vopeners_lst.AddItem windowvopeners
oposition_lst.AddItem windowoposition
oside_lst.AddItem windowhside
pvc_lst.AddItem metresofpvc * Val(quantity_txt.text)
facia_lst.AddItem areaoffacia * Val(quantity_txt.text)
handles_lst.AddItem handlesnumber * Val(quantity_txt.text)
hinges_lst.AddItem hinges * Val(quantity_txt.text)
Else
items_lst.AddItem Trim("Spare Parts")
width_lst.AddItem "-"
height_lst.AddItem "-"
vbars_lst.AddItem "-"
vopeners_lst.AddItem "-"
oposition_lst.AddItem "-"
oside_lst.AddItem "-"
pvc_lst.AddItem 1
facia_lst.AddItem 1
handles_lst.AddItem 1
hinges_lst.AddItem 1
End If

itemquantity_lst.AddItem Val(quantity_txt.text)
items_lst.AddItem "Click To Add Item"
itemtype_com.text = "Select..."
quantity_txt.text = ""
additemsenabled = True
items_lst.Enabled = True
itemid_lst.Enabled = True

jobfilechannel = FreeFile 'Sets the file number to an available one


Open jobfilepath For Random As jobfilechannel Len = jobfilelength 'Opens the order file for random actions (read/write)
nextjobid = (FileLen(jobfilepath) / jobfilelength) + 1000 + jobcount
Close jobfilechannel
itemid_lst.AddItem nextjobid
jobcount = jobcount + 1
save_btn.Enabled = False
itemtype_com.Enabled = False
quantity_txt.Enabled = False

itemdetails_shp.FillColor = &H80000004
itemdetailshead_shp.FillColor = mygrey

End Sub

95
Procedure/Subroutine Details

Procedure/Function/Form Purpose Links to Other


Procedures
CustomerSelection loads the customer data from the file when customer id is selected
totalupprices adds up the costs of the item and updates the controls to reflec the changes
add_btn_Click adds the selected part to the selected itemon the order, usignt the suggested
order quntity where appropriate
additionalcharges_txt_Change calls an update when the inputs are changed
colour_com_Click calls an search when the input is changed
customer_lst_Click loads the customer details from the file and displays them for confirmation
when a customer is selected
datepicker_DateClick handles events that involve user interation with the calendar
Form_Load sets up the form for inputs and ensures the controls display data where
required
Form_Unload opend the main menu when the form is closed
itemid_lst_Click sets the currently selected order id in ram
itemparts_lst_Click enables the removal of a selected part id
items_lst_Click enables the new item controls when new item desired
labourcost_txt_Change calls the update costs procedure
part_lst_click deals with the hidden listboxes when a list item is selected in the parts list
processorder_btn_Click saves the order to the files
quantity_txt_Change deals with any change to the quantity text box
remove_btn_Click used when the items are needed to be removed
save_btn_Click adds the new item to the lists and opens the cad tool if necessary
search_txt_Change causes a search to be run on text change
searchcustomer_txt_Change causes a search to be run on text change
SearchParts carries out a search for parts
type_com_Click causes a search update to occur when the type is changed
additemtolistwindow adds the newly designed cad item to the listboxes including all details

List of Variables

96
Variable Name Type Usage Procedure
additemsenabled Boolean whether the add item controls should be enabled or disabled

customerid Integer the id of the customer that the order is for

jobcount Integer the number jobs currently in the job file

itemidindex Integer the highest value for item pin number in the job file

dateselected Boolean to check the date for order has been selected

recordcount Integer the currently open record number in the file CustomerSelection

loadcustomer customer temp record in ram to hold open records CustomerSelection

customerfilechannel Integer the os file communication channel CustomerSelection

contains Integer used to retun the within string function result CustomerSelection

partcount Integer the currently selected part number in the order totalupprices

totalparts Integer the number of parts in the order totalupprices

totalcost Currency the total cost of the parts within the order totalupprices

labourcost Currency the labour cost (entered by the user) totalupprices

grandtotal Currency the grand total cost (tax + labour + parts +add costs) totalupprices

additionalcharges Currency any additional charges the customer will have to pay (entered by the totalupprices
user)

vat Currency the total VAT cost totalupprices

data String the list box entry to transfer into the parts listbox add_btn_Click

cost Currency the cost of the part add_btn_Click

97
counter Integer counts to the position of item in the listbox to transfer add_btn_Click

partpos Integer stores the position of item in the listbox to transfer add_btn_Click

selectedid Integer the id of the selected item the part is for add_btn_Click

quantity Integer the number of the items required to add the part for add_btn_Click

itemquantity Integer the quantity of the parts required for each item add_btn_Click

tquantity Integer the total quantity required (items * needed for each item) add_btn_Click

indexval Integer the position in the list customer_lst_Click

counter Integer counts to the position of the item in the list customer_lst_Click

loadcustomer customer stores the record in ram customer_lst_Click

customerfilechannel Integer the os file communication channel customer_lst_Click

recordcount Integer count the position of the open record customer_lst_Click

temporder order used to load order records while the next pin is determined Form_Load

orderfilechannel Integer the channel the os will use to communicate with the order file Form_Load

hasselected Boolean returns whether the item in listbox is selected itemid_lst_Click

counter Integer counts the position of the selected id itemid_lst_Click

listcount Integer used to store the position of the instruction list box entry items_lst_Click

indexval Integer the common index value of the item part_lst_click

counter Integer counts to discover the index value part_lst_click

tempjob job stores each job in a record so it can be passed to the file processorder_btn_Click

98
jobfilechannel Integer the channel the os uses to communicate with the job file processorder_btn_Click

numberofitems Integer counts the number of items needed for the order processorder_btn_Click

itemcount Integer counts the position of the current item processorder_btn_Click

numberofparts Integer the number of parts needed for the order processorder_btn_Click

partcount Integer counts the position of the current part processorder_btn_Click

tempitemsorder jobpartlink stores each job link in a record so it can be passed to the file processorder_btn_Click

jobpartlinkfilechannel Integer the channel the os uses to communicate with the job link file processorder_btn_Click
neworder order stores each order in a record so it can be passed to the file processorder_btn_Click

orderfilechannel Integer the channel the os uses to communicate with the order file processorder_btn_Click

saveorder Boolean whether the order should be save post validdation checks processorder_btn_Click

counter Integer counts to the position of the item in teh listbox remove_btn_Click

remove Boolean whether the item currently handled should be removed remove_btn_Click

text String The old text searchcustomer_txt_Change


ntext Integer The new text searchcustomer_txt_Change
wordfilter Boolean whether a word filter has been used SearchParts

colourfilter Boolean whether a colour filter has been used SearchParts

typefilter Boolean whether a type filter has been used SearchParts

recordcount Integer counts the position of the currently open record SearchParts

loadstock stock stores the record in ram temp while checks are made SearchParts

stockfilechannel Integer an os communication channel SearchParts

addtolist Boolean whether to add thee current item record to the results list SearchParts

99
containsword Integer Returns the value of the in string comparison SearchParts
nextjobid Integer the id number of the next job id additemtolistwindow

tempjob job used to carry out the calcualtion on the next job position additemtolistwindow

jobfilechannel Integer the channel the os should use to communicate with the hard disk additemtolistwindow

100
Edit Customer Form

Option Explicit
Dim details As customer 'ram record where the customer details are stored
Dim recordlocation As Integer 'the position of the record to edit in the file

Private Sub cancel_btn_Click() 'closes the form without making changes


Unload Me
End Sub

Private Sub savecustomer_btn_Click() 'saves the changes to the customer file


Dim customerfilechannel As Integer 'the file channel required for data transfer

101
customerfilechannel = FreeFile 'Sets the file number to an available one
Open customerfilepath For Random As customerfilechannel Len = customerfilelength 'Opens the customer file for random actions (read/write)
details.title = title_txt.text 'inserts the details into the ram record
details.forename = forename_txt.text
details.surname = surname_txt.text
details.addressline1 = add1_txt.text
details.addressline2 = add2_txt.text
details.addressline3 = add3_txt.text
details.postcode = postcode_txt.text
details.phonenumber = telephone_txt.text
details.email = email_txt.text
If bcust_chk.Value = 1 Then
details.businesscustomer = True
details.businessname = businessname_txt.text
Else
details.businesscustomer = False
details.businessname = "-"
End If
Put customerfilechannel, recordlocation, details 'inserts the ram record into the hard disk file
Close customerfilechannel
Call mainmenu_frm.LoadAllCustomersTable
MsgBox ("Customer details saved.")
Unload Me
End Sub

Public Sub loadcustomer(pin As Integer) 'loads the details from the record
Dim customerfilechannel As Integer 'the file channel required for data transfer
Dim recordcounter As Integer 'counts the postion of the records
Dim found As Boolean 'used to stop the search
found = False
recordcounter = 1
customerfilechannel = FreeFile 'Sets the file number to an available one
Open customerfilepath For Random As customerfilechannel Len = customerfilelength 'Opens the customer file for random actions (read/write)
Do While found = False And Not EOF(customerfilechannel)
Get customerfilechannel, recordcounter, details
If details.customerid = pin Then
found = True
recordlocation = recordcounter
End If
recordcounter = recordcounter + 1
Loop
If found = True Then 'inserts the record data into the user interface controls for edit
title_txt.text = details.title
forename_txt.text = details.forename
surname_txt.text = details.surname
add1_txt.text = details.addressline1
add2_txt.text = details.addressline2
add3_txt.text = details.addressline3
postcode_txt.text = details.postcode
telephone_txt.text = details.phonenumber
email_txt.text = details.email
If details.businesscustomer = True Then
bcust_chk.Value = 1
Else
bcust_chk.Value = 0
End If
Else 'used in case of error
MsgBox ("No user found")
Unload Me
End If

102
End Sub

103
Procedure/Subroutine Details

Procedure/Function/Form Purpose Links to Other Procedures


cancel_btn_Click closes the form without making changes
savecustomer_btn_Click saves the changes to the customer file
loadcustomer loads the details from the record

List of Variables

Variable Name Type Usage Procedure


details customer ram record where the customer details are stored

recordlocation Integer the position of the record to edit in the file

customerfilechannel Integer the file channel required for data transfer savecustomer_btn_Click

customerfilechannel Integer the file channel required for data transfer loadcustomer

recordcounter Integer counts the postion of the records loadcustomer

found Boolean used to stop the search loadcustomer

104
Edit Stock Form

Option Explicit
Dim editrecordnumber As Integer 'the record number that need to be edited
Dim editstockrecord As stock 'temp stores the record in ram

Public Sub loadstockrecord(stockidforedit As Integer) 'loads the stock item ready for edit
Dim foundrecord As Boolean 'stops the search when flagged true
Dim recordcount As Integer 'counts the current position of the
Dim loadstock As stock 'stores the item record temp. in ram for comparison

105
Dim stockfilechannel As Integer 'the communication channel the program should use
stockfilechannel = FreeFile 'Sets the file number to an available one
recordcount = 1
Open stockfilepath For Random As stockfilechannel Len = stockfilelength 'Opens the stock file for random actions (read/write)
Do While Not EOF(stockfilechannel) 'search until endo of file
Get stockfilechannel, recordcount, loadstock 'load the xth record
If loadstock.partid = stockidforedit Then
editstockrecord = loadstock
parttype_com.text = Trim(loadstock.parttype)
partcolour_com.text = Trim(loadstock.partcolour)
partname_txt.text = Trim(loadstock.partname)
manufacturer_txt.text = Trim(loadstock.partmanufacturer)
partcost_txt.text = Trim(loadstock.partprice)
stocklevel_txt.text = Trim(loadstock.stocklevel)
reorder_txt.text = Trim(loadstock.reorderlevel)
additionalinfo_txt.text = Trim(loadstock.partdescription)
stockunits_com.text = Trim(loadstock.stockunits)
editrecordnumber = recordcount
foundrecord = True
Exit Do 'exit loop when found
End If
recordcount = recordcount + 1
Loop
If foundrecord = False Then 'deals with non-match edits
Me.Hide
MsgBox ("The Stock ID has not been found.")
Unload Me
End If
Close stockfilechannel
End Sub

Private Sub cancel_btn_Click() 'used to close the form without mamking any edits to the record
Unload Me
End Sub

Private Sub savechanges_btn_Click() 'saves the edited record back to the file on disk
Dim newstock As stock 'used to store the details temp.
Dim stockfilechannel As Integer 'used to communicate with the stock file
Dim nextstockid As Integer 'the next available stock id

newstock.partid = editstockrecord.partid
newstock.partname = partname_txt.text
newstock.partcolour = partcolour_com.text
newstock.parttype = parttype_com.text
newstock.stockunits = stockunits_com.text
newstock.partmanufacturer = manufacturer_txt.text
newstock.partprice = Val(partcost_txt.text)
newstock.reorderlevel = Val(reorder_txt.text)
newstock.stocklevel = Val(stocklevel_txt.text)
newstock.partdescription = additionalinfo_txt.text
stockfilechannel = FreeFile 'Sets the file number to an available one
Open stockfilepath For Random As stockfilechannel Len = stockfilelength 'Opens the stock file for random actions (read/write)
Put stockfilechannel, editrecordnumber, newstock
Close stockfilechannel
Call mainmenu_frm.LoadAllStockTable
Unload Me
End Sub

106
Procedure/Subroutine Details

Procedure/Function/Form Purpose Links to Other Procedures


loadstockrecord loads the stock item ready for edit
cancel_btn_Click used to close the form without mamking any edits to the record
savechanges_btn_Click saves the edited record back to the file on disk

List of Variables

Variable Name Type Usage Procedure


editrecordnumber Integer the record number that need to be edited

editstockrecord stock temp stores the record in ram

foundrecord Boolean stops the search when flagged true loadstockrecord

recordcount Integer counts the current position of the loadstockrecord

loadstock stock stores the item record temp. in ram for comparison loadstockrecord

stockfilechannel Integer the communication channel the program should use loadstockrecord

newstock stock used to store the details temp. savechanges_btn_Click

stockfilechannel Integer used to communicate with the stock file savechanges_btn_Click

nextstockid Integer the next available stock id savechanges_btn_Click

107
Load Screen Form

Option Explicit

Private Sub Form_Load() 'sets up all the global variables and creates/loads data files

Dim tempcustomer As customer 'temp customer record while the file is loaded/created
Dim customerfilechannel As Integer 'channel for the system to communicate with the customer file
customerfilepath = "customerfile.dat" 'sets the file name/path
customerfilelength = Len(tempcustomer) 'determines and stores the length of this record in ram global var
customerfilechannel = FreeFile 'Sets the file number to an available one
Open customerfilepath For Random As customerfilechannel Len = customerfilelength 'Opens the customer file for random actions (read/write)
customerfilenextrecord = (FileLen(customerfilepath) / customerfilelength) + 1
Close customerfilechannel

Dim temporder As order 'temp order record while the file is loaded/created
Dim orderfilechannel As Integer 'channel for the system to communicate with the order file
orderfilepath = "orderfile.dat" 'sets the file name/path
orderfilelength = Len(temporder) 'determines and stores the length of this record in ram global var
orderfilechannel = FreeFile 'Sets the file number to an available one
Open orderfilepath For Random As orderfilechannel Len = orderfilelength 'Opens the order file for random actions (read/write)
orderfilenextrecord = (FileLen(orderfilepath) / orderfilelength) + 1
Close orderfilechannel

Dim tempjob As job 'temp job record while the file is loaded/created
Dim jobfilechannel As Integer 'channel for the system to communicate with the job file
jobfilepath = "jobfile.dat" 'sets the file name/path
jobfilelength = Len(tempjob) 'determines and stores the length of this record in ram global var
jobfilechannel = FreeFile 'Sets the file number to an available one
Open jobfilepath For Random As jobfilechannel Len = jobfilelength 'Opens the order file for random actions (read/write)
jobfilenextrecord = (FileLen(jobfilepath) / jobfilelength) + 1
Close jobfilechannel

Dim tempjobpartlink As jobpartlink 'temp job link record while the file is loaded/created
Dim jobpartlinkfilechannel As Integer 'channel for the system to communicate with the job link file
jobpartlinkfilepath = "jobpartlinkfile.dat" 'sets the file name/path
jobpartlinkfilelength = Len(tempjobpartlink) 'determines and stores the length of this record in ram global var
jobpartlinkfilechannel = FreeFile 'Sets the file number to an available one
Open jobpartlinkfilepath For Random As jobpartlinkfilechannel Len = jobpartlinkfilelength 'Opens the order file for random actions (read/write)

108
jobpartlinkfilenextrecord = (FileLen(jobpartlinkfilepath) / jobpartlinkfilelength) + 1
Close jobpartlinkfilechannel

Dim tempstock As stock 'temp stock record while the file is loaded/created
Dim stockfilechannel As Integer 'channel for the system to communicate with the stock file
stockfilepath = "stockfile.dat" 'sets the file name/path
stockfilelength = Len(tempstock) 'determines and stores the length of this record in ram global var
stockfilechannel = FreeFile 'Sets the file number to an available one
Open stockfilepath For Random As stockfilechannel Len = stockfilelength 'Opens the stock file for random actions (read/write)
stockfilenextrecord = (FileLen(stockfilepath) / stockfilelength) + 1
Close stockfilechannel

mygreen = &H3FC68C 'sets the hex value of the software wide green colour
mygrey = &HE0E0E0 'sets the hex value of the software wide grey colour

End Sub

Private Sub loadtime_Timer() 'closes the load screen after a certain length of time
Me.Hide
mainmenu_frm.Show
Unload Me
End Sub

109
Procedure/Subroutine Details

Procedure/Function/Form Purpose Links to Other Procedures


Form_Load sets up all the global variables and creates/loads data files
loadtime_Timer closes the load screen after a certain length of time

List of Variables

Variable Name Type Usage Procedure


tempcustomer customer temp customer record while the file is loaded/created Form_Load

customerfilechannel Integer channel for the system to communicate with the customer file Form_Load

temporder order temp order record while the file is loaded/created Form_Load

orderfilechannel Integer channel for the system to communicate with the order file Form_Load

tempjob job temp job record while the file is loaded/created Form_Load

jobfilechannel Integer channel for the system to communicate with the job file Form_Load

tempjobpartlink jobpartlink temp job link record while the file is loaded/created Form_Load

jobpartlinkfilechannel Integer channel for the system to communicate with the job link file Form_Load

tempstock stock temp stock record while the file is loaded/created Form_Load

stockfilechannel Integer channel for the system to communicate with the stock file Form_Load

110
Low Stock Form

Option Explicit

Private Sub close_btn_Click() 'closes the form when close is clicked


Unload Me
End Sub

Private Sub Form_Load() 'loads up the data and tabulates the stock levels displaying them in the form
Dim recordcount As Integer 'the position of the currently open stock record
Dim loadstock As stock 'temp stock ram record to load data into
Dim stockfilechannel As Integer 'the communication channel for the system and data files
Dim joblinkfilechannel As Integer 'the communication channel for the system and data files
Dim loadjoblink As jobpartlink 'temp joblink ram record to load data into
Dim joblinkcount As Integer 'the position of the currently open job link record
Dim jobdetails As job 'temp job ram record to load data into
Dim jobfilechannel As Integer 'the communication channel for the system and data files
Dim jobfilecount As Integer 'the position of the currently open job record
Dim jobswithpart As Integer 'the number of parts required for the jobs that have not yet been made
Dim foundjob As Boolean 'whether any jobs have been found that require the part
Dim requiredquantity As Integer 'the total required quantity of the stock part
Dim displayitem As Boolean 'whether the stock has 'low stock' level and should be displayed

partid_lst.Clear 'Clears the listbox, ready for new data


partdescription_lst.Clear 'Clears the listbox, ready for new data
manufacturer_lst.Clear 'Clears the listbox, ready for new data
stocklevel_lst.Clear 'Clears the listbox, ready for new data
itemreorderlevel_lst.Clear 'Clears the listbox, ready for new data

111
stockfilechannel = FreeFile 'Sets the file number to an available one
recordcount = 1
Open stockfilepath For Random As stockfilechannel Len = stockfilelength 'Opens the stock file for random actions (read/write)
Do While Not EOF(stockfilechannel)
Get stockfilechannel, recordcount, loadstock 'loads the xth record
If loadstock.stocklevel < loadstock.reorderlevel Then
jobswithpart = 0
joblinkcount = 1
displayitem = False
joblinkfilechannel = FreeFile 'Sets the file number to an available one
Open jobpartlinkfilepath For Random As joblinkfilechannel Len = jobpartlinkfilelength
Do While Not EOF(joblinkfilechannel)
Get joblinkfilechannel, joblinkcount, loadjoblink
If loadjoblink.partid = loadstock.partid Then
foundjob = False
jobfilecount = 1
jobfilechannel = FreeFile 'Sets the file number to an available one
Open jobfilepath For Random As jobfilechannel Len = jobfilelength 'Opens the order file for random actions (read/write)
Do While Not EOF(jobfilechannel) And foundjob = False
Get jobfilechannel, jobfilecount, jobdetails
If Trim(jobdetails.jobstatus) = "Pending" Then
jobswithpart = jobswithpart + 1
requiredquantity = loadjoblink.quantity * jobdetails.quantity
foundjob = True
End If
jobfilecount = jobfilecount + 1
Loop
Close jobfilechannel
End If
joblinkcount = joblinkcount + 1
Loop
Close joblinkfilechannel
If loadstock.discontinued = True And requiredquantity = 0 Then
displayitem = False
Else
displayitem = True
End If
If displayitem = True Then 'adds the stock description and details to the list
partid_lst.AddItem (loadstock.partid)
partdescription_lst.AddItem (Trim(loadstock.partname) & " (" & Trim(loadstock.partcolour) & ") " & Trim(loadstock.parttype))
manufacturer_lst.AddItem (loadstock.partmanufacturer)
stocklevel_lst.AddItem (loadstock.stocklevel & " " & loadstock.stockunits)
itemreorderlevel_lst.AddItem (loadstock.reorderlevel & " " & loadstock.stockunits)
pendingorders_lst.AddItem jobswithpart
requiredquantity_lst.AddItem requiredquantity & " " & loadstock.stockunits
suggestedorderlevel_lst.AddItem (Int(requiredquantity + (loadstock.reorderlevel * 0.5) + loadstock.reorderlevel) & " " &
loadstock.stockunits)
End If
requiredquantity = 0
jobswithpart = 0
End If
recordcount = recordcount + 1
Loop
Close stockfilechannel
End Sub

112
Procedure/Subroutine Details

Procedure/Function/Form Purpose Links to Other Procedures


close_btn_Click closes the form when close is clicked
Form_Load loads up the data and tabulates the stock levels displaying them in the form

List of Variables

Variable Name Type Usage Procedure


recordcount Integer the position of the currently open stock record Form_Load

loadstock stock temp stock ram record to load data into Form_Load

stockfilechannel Integer the communication channel for the system and data files Form_Load

joblinkfilechannel Integer the communication channel for the system and data files Form_Load

loadjoblink jobpartlink temp joblink ram record to load data into Form_Load

joblinkcount Integer the position of the currently open job link record Form_Load

jobdetails job temp job ram record to load data into Form_Load

jobfilechannel Integer the communication channel for the system and data files Form_Load

jobfilecount Integer the position of the currently open job record Form_Load

jobswithpart Integer the number of parts required for the jobs that have not yet been made Form_Load

foundjob Boolean whether any jobs have been found that require the part Form_Load

requiredquantity Integer the total required quantity of the stock part Form_Load

displayitem Boolean whether the stock has 'low stock' level and should be displayed Form_Load

113
Main Menu Form

Option Explicit
Dim frmmove As Boolean 'stores whether the form is being moved
Dim DragX As Integer 'stores the x direction displacement (in pixels)
Dim DragY As Integer 'stores the y direction displacement (in pixels)

114
Dim partselectedindex As Integer 'stores the id of the currently selected part

Private Sub addcustomer_btn_Click() 'This procedure loads the add customer form
addcustomer_frm.Show 1
End Sub

Private Sub addpart_btn_Click() 'This procedure loads the add part form
addstock_frm.Show 1
End Sub

Private Sub allorders_cal_DateClick(ByVal DateClicked As Date) 'This procedure sets loads the order information for the selected date on the calendar
Dim loadorder As order 'holds the data for the currently accessd record
Dim ordercount As Integer 'stores the number of orders that have been loaded from the file
Dim orderfilechannel As Integer 'the channel number the program should use is stored here
Dim ordersondate As Integer 'stores the number of orders that have been made on the date

'clear all list boxes


calorderid_lst.Clear 'Clears the listbox, ready for new data
calstatus_lst.Clear 'Clears the listbox, ready for new data
caltotalcost_lst.Clear 'Clears the listbox, ready for new data
calorderdescription_lst.Clear 'Clears the listbox, ready for new data
calitemid_lst.Clear 'Clears the listbox, ready for new data
calquantity_lst.Clear 'Clears the listbox, ready for new data
calitemdesctiption_lst.Clear 'Clears the listbox, ready for new data
calpartcost_lst.Clear 'Clears the listbox, ready for new data
calpartquantity_lst.Clear 'Clears the listbox, ready for new data
calpartdescription_lst.Clear 'Clears the listbox, ready for new data
calstockid_lst.Clear 'Clears the listbox, ready for new data

'opens the file and loads the orders on the date selected
ordercount = 1
orderfilechannel = FreeFile 'Sets the file number to an available one
Open orderfilepath For Random As orderfilechannel Len = orderfilelength 'Opens the order file for random actions (read/write) 'opens the
file
Do While Not EOF(orderfilechannel)
Get orderfilechannel, ordercount, loadorder 'loads the next record
If loadorder.duedate = DateClicked Then 'compares the dates and adds to the list if matching
calorderid_lst.AddItem Trim(loadorder.orderid)
calstatus_lst.AddItem loadorder.orderstatus
caltotalcost_lst.AddItem "" & loadorder.grandtotal
calorderdescription_lst.AddItem "CUST ID:" & loadorder.customerid & " | ORDERED:" & loadorder.orderdate
ordersondate = ordersondate + 1
End If
ordercount = ordercount + 1
Loop
Close orderfilechannel
selecteddate_lb.Caption = DateClicked
numberoforders_lb.Caption = ordersondate
If ordersondate = 0 Then 'informs the user no results are found
calorderdescription_lst.AddItem "No orders due on this particular date."
End If
End Sub

Public Sub allorders_cal_GetDayBold(ByVal StartDate As Date, ByVal Count As Integer, State() As Boolean) 'Sets the dates on which ordersfall to bold on
the calendar
Dim loadorder As order 'holds the data for the currently accessd record
Dim ordercount As Integer 'stores the number of orders that have been loaded from the file
Dim orderfilechannel As Integer 'the channel number the program should use is stored here
Dim viewcount As Integer 'stores the number of dates visible on the calendar view
Dim founddate As Boolean 'stores whether the date has been found or not

115
'prepares the form nd variable for the routine
allorders_lst.Clear 'Clears the listbox, ready for new data
viewcount = 1
founddate = False
ordercount = 1

'opens the file and loads the orders on the date selected
orderfilechannel = FreeFile 'Sets the file number to an available one
Open orderfilepath For Random As orderfilechannel Len = orderfilelength 'Opens the order file for random actions (read/write)
Do While Not EOF(orderfilechannel)
Get orderfilechannel, ordercount, loadorder
If loadorder.duedate >= DateValue(Now) And Trim(loadorder.orderstatus) = "Pending" Then
viewcount = 1
allorders_lst.AddItem (loadorder.orderid & " | FOR CUSTOMER: " & loadorder.customerid & " | DUE FOR: " & loadorder.duedate & " |
TOTAL COST: " & loadorder.grandtotal)
For viewcount = 1 To Count
If DateValue(allorders_cal.VisibleDays(viewcount)) = DateValue(loadorder.duedate) Then
State(viewcount - 1) = True
End If
Next viewcount
End If
ordercount = ordercount + 1
Loop
Close orderfilechannel
End Sub

Private Sub cad_btn_Click() 'sets the global variables for the cad tools and then loads the appropriate cad tool
If Mid(items_lst.List(partselectedindex), 1, 1) = "W" Then 'checks if window and sets variables
windowwidth = Val(width_lst.List(partselectedindex))
windowheight = Val(height_lst.List(partselectedindex))
windowvbars = Val(vbars_lst.List(partselectedindex))
windowvopeners = Val(vopeners_lst.List(partselectedindex))
windowoposition = Val(oposition_lst.List(partselectedindex))
windowhside = Val(oside_lst.List(partselectedindex))
cadwindowedit = False
cadtoolwindow_frm.Show
ElseIf Mid(items_lst.List(partselectedindex), 1, 1) = "D" Then 'checks if doorand sets variables
windowwidth = Val(width_lst.List(partselectedindex))
windowheight = Val(height_lst.List(partselectedindex))
windowvbars = Val(vbars_lst.List(partselectedindex))
windowvopeners = Val(vopeners_lst.List(partselectedindex))
windowoposition = Val(oposition_lst.List(partselectedindex))
windowhside = Val(oside_lst.List(partselectedindex))
caddooredit = False
cadtooldoor_frm.Show
ElseIf Mid(items_lst.List(partselectedindex), 1, 1) = "s" Then 'checks if spare parts and informs the user
MsgBox ("Spare Parts dont have a CAD design")
Else
MsgBox ("Select an item to view the CAD design") 'in case of none selected.
End If

End Sub

Private Sub calitemid_lst_Click() 'Used to load the relevant order details from the data fileswhen and order is selected in the calendar view.
Dim counter As Integer 'this is a multipurpose variable (used to count through elements/records)
Dim stockcounter As Integer 'used to count the current stock recor number
Dim jobid As Integer 'used to gold the the id number of the surrently loaded job
Dim tempjob As jobpartlink 'used to store the details while opening to a record
Dim jobpartlinkfilechannel As Integer 'used to specify a system channel number for data transfer

116
Dim tempstock As stock 'Used to store the stock detials while opening a record
Dim stockfilechannel As Integer 'used to specify a system channel number for data transfer

For counter = 0 To calitemid_lst.listcount - 1 'finds the selected item


If calitemid_lst.Selected(counter) = True Then
jobid = calitemid_lst.List(counter)
Exit For
End If
Next counter

calpartcost_lst.Clear 'Clears the listbox, ready for new data


calpartquantity_lst.Clear 'Clears the listbox, ready for new data
calpartdescription_lst.Clear 'Clears the listbox, ready for new data
calstockid_lst.Clear 'Clears the listbox, ready for new data

counter = 1
jobpartlinkfilechannel = FreeFile 'Sets the file number to an available one 'Sets the file number to an available one
Open jobpartlinkfilepath For Random As jobpartlinkfilechannel Len = jobpartlinkfilelength 'Opens the order file for random actions (read/write)
Do While Not EOF(jobpartlinkfilechannel)
Get jobpartlinkfilechannel, counter, tempjob
If Trim(tempjob.jobid) = Trim(jobid) Then
calstockid_lst.AddItem tempjob.partid
stockcounter = 1
stockfilechannel = FreeFile 'Sets the file number to an available one 'Sets the file number to an available one
Open stockfilepath For Random As stockfilechannel Len = stockfilelength 'Opens the stock file for random actions (read/write)
Do While Not EOF(stockfilechannel)
Get stockfilechannel, stockcounter, tempstock
If tempstock.partid = tempjob.partid Then
calpartdescription_lst.AddItem Trim(tempstock.partname) & " (" & Trim(tempstock.partcolour) & ") " & Trim(tempstock.parttype)
calpartquantity_lst.AddItem tempjob.quantity
calpartcost_lst.AddItem "" & tempstock.partprice
End If
stockcounter = stockcounter + 1
Loop
Close stockfilechannel
End If
counter = counter + 1
Loop
Close jobpartlinkfilechannel
End Sub

Private Sub calorderid_lst_Click() 'This loads up the parts on the selected order on the calendar view
Dim counter As Integer 'used in loops to count the cycle number
Dim orderid As Integer 'stores the ID number of the order selected
Dim temporder As order 'holds the information temporarily in ram while orders are loaded and compared
Dim orderfilechannel As Integer 'used to specify a system channel number for data transfer
Dim foundorder As Boolean 'used to determine when the program has found the order

For counter = 0 To calorderid_lst.listcount - 1 'locates and sets the selected orderid


If calorderid_lst.Selected(counter) = True Then
orderid = calorderid_lst.List(counter)
Exit For
End If
Next counter

calitemid_lst.Clear 'Clears the listbox, ready for new data


calquantity_lst.Clear 'Clears the listbox, ready for new data
calitemdesctiption_lst.Clear 'Clears the listbox, ready for new data

117
counter = 1
Dim loadjob As job
Dim jobfilechannel As Integer 'used to specify a system channel number for data transfer
jobfilechannel = FreeFile 'Sets the file number to an available one
Open jobfilepath For Random As jobfilechannel Len = jobfilelength 'Opens the order file for random actions (read/write)
Do While Not EOF(jobfilechannel)
Get jobfilechannel, counter, loadjob
If loadjob.orderid = orderid Then
calitemid_lst.AddItem loadjob.jobid
calquantity_lst.AddItem loadjob.quantity
If Trim(loadjob.itemwidth) <> "" Then
calitemdesctiption_lst.AddItem Trim(loadjob.jobdescription)
Else
calitemdesctiption_lst.AddItem (Trim(loadjob.jobdescription))
End If

End If
counter = counter + 1
Loop
Close jobfilechannel
End Sub

Private Sub close_lab_Click() 'ends the program


End
End Sub

Public Sub LoadAllStockTable() 'loads all the stock in the stock file into the table on the stock management tab
Dim recordcount As Integer 'counts the position of the record open
Dim loadstock As stock 'stores the record in ram temp. while data is compared for a match
Dim stockfilechannel As Integer 'used to specify a system channel number for data transfer

partid_lst.Clear 'Clears the listbox, ready for new data


partdescription_lst.Clear 'Clears the listbox, ready for new data
partman_lst.Clear 'Clears the listbox, ready for new data
partprice_lst.Clear 'Clears the listbox, ready for new data
stocklevel_lst.Clear 'Clears the listbox, ready for new data
reorderlevel_lst.Clear 'Clears the listbox, ready for new data

stockfilechannel = FreeFile 'Sets the file number to an available one


recordcount = 1
Open stockfilepath For Random As stockfilechannel Len = stockfilelength 'Opens the stock file for random actions (read/write)
Get stockfilechannel, recordcount, loadstock
Do While Not EOF(stockfilechannel)
If loadstock.discontinued = False Then
partid_lst.AddItem (loadstock.partid)
partdescription_lst.AddItem (Trim(loadstock.partname) & " (" & Trim(loadstock.partcolour) & ") " & Trim(loadstock.parttype))
partman_lst.AddItem (loadstock.partmanufacturer)
partprice_lst.AddItem ("" & loadstock.partprice)
stocklevel_lst.AddItem (loadstock.stocklevel & " " & loadstock.stockunits)
reorderlevel_lst.AddItem (loadstock.reorderlevel & " " & loadstock.stockunits)
End If
recordcount = recordcount + 1
Get stockfilechannel, recordcount, loadstock
Loop
Close stockfilechannel
End Sub

Public Sub LoadAllCustomersTable() 'loads all the customers in the customer file into the table on the customer management tab
Dim recordcount As Integer 'counts the position of the record open

118
Dim loadcustomer As customer 'stores the record in ram temp. while data is compared for a match
Dim customerfilechannel As Integer 'used to specify a system channel number for data transfer
pin_lst.Clear 'Clears the listbox, ready for new data
name_lst.Clear 'Clears the listbox, ready for new data
address_lst.Clear 'Clears the listbox, ready for new data
businessTF_lst.Clear 'Clears the listbox, ready for new data
businessname_lst.Clear 'Clears the listbox, ready for new data
email_lst.Clear 'Clears the listbox, ready for new data
phone_lst.Clear 'Clears the listbox, ready for new data
recordcount = 1
customerfilechannel = FreeFile 'Sets the file number to an available one
Open customerfilepath For Random As customerfilechannel Len = customerfilelength 'Opens the customer file for random actions (read/write)
Get customerfilechannel, recordcount, loadcustomer
Do While Not EOF(customerfilechannel)
pin_lst.AddItem (loadcustomer.customerid)
name_lst.AddItem (Trim(loadcustomer.forename) & " " & Trim(loadcustomer.surname))
If loadcustomer.businesscustomer = True Then
businessTF_lst.AddItem ("YES")
Else
businessTF_lst.AddItem (" NO")
End If
businessname_lst.AddItem (Trim(loadcustomer.businessname))
address_lst.AddItem (Trim(loadcustomer.addressline1) & ", " & Trim(loadcustomer.addressline2) & ", " & Trim(loadcustomer.addressline3) & ", " &
Trim(loadcustomer.postcode))
phone_lst.AddItem (Trim(loadcustomer.phonenumber))
email_lst.AddItem (Trim(loadcustomer.email))
recordcount = recordcount + 1
Get customerfilechannel, recordcount, loadcustomer
Loop
Close customerfilechannel
End Sub

Private Sub createorder_btn_Click() 'loads the create order form


createorder_frm.Show
Unload Me
End Sub

Private Sub discontinuestock_btn_Click() 'removes the inputted stock part from the system
Dim editstockid As Integer 'used to store the stock id required for edit
editstockid = Val(InputBox("Input the Stock ID number of the part to discontinue", "Remove Stock - Input Stock ID"))
If editstockid <> 0 Then
Dim recordcount As Integer 'counts the position of the record open
Dim loadstock As stock 'stores the record in ram temp. while data is compared for a match
Dim stockfilechannel As Integer 'used to specify a system channel number for data transfer
Dim edited As Boolean 'flagged to end the do while
stockfilechannel = FreeFile 'Sets the file number to an available one
recordcount = 1
Open stockfilepath For Random As stockfilechannel Len = stockfilelength 'Opens the stock file for random actions (read/write)
Do While Not EOF(stockfilechannel)
Get stockfilechannel, recordcount, loadstock
If loadstock.partid = editstockid Then
loadstock.discontinued = True
Put stockfilechannel, recordcount, loadstock
edited = True
Exit Do
End If
recordcount = recordcount + 1
Loop
If edited = False Then
MsgBox ("Stock not discontinued updated, stock ID not found.")

119
Else
MsgBox ("Stock has been discontinued from use, however outstanding orders with this stock part will still require it.")
End If
Close stockfilechannel
Call LoadAllStockTable
End If
End Sub

Private Sub editcustomer_btn_Click() 'querys the user id required and then loads the edit user form
Dim pin As Integer 'stores the id number of the customer intended for edit
pin = Val(InputBox("Input the Customer ID number of the customer to edit", "Input Customer ID"))
If pin <> 0 Then
editcustomer_frm.Show
Call editcustomer_frm.loadcustomer(pin)
Else
MsgBox ("The inputed Customer ID is invalid.")
End If
End Sub

Private Sub editstock_btn_Click() 'querys the stock id required and then loads the edit stock/part form
Dim editstockid As Integer 'stores the id number of the stock part intended for edit
editstockid = Val(InputBox("Input the Stock ID number of the part to edit", "Input Stock ID"))
If editstockid <> 0 Then
editstock_frm.Show
Call editstock_frm.loadstockrecord(editstockid)
Else
MsgBox ("The inputed Stock ID is invalid.")
End If
End Sub

Private Sub Form_Load() 'initialises the program after load


Call LoadAllCustomersTable
Call LoadAllStockTable
Call loadallorders
End Sub

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) 'handles the movement of the main menu (since it has no title
bar)
frmmove = True
DragX = X
DragY = Y
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) 'handles the movement of the main menu (since it has no title
bar)
Dim newx, newy 'the new coordinates of the form during moving
If frmmove Then
newx = mainmenu_frm.Left + X - DragX
newy = mainmenu_frm.Top + Y - DragY
mainmenu_frm.Left = newx
mainmenu_frm.Top = newy
End If
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) 'handles the movement of the main menu (since it has no title
bar)
Dim newx, newy 'the new coordinates of the form after moving
newx = mainmenu_frm.Left + X - DragX
newy = mainmenu_frm.Top + Y - DragY
mainmenu_frm.Left = newx
mainmenu_frm.Top = newy
frmmove = False

120
End Sub

Private Sub itemid_lst_Click() 'loads the parts for the selected item into the viewer
Dim counter As Integer 'used to count the location of item in list
Dim stockcounter As Integer 'used to count the record position
Dim jobid As Integer 'store the id of the job required for open
Dim tempjob As jobpartlink 'holds the record in ram while a comparison is made
Dim jobpartlinkfilechannel As Integer 'used to specify a system channel number for data transfer
Dim tempstock As stock 'holds the stock in ram while details are retreived
Dim stockfilechannel As Integer 'used to specify a system channel number for data transfer

Opo_lst.Clear 'Clears the listbox, ready for new data


Opartid_lst.Clear 'Clears the listbox, ready for new data
Opartdescription_lst.Clear 'Clears the listbox, ready for new data
Opartquantity_lst.Clear 'Clears the listbox, ready for new data
Opartcost_lst.Clear 'Clears the listbox, ready for new data
Opartstock_lst.Clear 'Clears the listbox, ready for new data

For counter = 0 To itemid_lst.listcount - 1 'determines the selected item in the list


If itemid_lst.Selected(counter) = True Then
jobid = itemid_lst.List(counter)
partselectedindex = counter
Exit For
End If
Next counter

counter = 1
jobpartlinkfilechannel = FreeFile 'Sets the file number to an available one
Open jobpartlinkfilepath For Random As jobpartlinkfilechannel Len = jobpartlinkfilelength 'Opens the order file for random actions (read/write)
Do While Not EOF(jobpartlinkfilechannel)
Get jobpartlinkfilechannel, counter, tempjob
If Trim(tempjob.jobid) = Trim(jobid) Then
Opartid_lst.AddItem tempjob.partid
Opo_lst.AddItem tempjob.jobid
stockcounter = 1
stockfilechannel = FreeFile 'Sets the file number to an available one
Open stockfilepath For Random As stockfilechannel Len = stockfilelength 'Opens the stock file for random actions (read/write)
Do While Not EOF(stockfilechannel)
Get stockfilechannel, stockcounter, tempstock
If tempstock.partid = tempjob.partid Then
Opartdescription_lst.AddItem Trim(tempstock.partname) & " (" & Trim(tempstock.partcolour) & ") " & Trim(tempstock.parttype)
Opartquantity_lst.AddItem tempjob.quantity
Opartcost_lst.AddItem "" & tempstock.partprice
Opartstock_lst.AddItem Trim(tempstock.stocklevel) & " " & Trim(tempstock.stockunits)
End If
stockcounter = stockcounter + 1
Loop
Close stockfilechannel
End If
counter = counter + 1
Loop
Close jobpartlinkfilechannel
End Sub

Private Sub itemid_lst_DblClick() 'loads the selected items details when selected so the cad viewer is ready to open
If Mid(items_lst.List(partselectedindex), 1, 1) = "W" Then 'sets the variables ready for the cad viewer
windowwidth = Val(width_lst.List(partselectedindex))
windowheight = Val(height_lst.List(partselectedindex))
windowvbars = Val(vbars_lst.List(partselectedindex))
windowvopeners = Val(vopeners_lst.List(partselectedindex))

121
windowoposition = Val(oposition_lst.List(partselectedindex))
windowhside = Val(oside_lst.List(partselectedindex))
cadwindowedit = False
cadtoolwindow_frm.Show
ElseIf Mid(items_lst.List(partselectedindex), 1, 1) = "D" Then 'sets the variables ready for the cad viewer
windowwidth = Val(width_lst.List(partselectedindex))
windowheight = Val(height_lst.List(partselectedindex))
windowvbars = Val(vbars_lst.List(partselectedindex))
windowvopeners = Val(vopeners_lst.List(partselectedindex))
windowoposition = Val(oposition_lst.List(partselectedindex))
windowhside = Val(oside_lst.List(partselectedindex))
caddooredit = False
cadtooldoor_frm.Show
ElseIf Mid(items_lst.List(partselectedindex), 1, 1) = "s" Then 'returns appropriate error dialog in other cases
MsgBox ("Spare Parts dont have a CAD design")
Else
MsgBox ("Select an item to view the CAD design")
End If
End Sub

Private Sub lowstock_btn_Click() 'opens the low stock form


lowstock_frm.Show
End Sub

Private Sub markascomplete_btn_Click() 'marks the inputted order id as complete status in the file
Dim orderid As Integer 'used to store the id or the order which needs status edit
Dim updated As Boolean 'flagged to note whether the changes have been made
Dim ordercount As Integer 'counts the record position in the file
Dim orderfilechannel As Integer 'used to specify a system channel number for data transfer
Dim loadorder As order 'stores the record in ram while the record is edited
orderid = Val(InputBox("Input the Order ID number of the Order to update.", "Edit order Status - Input Order ID"))
ordercount = 1
If orderid <> 0 Then
orderfilechannel = FreeFile 'Sets the file number to an available one
Open orderfilepath For Random As orderfilechannel Len = orderfilelength 'Opens the order file for random actions (read/write)
Do While Not EOF(orderfilechannel) And updated = False
Get orderfilechannel, ordercount, loadorder
If loadorder.orderid = orderid Then
loadorder.orderstatus = "Complete"
updated = True
Put orderfilechannel, ordercount, loadorder
MsgBox ("Order status updated.")
End If
ordercount = ordercount + 1
Loop
Close orderfilechannel
Else
MsgBox ("Order ID not found.")
End If
Call loadallorders
End Sub

Private Sub markorderdispatched_btn_Click() 'marks the inputted order id as dispatched status in the file
Dim orderid As Integer 'used to store the id or the order which needs status edit
Dim updated As Boolean 'flagged to note whether the changes have been made
Dim ordercount As Integer 'counts the record position in the file
Dim orderfilechannel As Integer 'used to specify a system channel number for data transfer
Dim loadorder As order 'stores the record in ram while the record is edited
orderid = Val(InputBox("Input the Order ID number of the Order to mark dispatched.", "Edit order Status - Input Order ID"))
ordercount = 1

122
If orderid <> 0 Then
orderfilechannel = FreeFile 'Sets the file number to an available one
Open orderfilepath For Random As orderfilechannel Len = orderfilelength 'Opens the order file for random actions (read/write)
Do While Not EOF(orderfilechannel) And updated = False
Get orderfilechannel, ordercount, loadorder
If loadorder.orderid = orderid Then
loadorder.orderstatus = "Dispatched"
updated = True
Put orderfilechannel, ordercount, loadorder
MsgBox ("Order status updated.")
End If
ordercount = ordercount + 1
Loop
Close orderfilechannel
Else
MsgBox ("Input an ID.")
updated = True
End If
If updated = False Then
MsgBox ("Order ID not found.")
End If
Call loadallorders
End Sub

Private Sub orderid_lst_Click() 'loads the parts within the order selected in the listbox
Dim counter As Integer 'used to count the position of the record
Dim orderid As Integer 'used to store the id or the order which needs status edit
Dim temporder As order 'stores the record in ram while the record is edited
Dim orderfilechannel As Integer 'used to specify a system channel number for data transfer
Dim foundorder As Boolean 'flagged to note whether the changes have been made
Dim loadjob As job 'stores the job record in ram while the record is loaded
Dim jobfilechannel As Integer 'used to specify a system channel number for data transfer

For counter = 0 To orderid_lst.listcount - 1 'determines the selected item in the list


If orderid_lst.Selected(counter) = True Then
orderid = orderid_lst.List(counter)
Exit For
End If
Next counter

counter = 1
orderfilechannel = FreeFile 'Sets the file number to an available one
Open orderfilepath For Random As orderfilechannel Len = orderfilelength 'Opens the order file for random actions (read/write)
Do While Not EOF(orderfilechannel) And foundorder = False
Get orderfilechannel, counter, temporder
If temporder.orderid = orderid Then
orderdue_lb.Caption = temporder.duedate
orderid_lb.Caption = temporder.orderid
orderdate_lb.Caption = temporder.orderdate
orderstatus_lb.Caption = temporder.orderstatus
If temporder.orderpaid = True Then
paid_lb.Caption = "Yes"
Else
paid_lb.Caption = "No"
End If
If temporder.requiresdelivery = True Then
delivery_lb.Caption = "Yes"
Else
delivery_lb.Caption = "No"

123
End If
partscost_lb.Caption = "" & temporder.partscost
labourcost_lb.Caption = "" & temporder.labourcost
additionalchargescost_lb.Caption = "" & temporder.additionalcharges
grandtotal_lb.Caption = "" & temporder.grandtotal
vat_lb.Caption = "" & temporder.tax
foundorder = True
End If
counter = counter + 1
Loop
Close orderfilechannel

Opo_lst.Clear 'Clears the listbox, ready for new data


Opartid_lst.Clear 'Clears the listbox, ready for new data
Opartdescription_lst.Clear 'Clears the listbox, ready for new data
Opartquantity_lst.Clear 'Clears the listbox, ready for new data
Opartcost_lst.Clear 'Clears the listbox, ready for new data
Opartstock_lst.Clear 'Clears the listbox, ready for new data
itemid_lst.Clear 'Clears the listbox, ready for new data
quantityofitem_lst.Clear 'Clears the listbox, ready for new data
items_lst.Clear 'Clears the listbox, ready for new data
width_lst.Clear 'Clears the listbox, ready for new data
height_lst.Clear 'Clears the listbox, ready for new data
vbars_lst.Clear 'Clears the listbox, ready for new data
vopeners_lst.Clear 'Clears the listbox, ready for new data
oposition_lst.Clear 'Clears the listbox, ready for new data
oside_lst.Clear 'Clears the listbox, ready for new data

counter = 1
jobfilechannel = FreeFile 'Sets the file number to an available one
Open jobfilepath For Random As jobfilechannel Len = jobfilelength 'Opens the order file for random actions (read/write)
Do While Not EOF(jobfilechannel)
Get jobfilechannel, counter, loadjob
If loadjob.orderid = orderid Then
itemid_lst.AddItem loadjob.jobid
quantityofitem_lst.AddItem loadjob.quantity
If Trim(loadjob.itemwidth) <> 0 Then
items_lst.AddItem Trim(loadjob.jobdescription)
width_lst.AddItem Val(loadjob.itemwidth)
height_lst.AddItem Val(loadjob.itemheight)
vbars_lst.AddItem loadjob.panels
vopeners_lst.AddItem loadjob.ostyle
oposition_lst.AddItem loadjob.oposition
oside_lst.AddItem loadjob.hside
Else
items_lst.AddItem (Trim(loadjob.jobdescription))
width_lst.AddItem "-"
height_lst.AddItem "-"
vbars_lst.AddItem "-"
vopeners_lst.AddItem "-"
oposition_lst.AddItem "-"
oside_lst.AddItem "-"
End If
End If
counter = counter + 1
Loop
Close jobfilechannel

End Sub

124
Private Sub paidinfull_btn_Click() 'marks the inputted order id as paid in full status in the file
Dim orderid As Integer 'used to store the id or the order which needs status edit
Dim updated As Boolean 'flagged to note whether the changes have been made
Dim ordercount As Integer 'counts the record position in the file
Dim orderfilechannel As Integer 'used to specify a system channel number for data transfer
Dim loadorder As order 'stores the record in ram while the record is edited
orderid = Val(InputBox("Input the Order ID number of the Order to mark as paid.", "Edit order payment Status - Input Order ID"))
ordercount = 1
If orderid <> 0 Then
orderfilechannel = FreeFile 'Sets the file number to an available one
Open orderfilepath For Random As orderfilechannel Len = orderfilelength 'Opens the order file for random actions (read/write)
Do While Not EOF(orderfilechannel) And updated = False
Get orderfilechannel, ordercount, loadorder
If loadorder.orderid = orderid Then
loadorder.orderpaid = True
updated = True
Put orderfilechannel, ordercount, loadorder
MsgBox ("Order status updated.")
End If
ordercount = ordercount + 1
Loop
Close orderfilechannel
Else
MsgBox ("Order ID not found.")
End If
Call loadallorders
End Sub

Private Sub refresh_btn_Click() 'updates the table view


Call LoadAllStockTable
End Sub

Public Sub loadallorders() 'loads all the customers orders into the table ready for viewing
Dim loadorder As order 'stores the record in ram while the record is edited
Dim ordercount As Integer 'counts the record position in the file
Dim customeridfound As Boolean 'flagged to note whether the changes have been made
Dim customersearchcount As Integer 'counts the record position in the file
Dim customerfilechannel As Integer 'used to specify a system channel number for data transfer
Dim orderfilechannel As Integer 'used to specify a system channel number for data transfer
Dim loadcustomer As customer 'stores the customer record while a comparison is made
ordercount = 1

customerid_lst.Clear 'Clears the listbox, ready for new data


orderid_lst.Clear 'Clears the listbox, ready for new data
customername_lst.Clear 'Clears the listbox, ready for new data
deliveryaddress_lst.Clear 'Clears the listbox, ready for new data
orderstatus_lst.Clear 'Clears the listbox, ready for new data
partscost_lst.Clear 'Clears the listbox, ready for new data
labourcost_lst.Clear 'Clears the listbox, ready for new data
totalcost_lst.Clear 'Clears the listbox, ready for new data
additionalcharges_lst.Clear 'Clears the listbox, ready for new data
additionalchargesdescription_lst.Clear 'Clears the listbox, ready for new data

orderfilechannel = FreeFile 'Sets the file number to an available one


Open orderfilepath For Random As orderfilechannel Len = orderfilelength 'Opens the order file for random actions (read/write)
Do While Not EOF(orderfilechannel)
Get orderfilechannel, ordercount, loadorder
If loadorder.orderid <> 0 Then
orderid_lst.AddItem Trim(loadorder.orderid)
customerid_lst.AddItem loadorder.customerid

125
customerfilechannel = FreeFile 'Sets the file number to an available one
customersearchcount = 1
customeridfound = False
Open customerfilepath For Random As customerfilechannel Len = customerfilelength 'Opens the customer file for random actions
(read/write)
Do While Not EOF(customerfilechannel) And customeridfound = False
Get customerfilechannel, customersearchcount, loadcustomer
If loadcustomer.customerid = loadorder.customerid Then
customername_lst.AddItem Trim(loadcustomer.forename) & " " & Trim(loadcustomer.surname)
deliveryaddress_lst.AddItem Trim(loadcustomer.addressline1) & " " & Trim(loadcustomer.addressline2) & " " &
Trim(loadcustomer.addressline3) & " " & Trim(loadcustomer.postcode)
customeridfound = True
End If
customersearchcount = customersearchcount + 1
Loop
If customeridfound = False Then
customername_lst.AddItem "Customer No Longer Exists"
End If
Close customerfilechannel
orderstatus_lst.AddItem loadorder.orderstatus
partscost_lst.AddItem "" & loadorder.partscost
labourcost_lst.AddItem "" & loadorder.labourcost
totalcost_lst.AddItem "" & loadorder.grandtotal
additionalcharges_lst.AddItem "" & loadorder.additionalcharges
additionalchargesdescription_lst.AddItem loadorder.additionalchargesdescription
End If
ordercount = ordercount + 1
Loop
Close orderfilechannel
End Sub

Private Sub searchcustomerorders_btn_Click() 'refines the displayed orders by using an inputted search string
Dim loadorder As order 'stores the record in ram while the record is edited
Dim ordercount As Integer 'counts the record position in the file
Dim customeridfound As Boolean 'flagged to note whether the changes have been made
Dim customersearchcount As Integer 'counts the record position in the file
Dim customerfilechannel As Integer 'used to specify a system channel number for data transfer
Dim orderfilechannel As Integer 'used to specify a system channel number for data transfer
Dim loadcustomer As customer 'stores the customer record while a comparison is made
Dim searchterm As String 'holds the users input string to compare with records in file

customerid_lst.Clear 'Clears the listbox, ready for new data


orderid_lst.Clear 'Clears the listbox, ready for new data
customername_lst.Clear 'Clears the listbox, ready for new data
deliveryaddress_lst.Clear 'Clears the listbox, ready for new data
orderstatus_lst.Clear 'Clears the listbox, ready for new data
partscost_lst.Clear 'Clears the listbox, ready for new data
labourcost_lst.Clear 'Clears the listbox, ready for new data
totalcost_lst.Clear 'Clears the listbox, ready for new data
additionalcharges_lst.Clear 'Clears the listbox, ready for new data
additionalchargesdescription_lst.Clear 'Clears the listbox, ready for new data

searchterm = InputBox("Input Customer ID to search for their orders.", "Input Customer ID")
ordercount = 1
orderfilechannel = FreeFile 'Sets the file number to an available one
Open orderfilepath For Random As orderfilechannel Len = orderfilelength 'Opens the order file for random actions (read/write)
Do While Not EOF(orderfilechannel)
Get orderfilechannel, ordercount, loadorder
If loadorder.customerid = Val(searchterm) And loadorder.orderid <> 0 Then

126
orderid_lst.AddItem Trim(loadorder.orderid)
customerid_lst.AddItem loadorder.customerid
customerfilechannel = FreeFile 'Sets the file number to an available one
customersearchcount = 1
customeridfound = False
Open customerfilepath For Random As customerfilechannel Len = customerfilelength 'Opens the customer file for random actions
(read/write)
Do While Not EOF(customerfilechannel) And customeridfound = False
Get customerfilechannel, customersearchcount, loadcustomer
If loadcustomer.customerid = loadorder.customerid Then
customername_lst.AddItem Trim(loadcustomer.forename) & " " & Trim(loadcustomer.surname)
deliveryaddress_lst.AddItem Trim(loadcustomer.addressline1) & " " & Trim(loadcustomer.addressline2) & " " &
Trim(loadcustomer.addressline3) & " " & Trim(loadcustomer.postcode)
customeridfound = True
End If
customersearchcount = customersearchcount + 1
Loop
If customeridfound = False Then
customername_lst.AddItem "Customer No Longer Exists"
End If
Close customerfilechannel
orderstatus_lst.AddItem loadorder.orderstatus
partscost_lst.AddItem "" & loadorder.partscost
labourcost_lst.AddItem "" & loadorder.labourcost
totalcost_lst.AddItem "" & loadorder.grandtotal
additionalcharges_lst.AddItem "" & loadorder.additionalcharges
additionalchargesdescription_lst.AddItem loadorder.additionalchargesdescription
End If
ordercount = ordercount + 1
Loop
Close orderfilechannel
If orderid_lst.listcount = 0 Then
MsgBox ("No orders found for the searched customer ID. System will display all orders.")
Call loadallorders
Else
MsgBox ((orderid_lst.listcount & " orders found for the searched ID."))
End If
End Sub

Private Sub searchorderid_btn_Click() 'refines the displayed orders by using an inputted search string
Dim loadorder As order 'stores the record in ram while the record is edited
Dim ordercount As Integer 'counts the record position in the file
Dim customeridfound As Boolean 'flagged to note whether the changes have been made
Dim customersearchcount As Integer 'counts the record position in the file
Dim customerfilechannel As Integer 'used to specify a system channel number for data transfer
Dim orderfilechannel As Integer 'used to specify a system channel number for data transfer
Dim loadcustomer As customer 'stores the customer record while a comparison is made
Dim searchterm As String 'holds the users input string to compare with records in file

customerid_lst.Clear 'Clears the listbox, ready for new data


orderid_lst.Clear 'Clears the listbox, ready for new data
customername_lst.Clear 'Clears the listbox, ready for new data
deliveryaddress_lst.Clear 'Clears the listbox, ready for new data
orderstatus_lst.Clear 'Clears the listbox, ready for new data
partscost_lst.Clear 'Clears the listbox, ready for new data
labourcost_lst.Clear 'Clears the listbox, ready for new data
totalcost_lst.Clear 'Clears the listbox, ready for new data
additionalcharges_lst.Clear 'Clears the listbox, ready for new data
additionalchargesdescription_lst.Clear 'Clears the listbox, ready for new data

127
searchterm = InputBox("Input Order ID to search an order.", "Input Order ID")
ordercount = 1
orderfilechannel = FreeFile 'Sets the file number to an available one
Open orderfilepath For Random As orderfilechannel Len = orderfilelength 'Opens the order file for random actions (read/write)
Do While Not EOF(orderfilechannel)
Get orderfilechannel, ordercount, loadorder
If loadorder.orderid = Val(searchterm) And loadorder.orderid <> 0 Then
orderid_lst.AddItem Trim(loadorder.orderid)
customerid_lst.AddItem loadorder.customerid
customerfilechannel = FreeFile 'Sets the file number to an available one
customersearchcount = 1
customeridfound = False
Open customerfilepath For Random As customerfilechannel Len = customerfilelength 'Opens the customer file for random actions
(read/write)
Do While Not EOF(customerfilechannel) And customeridfound = False
Get customerfilechannel, customersearchcount, loadcustomer
If loadcustomer.customerid = loadorder.customerid Then
customername_lst.AddItem Trim(loadcustomer.forename) & " " & Trim(loadcustomer.surname)
deliveryaddress_lst.AddItem Trim(loadcustomer.addressline1) & " " & Trim(loadcustomer.addressline2) & " " &
Trim(loadcustomer.addressline3) & " " & Trim(loadcustomer.postcode)
customeridfound = True
End If
customersearchcount = customersearchcount + 1
Loop
If customeridfound = False Then
customername_lst.AddItem "Customer No Longer Exists"
End If
Close customerfilechannel
orderstatus_lst.AddItem loadorder.orderstatus
partscost_lst.AddItem "" & loadorder.partscost
labourcost_lst.AddItem "" & loadorder.labourcost
totalcost_lst.AddItem "" & loadorder.grandtotal
additionalcharges_lst.AddItem "" & loadorder.additionalcharges
additionalchargesdescription_lst.AddItem loadorder.additionalchargesdescription
End If
ordercount = ordercount + 1
Loop
Close orderfilechannel
If orderid_lst.listcount = 0 Then
MsgBox ("No orders found for the searched order ID. System will display all orders.")
Call loadallorders
Else
MsgBox ((orderid_lst.listcount & " order/s found for the searched ID."))
End If
End Sub

Private Sub srchstock_txt_Change() 'refines the displayed stock by using an inputted search string
Dim recordcount As Integer 'coutns the position of the currently opened record in the action
Dim loadstock As stock 'stores the stock record in ram while a comparison is made
Dim stockfilechannel As Integer 'used to specify a system channel number for data transfer
Dim searchword As String 'holds the users input string to compare with records in file

srchstockid_lst.Clear 'Clears the listbox, ready for new data


srchstockdescription_lst.Clear 'Clears the listbox, ready for new data
srchstockcost_lst.Clear 'Clears the listbox, ready for new data
srchstockmanufacturer_lst.Clear 'Clears the listbox, ready for new data
srchstocklevel_lst.Clear 'Clears the listbox, ready for new data
srchstockcolour_lst.Clear 'Clears the listbox, ready for new data

128
searchword = srchstock_txt.text
recordcount = 1
stockfilechannel = FreeFile 'Sets the file number to an available one
Open stockfilepath For Random As stockfilechannel Len = stockfilelength 'Opens the stock file for random actions (read/write)
Get stockfilechannel, recordcount, loadstock
Do While Not EOF(stockfilechannel)
Dim containsword As Integer
containsword = InStr((UCase(loadstock.partid & loadstock.partcolour & loadstock.partname & loadstock.parttype & loadstock.partdescription &
loadstock.partmanufacturer)), UCase(Trim(searchword)))
If containsword > 0 And loadstock.discontinued = False Then
srchstockid_lst.AddItem loadstock.partid
srchstockdescription_lst.AddItem (Trim(loadstock.partname) & " " & Trim(loadstock.parttype))
srchstockcost_lst.AddItem ("" & Val(loadstock.partprice) & " per one " & loadstock.stockunits)
srchstockmanufacturer_lst.AddItem loadstock.partmanufacturer
srchstocklevel_lst.AddItem loadstock.stocklevel & " " & loadstock.stockunits
srchstockcolour_lst.AddItem loadstock.partcolour
End If
recordcount = recordcount + 1
Get stockfilechannel, recordcount, loadstock
Loop
Close stockfilechannel
If srchstockdescription_lst.listcount = 0 Then: srchstockdescription_lst.AddItem "No Matching Stock Parts"

If searchword = "" Then


srchstockid_lst.Clear 'Clears the listbox, ready for new data
srchstockdescription_lst.Clear 'Clears the listbox, ready for new data
srchstockcost_lst.Clear 'Clears the listbox, ready for new data
srchstockmanufacturer_lst.Clear 'Clears the listbox, ready for new data
srchstocklevel_lst.Clear 'Clears the listbox, ready for new data
srchstockcolour_lst.Clear 'Clears the listbox, ready for new data
End If
End Sub

Private Sub srchusr_txt_Change() 'causes the filter to be run on the text change event
Call srchusr
End Sub

Private Sub srchusr() 'refines the displayed customers by using an inputted search string
Dim recordcount As Integer 'stores the position of the currently open record in ram
Dim loadcustomer As customer 'stores the customer details of the open record in ram
Dim customerfilechannel As Integer 'used to specify a system channel number for data transfer
Dim searchablestring As String 'holds the users input string to compare with records in file
Dim containsword As Integer 'returns >1 for true, >1 for false result
Dim numberofresults As Integer 'counts the number of matching results
Dim temporder As order 'stores the order details in ram temporarily
Dim orderfilechannel As Integer 'used to specify a system channel number for data transfer
Dim orderfilecount As Integer 'stores the position of the currently open record in ram
Dim orderspending As Integer 'stores the number of orders that are pending for the user
Dim ordersmade As Integer 'stores the number of orders that have been made by the user

srchusruserid_lst.Clear 'Clears the listbox, ready for new data


srchusrname_lst.Clear 'Clears the listbox, ready for new data
srchusrphone_lst.Clear 'Clears the listbox, ready for new data
srchusremail_lst.Clear 'Clears the listbox, ready for new data
srchusrorders_lst.Clear 'Clears the listbox, ready for new data
srchusrpending_lst.Clear 'Clears the listbox, ready for new data

numberofresults = 0
recordcount = 1
customerfilechannel = FreeFile 'Sets the file number to an available one

129
Open customerfilepath For Random As customerfilechannel Len = customerfilelength 'Opens the customer file for random actions (read/write)
Get customerfilechannel, recordcount, loadcustomer
Do While Not EOF(customerfilechannel)
containsword = 0
searchablestring = loadcustomer.customerid & Trim(loadcustomer.forename) & " " & Trim(loadcustomer.surname) & Trim(loadcustomer.phonenumber) &
Trim(loadcustomer.email)
containsword = InStr(searchablestring, srchusr_txt.text)
If containsword > 0 Then
srchusruserid_lst.AddItem (loadcustomer.customerid)
srchusrname_lst.AddItem (Trim(loadcustomer.forename) & " " & Trim(loadcustomer.surname))
srchusrphone_lst.AddItem (Trim(loadcustomer.phonenumber))
srchusremail_lst.AddItem (Trim(loadcustomer.email))
orderfilechannel = FreeFile 'Sets the file number to an available one
orderspending = 0
ordersmade = 0
orderfilecount = 1
Open orderfilepath For Random As orderfilechannel Len = orderfilelength 'Opens the order file for random actions (read/write)
Do While Not EOF(orderfilechannel)
Get orderfilechannel, orderfilecount, temporder
If temporder.customerid = loadcustomer.customerid Then
ordersmade = ordersmade + 1
If Trim(temporder.orderstatus) = "Pending" Then
orderspending = orderspending + 1
End If
End If
orderfilecount = orderfilecount + 1
Loop
Close orderfilechannel
numberofresults = numberofresults + 1
srchusrorders_lst.AddItem ordersmade
srchusrpending_lst.AddItem orderspending
End If
recordcount = recordcount + 1
Get customerfilechannel, recordcount, loadcustomer
Loop
Close customerfilechannel

results_lb.Caption = (numberofresults & " results found")


If srchusruserid_lst.listcount = 0 Then: srchusrname_lst.AddItem "No Matching Results"
End Sub

Private Sub updatestocklevel_btn_Click() 'updates the stock to an inputted level of an inputted part id in the file
Dim editstockid As Integer 'the stock id number that required edit
Dim addedstock As Integer 'stores whether the amended record has been added back to the file
editstockid = Val(InputBox("Input the Stock ID number of the part to edit", "Edit Stock Level - Input Stock ID"))
addedstock = Val(InputBox("Input the quantity of new stock that has been delivered. This will add stock to the current stock level.", "Edit Stock Level -
Input Delivery Quantity"))
If editstockid <> 0 And addedstock <> 0 Then
Dim recordcount As Integer 'counts the positon of the currently open record
Dim loadstock As stock 'stores the record in ram
Dim stockfilechannel As Integer 'used to specify a system channel number for data transfer
Dim edited As Boolean 'stores whether the amended record has been added back to the file
stockfilechannel = FreeFile 'Sets the file number to an available one
recordcount = 1
Open stockfilepath For Random As stockfilechannel Len = stockfilelength 'Opens the stock file for random actions (read/write)
Do While Not EOF(stockfilechannel)
Get stockfilechannel, recordcount, loadstock
If loadstock.partid = editstockid Then
loadstock.stocklevel = (loadstock.stocklevel + addedstock)
Put stockfilechannel, recordcount, loadstock

130
edited = True
Exit Do
End If
recordcount = recordcount + 1
Loop
If edited = False Then
MsgBox ("Stock level not updated, stock ID not found.")
Else
MsgBox ("Stock level of stock ID " & loadstock.partid & " updated. New stock level is: " & loadstock.stocklevel & " " & loadstock.stockunits)
End If
Close stockfilechannel
Call LoadAllStockTable
End If
End Sub

131
Procedure/Subroutine Details

Procedure/Function/Form Purpose Links to Other


Procedures
addcustomer_btn_Click This procedure loads the add customer form
addpart_btn_Click This procedure loads the add part form
allorders_cal_DateClick This procedure sets loads the order information for the selected date on the
calendar
allorders_cal_GetDayBold Sets the dates on which ordersfall to bold on the calendar
cad_btn_Click sets the global variables for the cad tools and then loads the appropriate
cad tool
calitemid_lst_Click Used to load the relevant order details from the data fileswhen and order is
selected in the calendar view.
calorderid_lst_Click This loads up the parts on the selected order on the calendar view
close_lab_Click ends the program
LoadAllStockTable loads all the stock in the stock file into the table on the stock management
tab
LoadAllCustomersTable loads all the customers in the customer file into the table on the customer
management tab
createorder_btn_Click loads the create order form
discontinuestock_btn_Click removes the inputted stock part from the system
editcustomer_btn_Click querys the user id required and then loads the edit user form
editstock_btn_Click querys the stock id required and then loads the edit stock/part form
Form_Load initialises the program after load
Form_MouseDown handles the movement of the main menu (since it has no title bar)
Form_MouseMove handles the movement of the main menu (since it has no title bar)
Form_MouseUp handles the movement of the main menu (since it has no title bar)
itemid_lst_Click loads the parts for the selected item into the viewer
itemid_lst_DblClick loads the selected items details when selected so the cad viewer is ready to
open
lowstock_btn_Click opens the low stock form
markascomplete_btn_Click marks the inputted order id as complete status in the file
markorderdispatched_btn_Click marks the inputted order id as dispatched status in the file
orderid_lst_Click loads the parts within the order selected in the listbox
paidinfull_btn_Click marks the inputted order id as paid in full status in the file
refresh_btn_Click updates the table view
loadallorders loads all the customers orders into the table ready for viewing

132
searchcustomerorders_btn_Click refines the displayed orders by using an inputted search string
searchorderid_btn_Click refines the displayed orders by using an inputted search string
srchstock_txt_Change refines the displayed stock by using an inputted search string
srchusr_txt_Change causes the filter to be run on the text change event
srchusr refines the displayed customers by using an inputted search string
updatestocklevel_btn_Click updates the stock to an inputted level of an inputted part id in the file

133
List of Variables

Variable Name Type Usage Procedure


frmmove Boolean stores whether the form is being moved

DragX Integer stores the x direction displacement (in pixels)

DragY Integer stores the y direction displacement (in pixels)

partselectedindex Integer stores the id of the currently selected part

loadorder order holds the data for the currently accessd record allorders_cal_DateClick

ordercount Integer stores the number of orders that have been loaded from the file allorders_cal_DateClick

orderfilechannel Integer the channel number the program should use is stored here allorders_cal_DateClick

ordersondate Integer stores the number of orders that have been made on the date allorders_cal_DateClick

loadorder order holds the data for the currently accessd record allorders_cal_GetDayBold

ordercount Integer stores the number of orders that have been loaded from the file allorders_cal_GetDayBold

orderfilechannel Integer the channel number the program should use is stored here allorders_cal_GetDayBold

viewcount Integer stores the number of dates visible on the calendar view allorders_cal_GetDayBold

founddate Boolean stores whether the date has been found or not allorders_cal_GetDayBold

counter Integer this is a multipurpose variable (used to count through calitemid_lst_Click


elements/records)

stockcounter Integer used to count the current stock recor number calitemid_lst_Click

jobid Integer used to gold the the id number of the surrently loaded job calitemid_lst_Click

tempjob jobpartlink used to store the details while opening to a record calitemid_lst_Click

134
jobpartlinkfilechannel Integer used to specify a system channel number for data transfer calitemid_lst_Click

tempstock stock Used to store the stock detials while opening a record calitemid_lst_Click

stockfilechannel Integer used to specify a system channel number for data transfer calitemid_lst_Click

counter Integer used in loops to count the cycle number calorderid_lst_Click

orderid Integer stores the ID number of the order selected calorderid_lst_Click

temporder order holds the information temporarily in ram while orders are loaded calorderid_lst_Click
and compared

orderfilechannel Integer used to specify a system channel number for data transfer calorderid_lst_Click

foundorder Boolean used to determine when the program has found the order calorderid_lst_Click

loadjob job calorderid_lst_Click


jobfilechannel Integer used to specify a system channel number for data transfer calorderid_lst_Click

recordcount Integer counts the position of the record open LoadAllStockTable

loadstock stock stores the record in ram temp. while data is compared for a LoadAllStockTable
match

stockfilechannel Integer used to specify a system channel number for data transfer LoadAllStockTable

recordcount Integer counts the position of the record open LoadAllCustomersTable

loadcustomer customer stores the record in ram temp. while data is compared for a LoadAllCustomersTable
match

customerfilechannel Integer used to specify a system channel number for data transfer LoadAllCustomersTable

editstockid Integer used to store the stock id required for edit discontinuestock_btn_Click

recordcount Integer counts the position of the record open discontinuestock_btn_Click

135
loadstock stock stores the record in ram temp. while data is compared for a discontinuestock_btn_Click
match

stockfilechannel Integer used to specify a system channel number for data transfer discontinuestock_btn_Click

edited Boolean flagged to end the do while discontinuestock_btn_Click

pin Integer stores the id number of the customer intended for edit editcustomer_btn_Click

editstockid Integer stores the id number of the stock part intended for edit editstock_btn_Click

newx, newy the new coordinates of the form during moving Form_MouseMove

newx, newy the new coordinates of the form after moving Form_MouseUp

counter Integer used to count the location of item in list itemid_lst_Click

stockcounter Integer used to count the record position itemid_lst_Click

jobid Integer store the id of the job required for open itemid_lst_Click

tempjob jobpartlink holds the record in ram while a comparison is made itemid_lst_Click

jobpartlinkfilechannel Integer used to specify a system channel number for data transfer itemid_lst_Click

tempstock stock holds the stock in ram while details are retreived itemid_lst_Click

stockfilechannel Integer used to specify a system channel number for data transfer itemid_lst_Click

orderid Integer used to store the id or the order which needs status edit markascomplete_btn_Click

updated Boolean flagged to note whether the changes have been made markascomplete_btn_Click

ordercount Integer counts the record position in the file markascomplete_btn_Click

orderfilechannel Integer used to specify a system channel number for data transfer markascomplete_btn_Click

136
loadorder order stores the record in ram while the record is edited markascomplete_btn_Click

orderid Integer used to store the id or the order which needs status edit markorderdispatched_btn_Click

updated Boolean flagged to note whether the changes have been made markorderdispatched_btn_Click

ordercount Integer counts the record position in the file markorderdispatched_btn_Click

orderfilechannel Integer used to specify a system channel number for data transfer markorderdispatched_btn_Click
loadorder order stores the record in ram while the record is edited markorderdispatched_btn_Click

counter Integer used to count the position of the record orderid_lst_Click

orderid Integer used to store the id or the order which needs status edit orderid_lst_Click

temporder order stores the record in ram while the record is edited orderid_lst_Click

orderfilechannel Integer used to specify a system channel number for data transfer orderid_lst_Click

foundorder Boolean flagged to note whether the changes have been made orderid_lst_Click

loadjob job stores the job record in ram while the record is loaded orderid_lst_Click

jobfilechannel Integer used to specify a system channel number for data transfer orderid_lst_Click

orderid Integer used to store the id or the order which needs status edit paidinfull_btn_Click

updated Boolean flagged to note whether the changes have been made paidinfull_btn_Click

ordercount Integer counts the record position in the file paidinfull_btn_Click

orderfilechannel Integer used to specify a system channel number for data transfer paidinfull_btn_Click

loadorder order stores the record in ram while the record is edited paidinfull_btn_Click

loadorder order stores the record in ram while the record is edited loadallorders

ordercount Integer counts the record position in the file loadallorders

137
customeridfound Boolean flagged to note whether the changes have been made loadallorders

customersearchcount Integer counts the record position in the file loadallorders

customerfilechannel Integer used to specify a system channel number for data transfer loadallorders

orderfilechannel Integer used to specify a system channel number for data transfer loadallorders

loadcustomer customer stores the customer record while a comparison is made loadallorders

loadorder order stores the record in ram while the record is edited searchcustomerorders_btn_Click

ordercount Integer counts the record position in the file searchcustomerorders_btn_Click

customeridfound Boolean flagged to note whether the changes have been made searchcustomerorders_btn_Click

customersearchcount Integer counts the record position in the file searchcustomerorders_btn_Click

customerfilechannel Integer used to specify a system channel number for data transfer searchcustomerorders_btn_Click

orderfilechannel Integer used to specify a system channel number for data transfer searchcustomerorders_btn_Click

loadcustomer customer stores the customer record while a comparison is made searchcustomerorders_btn_Click

searchterm String holds the users input string to compare with records in file searchcustomerorders_btn_Click

loadorder order stores the record in ram while the record is edited searchorderid_btn_Click

ordercount Integer counts the record position in the file searchorderid_btn_Click

customeridfound Boolean flagged to note whether the changes have been made searchorderid_btn_Click

customersearchcount Integer counts the record position in the file searchorderid_btn_Click

customerfilechannel Integer used to specify a system channel number for data transfer searchorderid_btn_Click

orderfilechannel Integer used to specify a system channel number for data transfer searchorderid_btn_Click

138
loadcustomer customer stores the customer record while a comparison is made searchorderid_btn_Click

searchterm String holds the users input string to compare with records in file searchorderid_btn_Click

recordcount Integer coutns the position of the currently opened record in the action srchstock_txt_Change

loadstock stock stores the stock record in ram while a comparison is made srchstock_txt_Change

stockfilechannel Integer used to specify a system channel number for data transfer srchstock_txt_Change

searchword String holds the users input string to compare with records in file srchstock_txt_Change

containsword Integer The string searched srchstock_txt_Change


recordcount Integer stores the position of the currently open record in ram srchusr

loadcustomer customer stores the customer details of the open record in ram srchusr

customerfilechannel Integer used to specify a system channel number for data transfer srchusr

searchablestring String holds the users input string to compare with records in file srchusr

containsword Integer returns >1 for true, >1 for false result srchusr

numberofresults Integer counts the number of matching results srchusr

temporder order stores the order details in ram temporarily srchusr

orderfilechannel Integer used to specify a system channel number for data transfer srchusr

orderfilecount Integer stores the position of the currently open record in ram srchusr

orderspending Integer stores the number of orders that are pending for the user srchusr

ordersmade Integer stores the number of orders that have been made by the user srchusr

editstockid Integer the stock id number that required edit updatestocklevel_btn_Click

139
addedstock Integer stores whether the amended record has been added back to the updatestocklevel_btn_Click
file

recordcount Integer counts the positon of the currently open record updatestocklevel_btn_Click

loadstock stock stores the record in ram updatestocklevel_btn_Click

stockfilechannel Integer used to specify a system channel number for data transfer updatestocklevel_btn_Click

edited Boolean stores whether the amended record has been added back to the updatestocklevel_btn_Click
file

140
Test Strategy
The software solution I intend to create will require testing from the offset. I will carry
out corrective software testing as I develop the solution. This will ensure that each and
every section functions correctly. It will also ensure that problems limit their impact;
fixing all problems at the very end would be difficult as it would be hard to trace its
origin. Using an ongoing testing approach will enable me to troubleshoot and diagnose
the errors and amend them from the onset. To do this I will use pre-prepared data, input
it into the software and contrast the result with the expected result.

The testing will involve many aspects. Firstly I will test the navigation between forms and
any basic automatic functions, such as creating data files on first load. The navigation
test will be the most basic and simply ensure the user is able to open each form, close it
and navigate back up the programs tree structure to the main menu.

As each form becomes complete in code, I will test it in whole, to ensure all the
functions on the form work together and errors are not inflicted by other functions. For
the same reason I will also test the final software solution as a whole complete package.
This will be done and the majority of these test runs will form the body of thee test runs
document.

Before any testing begins I will produce a test plans document. This will contain the form
name, reason for test, test data and most importantly, the expected result/response
from the software. This document will ensure an even distribution of typical data,
extreme data and erroneous data will be used during the tests.

The final step in testing will be user acceptance testing. This is where the end user looks
at the solution that has been created, uses it, and can thereby conclude an opinion on
whether the software meets the requirements outlined during the original consultation.

141
Test Plans
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

Navigation/Basic Function Tests

The splash screen opens and


To ensure the load screen The load screen should be
is displayed for around 3
initialises the software Run the program. No input displayed for 2-3 seconds and
1 loadscreen_frm Typical seconds. The main menu then No action required
correctly, loading the main data required. then the main menu form
loads and the splash screen
menu. should automatically load.
unloads.

Run the program. Check the The program should have


The five data files are present
program directory for five created five files in the program
in the directory.
data files. (.DAT) directory.
Tests that the load screen
customerfile.dat customerfile.dat customerfile.dat
2 loadscreen_frm creates the data files for the Typical No action required
programs use. jobfile.dat jobfile.dat jobfile.dat
orderfile.dat orderfile.dat orderfile.dat
stockfile.dat stockfile.dat stockfile.dat
jobpartlinkfile.dat jobpartlinkfile.dat jobpartlinkfile.dat

On the main menu form


The respective tab should be The tab clicked is displayed.
To ensure the menu displays click the tabs from left to
3 mainmenu_frm Typical displayed when the tab is The relevant tab content No action required
the different tabs correctly. right one by one. No input
clicked. appears on click.
data required.

142
Test Plans
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

On the main menu click the


To test the add customer The customer form should be The customer form loads
4 addcustomer_frm add customer button on the Typical No action required
form opens correctly displayed without any errors. without any errors
customer management tab.

Open the create order form Modify the code so that the
To ensure the correct cad tool
and add an item. Select the The door cad design tool Window CAD design tool door tool opens when a
5 cadtooldoor_frm loads when the user adds a Typical
door 'Type' option and input should open without any errors. opens. door is intended to be
part to an order
quantity 1. Click add item. added to the order.

To test that the customer The customer form should close


The window closes and no
form can be closed correctly Click the cancel button on and the main menu should be
6 addcustomer_frm Typical record is created. The main No action required
without adding a customer the add customer form. displayed. No errors should
menu is displayed.
(test cancel button). occur.

143
Test Plans
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

Output Tests

The calendar should have dates


in bold type to indicate an order Check the code's if
To check the pending orders Click the Orders Outlook
is due on that date. When statement. If not
mainmenu_frm (Orders are loaded onto the calendar tab. Click on a date that has No dates appear bold on the
7 Typical clicked, the bold date should implemented, add in if
outlook tab) view and displayed when Bold font type. No input calendar.
load the relevant order details statement so that dates
clicked. data required.
into the list boxes on the right with orders appear bold.
hand side of the form.

To ensure that all the All the customers in the


mainmenu_frm Click on the customer All customers in the database
customers within the system system are loaded and their
8 (Customer management tab. No input Typical should be displayed in the all No action required
Management tab)
are loaded and displayed details are displayed in the
data required. customers table.
correctly. adjacent columns

To ensure that all the stock


Click on the stock All stock in the database should All stock in the database is
items within the system are
9 mainmenu_frm management tab. No input Typical be displayed in the all stock correctly displayed in the all No action required
loaded and displayed
data required. table. stock table.
correctly.

The low stock form should show


Tests that all the low stock Click the show low stock All stock below the stock
and any stock items with low
10 lowstock_frm (any stock with level below its button on the main menu Typical reorder level is displayed in No action required
stock should be displayed in the
reorder level) is displayed. (stock tab). the window.
list box table.

144
Test Plans
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

The Suggested Re-Order


Checks that the system The suggested reorder Modify Code to show the
quantity should be greater
11 lowstock_frm predicts stock reorder levels Open the low stock form. Erroneous quantity is zero for all low suggested-order quantity in
than (reorder level + number
to an accurate degree. stock. the column.
need for outstanding orders.)

To test that all orders load


mainmenu_frm (Order All orders should automatically All the orders load correctly
12 into the order viewer all Open the order viewer tab. Typical No action required
Viewer) load in the all orders table. without errors
orders table.

The information within the The information in the order


order details section should be details section outputs the
as follows: following data:
Tests that the respective
mainmenu_frm (Order order details load into the Click on the order number Order Id: 1003 Order Id: 1003
13 Typical No action required
Viewer) order information details 1003 in the all orders frame. Order due: 21/02/2015 Order due: 21/02/2015
frame. order placed on: 24/01/2015 order placed on: 24/01/2015
order status: pending order status: pending
paid In full: No paid In full: No
Delivery Required: Yes Delivery Required: Yes

Tests that the items on a The items on order table should There are two items In the
mainmenu_frm (Order Click on the order number
14 specific order load into the Typical display two item ID's in the Item item id column, 1003 and No action required
Viewer) 1002 in the all orders frame.
information table. id column - 1003 and 1004 1004.

145
Test Plans
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

The stock ID numbers 1001,


The stock ID numbers 1001, 1005, 1012 and 1014 are
Click the item ID 1004 in the
To test that the parts needed 1005, 1012 and 1014 should be listed in the stock ID column.
mainmenu_frm (Order items on order table. (After
15 for each item load into the Typical listed in the stock ID column of Their relevant part No action required
Viewer) selecting order number
parts within item on order. the parts within item on order descriptions and quantity's
1003).
table. have also loaded from the
data files.

The order matching ID should


Click the search orders by
To test the search order by be displayed in the all orders There is one entry in the
mainmenu_frm (Order customer id button on the
16 customer id function works Typical table. I.E. the table will contain orders table with order ID No action required
Viewer) order viewer form. Input the
correctly one entry with the order ID 1004.
order ID 1004 and click OK.
1004.

A dialog should appear


Click the search orders by
To test the search order by informing no results are A dialog appears stating no
customer id button on the
mainmenu_frm (Order customer id function available. When dismissed, all orders could be found, the
17 order viewer form. Input the Erroneous No action required
Viewer) responds to invalid inputs orders should load into the all result is the table containing
order ID 9901AB and click
correctly orders table (search filters all orders in the system.
OK.
removed)

Test that the search customer Two customers, User IDs 1001 The table update showing the
mainmenu_frm Type 0161 into the filter
filter operates correctly and and 1003 should be the result in two customer ids 1001 and
18 (Customer term text box on the Typical No action required
Management tab)
delivers a result with valid the table (both phone number 1003 are displayed in the
customer management tab.
input. begin with 0161) table.

146
Test Plans
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

Test that the search customer The table should update and
mainmenu_frm Type -3 into the filter term The table states the message
filter operates correctly and read the message "No
19 (Customer text box on the customer Erroneous "No customers match the No action required
Management tab)
responds to invalid data customers match the search
management tab. search criteria".
correctly. criteria".

Only items containing a


The table updates to display
Tests whether the text filter description or colour property
mainmenu_frm (Stock Input the data: white into the details of the stock id
20 on the Stock management tab Typical of white should be displayed No action required
Management Tab) the filter box. 1001 and 1010 which are both
works correctly. in the results table. I.E. stock id
colour white.
1001 and 1010

An output window will open.


The page will display a window
Go to the order viewer tab A window is drawn with 4
approximately 4 times as wide
To test that the CAD design of and click order id 1004. window sections. The two
mainmenu_frm (Order as high. There should be 4
21 a window can successfully be Then select the item id Typical centre windows are openers No action required
Viewer) window sections. The two
retrieved from the system. 1007. Click the CAD Design and have handles on the right
centre windows should be
view button. hand side.
openers and have handles on
the right hand side.

147
Test Plans
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

Input Tests

The form should close and


return to main menu. The
The customer was not saved
Input the data below then click following customer details
as a business customer. All
add customer. should be visible in the all
other details saved correctly.
customers table (customer
management tab)

Title: Mr Title: Mr Title: Mr


Forename: Frank Forename: Frank Forename: Frank
Surname: Johnson Surname: Johnson Surname: Johnson Check code and modify to
To test whether customers
Address Line 1: Unit 89j Address Line 1: Unit 89j Address Line 1: Unit 89j ensure business property of
22 addcustomer_frm are saved into the system Typical
Address Line 2: Bury Industrial Address Line 2: Bury Industrial record is set and saved
correctly. Address Line 2: Bury Industrial Park
Park Park correctly. Retest
Address Line 3: Bury Address Line 3: Bury Address Line 3: Bury
City: Manchester City: Manchester City: Manchester
Telephone Number:
Telephone Number: 01617896653 Telephone Number: 01617896653
01617896653
Email Address: Email Address: Email Address:
fjohnson@Mywindows.uk fjohnson@Mywindows.uk fjohnson@Mywindows.uk
Business Customer: Unticked
Business Customer: Tick (True) Business Customer: Ticked (True)
(False)

Business Name: My Windows Business Name: My Windows Business Name: My Windows

148
Test Plans
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

Input the data below then click


add customer.
Title: Mrs

Forename: LEAVE BLANK

Surname: Millett
Address Line 1: Unit 89j
A dialog appears reading "A
Address Line 2: Huddersfield customer cannot be created
To ensure that customers Industrial Park A dialog should be displayed that has no forename". The
23 addcustomer_frm with no forename can not be Erroneous reading "A customer cannot be add customer form then No action required
saved into the database. Address Line 3: Huddersfield created that has no forename". becomes available for input
again. No details for the
City: Manchester
invalid customer were saved.
Telephone Number:
07899847589
Email Address:
lmillett@huddwin.co.uk

Business Customer: Tick (True)

Business Name: Huddersfield


Windows

Make a note of the current


stock level of part 1007. The new stock level equals
mainmenu_frm The new stock level of the part
Tests that the update stock Click the update stock level 320 therefore the information
24 (Customer Typical 1007 should = (old stock level No action required
Management tab)
level function works. button. Enter the part ID: has been updated
(120) + 200)
1007 and the additional successfully.
stock units: 200.

149
Test Plans
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

Data for the customer should


Click the edit customer
mainmenu_frm load from data file record into
Tests that the edit customer button on main menu. Enter The data in forename box
25 (Customer Typical the textboxes ready for edit. No action required
Management tab)
form loads the correct record. the pin 1003 when reads Mitch.
The data in the forename box
prompted.
should be Mitch.

With customer data pin


The other data is not
Ensures the edit customer 1003 ready for edit, change The new email address should
The email address is displayed conserved when the edit
form writes data back to file, the email address to be displayed in the customer
26 editcustomer_frm Typical however all other details are occurs. Modify the code so
modifying data where mitchwindowman@ table, with all other data
wiped from the record. that the un-edited fields
necessary. yahoo.co.uk then click conserved.
data is preserved. Retest
save.

To test whether the Click the Discontinue stock An error message should An error message pops up
mainmenu_frm (Stock
27 Discontinue Stock feature button. Input the Stock ID Erroneous indicate the stock ID could not indicating that the ID could No action required
Management Tab)
functions correctly. 952 when prompted. be found. not be found.

To test whether the Click the Discontinue stock The intended stock item (ID The stock parts table updates
mainmenu_frm (Stock
28 Discontinue Stock feature button. Input the Stock ID Typical 1009 should be removed from and the stock ID 1009 in no No action required
Management Tab)
functions correctly. 1009. the all stock table) longer in the table.

Click the Mark order as The order status of the order


To test that the order can be The order status of order ID
mainmenu_frm (Order dispatched button. Input 1002 should change to
29 marked as dispatched in the Typical 1002 is marked as dispatched. No action required
Viewer tab) the Order ID 1002 and press 'dispatched'. This should be
system. No errors occurred.
ok. reflected in the all orders table.

To test that the mark order as The code needs to be


Click mark order dispatched The system should respond
mainmenu_frm (Order dispatched functions The program crashes and no modified so the program
30 button and input the Erroneous with a message box reading "No
Viewer tab) responds correctly with message box occurs. handles the invalid data
erroneous data 0010. such order ID exists."
invalid input. without error. Retest.

150
Test Plans
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

The program changes the


The system should allow staff Click the mark order as The system should change the
mainmenu_frm (Order order status of the order 1004
31 to mark an order as complete. complete. Input the order ID Typical order status to Complete in the No action required
Viewer tab) to complete. This is reflected
This will test that function. 1004. all orders table.
in the all orders table.

The selected customers details


Click the customer ID
To test that the select should load into the details The details view shows the
number 1002 in the select
32 createorder_frm customer function of the Typical view. This should forename for customer forename is John. No action required
customer listobx on the
create order works correctly. this customer ID should read: No errors occur.
create order form.
John

Select the date 15/02/2015


This will ensure the calendar The text above the calendar The text above the calendar
on the calendar which is in
33 createorder_frm on the create order interprets Typical should update and now read: reads 15/02/2015 and no No action required
the top left corner of the
the correct date input. 15/02/2015. errors occurred.
create order form.

Create a new window part.


On the CAD Window design
form input: The canvas shows a window
The canvas should contain a
CAD Tool allows a window to that is wider than it is tall, has
Width: 2.2 window drawing that accurately
be correctly drawn given the two vertical bars and three
34 cadtoolwindow_frm Height: 1.5 Typical depicts the given inputs. (The No action required
desired dimensions of the panes of glass. It also has one
Vertical Bars: 2 window should have three
window. Vertical Openers: 1 opener with a handle on the
panes of glass, one handle etc.)
Opener Position: Cylcle left hand side.
through to centre
Handle Side: Left

151
Test Plans
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

The window CAD tool form


Using the above window should close. The create order The table on the create order
Test that the specification of a
specification as the input, form should have a new page updates and has a new
35 cadtoolwindow_frm drawn window is passed back Typical No action required
click the save button in the window item in its items list. entry that details the correct
to the create order form.
options frame. The dimesions should be 2.2 dimensions of the window.
wide and 1.5 high.

Create a new window part.


This test ensures the program On the CAD Window design
The program should use the
can use the cad data to form input dimensions
CAD data and inform the user The suggested quantity is
accurately suggest the length 2.2(w), 1(h). 2 vertical bars.
36 createorder_frm Typical of the required length of PVC. correct. (2.2 + 2.2 + 1 + 1 + 1 + No action required
of PVC required to make a 2.2 Click save. Select the item id
The quantity should read 8.4 1) = 8.4 (metres).
by 1 window with 2 vertical in the table on the create
(meters).
bars. order form. Then click stock
ID 1001 (White PVC)

The selected stock should be


Tests that the user can add Click the item ID 100x in the The required part has beed
added to the parts for each
stock to the order and the all items table. Click the added to the parts list and the
37 createorder_frm Typical item list. The Item ID for the No action required
associated ordered item ID is stock ID 1006 then click the item ID 100X has been added
selected item should be in the
used. add button. to the Item ID column.
adjacent Item ID column.

Create an order which


This test will make sure that The total cost for the parts
requires 5 handles, 20m of The cost is totaled up
the create order feature adds should be: This should be
38 createorder_frm PVC and 5 square metres of Typical correctly (xx). The text is No action required
up the total cost of An orders displayed next to the total parts
single glazing. Add these updated and no errors occur.
constituent parts. cost label.
parts to the parts list.

152
Test Plans
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

Create an order with parts


To test that the grand total of The total cost for the order The total cost text updates
cost 734.50, input labour
39 createorder_frm the order is correctly Typical (displayed in the finalize order automatically. The grand total No action required
cost of 600, additional
calculated. frame) should equal 1581.4 of the order is 1581.4
charges 28.

Using the above window


specification as the input, in
The order should be saved into The order is created (it is
addition to the above costs
the system. There should be no shown in the order viewer)
To test that a typical order to create the order for user
errors and a dialog should sucsessuflly. No errors
40 createorder_frm can be created within the ID 1002 due on 10/02/2015. Typical No action required
inform the order has been occurred after clicking save
system. Delivery is not required and
created with the main menu and the dialog confirmed the
the order has beed paid in
form loading up afterwards. order was made sucsessfully.
full. Click confirm and
process order.

153
Test Plans
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

Validation Tests

The order is created (it is


Create a new order with just The system should allow the shown in the order viewer)
To ensure an order with one
one item. Fill all other fields order to be created and should sucsessuflly. No errors
42 createorder_frm item can be created in the Extreme No action required
with typical data. Click save the details into the occurred after clicking save
system.
confim and process order. database. and the dialog confirmed the
order was made.

A dialog informs the user the


Create a new order with no The system should inform the
To ensure that an order with order needs a minimum of
items. Fill all other fields user that an order requires at
43 createorder_frm no parts cannot be created in Erroneous one part. The create order No action required
with typical data. Click least one part. The order should
the system form stays open for edit and
confim and process order. not save.
the order was not yet created.

Input typical customer The system should inform the


To check the length of a A message dialog informs the
details into the form. Use user that the customer must
44 addcustomer_frm customers phone number Erroneous user that the phone number No action required
the phone number have a vaild contact phone
cannot be 10 digits long. must be 11 digits long.
1097598478. Click Save. number.

154
Test Plans
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

Input typical customer Typical/ The system should accept the The system accepts the phone
To check the length of a
details into the form. Use Extreme. (Phone phone number as valid. It number as valid. It saves the
45 addcustomer_frm customers phone number No action required
the phone number numbers must should save the customer into customer into the system
cannot be 11 digits long.
10975984781. Click Save. be 11 digits) the system without any errors. without any errors.

The system produces an error


The system should inform the
box reading "Minimum height
To check that a window Input window with width user "Minimum height required
required is 0.2m"e minimum
46 cadtoolwindow_frm cannot be ordered with a 0.1, height 0.8, no vartical Erroneous is 0.2m" and modify the value in No action required
height required and modifies
height of less that 0.2 metres. bars or openers. the height box to 0.2 to avoid
the value in the height box to
drawing errors.
0.2.

The system should inform the


The system informs the user
user with a message box - "The
To check that a door with less with the message box - "The
Input door with width 0.8, minimum width required is
47 cadtooldoor_frm that 0.8 metres width cannot Erroneous minimum width required is No action required
height 1.2, style 3. 0.8m" and modify the value in
be ordered. 0.8m" and modifies the value
the width box to 0.8 to avoid
in the width box to 0.8.
drawing errors.

To check that a door with The system should auto redraw The system auto redraws the
Input door with width 0.79,
48 cadtooldoor_frm width 0.8 m (minimum) can Extreme the cad design and no errors cad design and no errors have No action required
height 1.2, style 3.
be created. should occur. occured.

155
Test Plans
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

The system should reject the The system rejects the order
Create a typical order but
To ensure an order cannot be order and display an error and displays an error message
do not enter any customer
49 createorder_frm created without a customer Erroneous message informing that informing that customer No action required
details. Attempt to save the
selected. customer details must be details have not selected and
order
selected. are required.

Click the update stock


A dialog appears informing
To test that the update stock button on the stock The system should inform the
the user that the stock
50 mainmenu_frm function responds to invalid management tab. Inpur Erroneous user that an invalid stock No action required
levelwas not changed and
stock level inputs correctly. stock ID 1009. Input the update level has been entered.
invalid input was detectd.
additional stock as /@.

156
Test Plans
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

Retests
51 (Restest of 5)

Open the create order form


To ensure the correct cad tool
and add an item. Select the The door cad design tool Door CAD design tool opens
cadtooldoor_frm loads when the user adds a Typical No futher action required.
door 'Type' option and input should open without any errors. without any errors.
part to an order
quantity 1. Click add item.

The calendar should have dates


52 (Restest of 7)

in bold type to indicate an order The dates which have orders


To check the pending orders Click the Orders Outlook
is due on that date. When due are shown in bold.
mainmenu_frm (Orders are loaded onto the calendar tab. Click on a date that has
Typical clicked, the bold date should Clicking them now shows the No futher action required.
outlook tab) view and displayed when Bold font type. No input
load the relevant order details order details in the relevant
clicked. data required.
into the list boxes on the right locations on the form.
hand side of the form.
53 (Restest of 11)

The Suggested Re-Order


Checks that the system The suggested reorder
quantity should be greater
lowstock_frm predicts stock reorder levels Open the low stock form. Typical quantity a sensible value for No futher action required.
than (reorder level + number
to an accurate degree. all stock.
need for outstanding orders.)

157
Test Plans
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

The form should close and


The customer now saves as a
return to main menu. The
business customer. All other
Input the data below then click following customer details
details are saved correctly.
add customer. should be visible in the all
The new entry is visible in the
customers table (customer
all customers table.
management tab)
Title: Mr Title: Mr Title: Mr
Forename: Frank Forename: Frank Forename: Frank
54 (Restest of 15)

Surname: Johnson Surname: Johnson Surname: Johnson


To test whether customers Address Line 1: Unit 89j Address Line 1: Unit 89j Address Line 1: Unit 89j
addcustomer_frm are saved into the system Address Line 2: Bury Industrial Typical Address Line 2: Bury Industrial No futher action required.
Address Line 2: Bury Industrial Park
correctly. Park Park
Address Line 3: Bury Address Line 3: Bury Address Line 3: Bury
City: Manchester City: Manchester City: Manchester
Telephone Number:
Telephone Number: 01617896653 Telephone Number: 01617896653
01617896653
Email Address: Email Address: Email Address:
fjohnson@Mywindows.uk fjohnson@Mywindows.uk fjohnson@Mywindows.uk

Business Customer: Tick (True) Business Customer: Ticked (True) Business Customer: Ticked (True)

Business Name: My Windows Business Name: My Windows Business Name: My Windows

With customer data pin


55(Restest of 18)

Ensures the edit customer 1003 ready for edit, change The new email address should
The new email address is
form writes data back to file, the email address to be displayed in the customer
editcustomer_frm Typical added and all other details are No futher action required.
modifying data where mitchwindowman@ table, with all other data
modified.
necessary. yahoo.co.uk then click conserved.
save.
56 (Restest of

To test that the mark order as


Click mark order dispatched The system should respond The program displays a
mainmenu_frm (Order dispatched functions
30)

button and input the Erroneous with a message box reading message box reading "No No futher action required.
Viewer tab) responds correctly with
erroneous data 0010. "No such order ID exists". such order ID exists".
invalid input.

158
Click
Finish Wait
Test

Navigation/Basic Function Tests


Test Description
NO.

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)
The s plas h s creen opens
The load s creen s hould be
To ens ure the load and is dis played for
dis played for 2-3 s econds
s creen initialis es the Run the program. No around 3 s econds . The
1 loadscreen_frm Typical and then the main menu No action required
s oftware correctly, input data required. main menu then loads
form s hould automatically
loading the main menu. and the s plas h s creen
load.
unloads .

Clicked and
the program
run.

Click

The splash screen appeared.

Wait The main menu loaded correctly.


Finish
2-3 Seconds
Test

159
Navigation/Basic Function Tests
Test Description
NO.

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)
Run the progra m. Check
The progra m s houl d ha ve
the progra m di rectory The fi ve da ta fi l es a re
crea ted fi ve fi l es i n the
for fi ve da ta fi l es . pres ent i n the di rectory.
progra m di rectory.
Tes ts tha t the l oa d (.DAT)
s creen crea tes the da ta cus tomerfi l e.da t cus tomerfi l e.da t cus tomerfi l e.da t
2 loadscreen_frm Typi ca l no a cti on requi red
fi l es for the progra ms jobfi l e.da t jobfi l e.da t jobfi l e.da t
us e.
orderfi l e.da t orderfi l e.da t orderfi l e.da t
s tockfi l e.da t s tockfi l e.da t s tockfi l e.da t
jobpa rtl i nkfi l e.da t jobpa rtl i nkfi l e.da t jobpa rtl i nkfi l e.da t

Clicked and
the program
Click run.

The data files have been created in


the program directory. Finish
Test

160
Navigation/Basic Function Tests
Test Description
NO.

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

On the main menu form The tab clicked is


To ens ure the menu The res pective tab s hould
click the tabs from left dis played. The relevant
3 mainmenu_frm dis plays the different Typical be dis played when the tab No action required
to right one by one. No tab content appears on
tabs correctly. is clicked.
input data required. click.

When the first tab was clicked, the


Click respective tab loaded instantly.

When the second tab was clicked,


Click the respective tab loaded instantly.

When the third tab was clicked, the


Click respective tab loaded instantly.

When the fourth tab was clicked,


the respective tab loaded instantly.
Click
Finish
Test

161
Navigation/Basic Function Tests
Test Description
NO.

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

On the main menu click


The cus tomer form s hould
To tes t the add cus tomer the add cus tomer The cus tomer form loads
4 addcustomer_frm Typical be dis played without any No action required
form opens correctly button on the cus tomer without any errors
errors .
management tab.

I clicked the
Click customer
management
tab.

Click
I clicked on the add customer
button in the customer tools
frame.

Finish
The Add customer form loaded correctly. Test

162
Navigation/Basic Function Tests
Test Description
NO.

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

Open the create order


form and add an i tem. Modi fy the code s o that the
To ens ure the correct cad The door cad des i gn tool
Sel ect the door 'Type' Wi ndow CAD des i gn tool door tool opens when a
5 cadtooldoor_frm tool l oads when the us er Normal s houl d open wi thout any
opti on and i nput opens . door i s i ntended to be
adds a part to an order errors .
quanti ty 5. Cl i ck add added to the order.
i tem.

Click
The wrong CAD tool form loaded. The
intended form was CAD Door designer

I selected the door option


from the dropdown and then
inputted the quantity 5. I then
clicked add and design.

Modify and
re-test

163
Navigation/Basic Function Tests
Test Description
NO.

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

To tes t that the cus tomer


The cus tomer form s hould
form can be clos ed Click the cancel button The window clos es and
clos e and the main menu
6 addcustomer_frm correctly without adding on the add cus tomer Typical no record is created. The No action required
s hould be dis played. No
a cus tomer (tes t cancel form. main menu is dis played.
errors s hould occur.
button).

I clicked the cancel


button on the add Finish
customer form. Test

When the cancel button was clicked,


Click
the main menu loads and the add
customer form closes.

164
Output Tests
Test Description
NO.

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)
The ca l enda r s houl d ha ve
da tes i n bol d type to
i ndi ca te a n order i s due Check the code's i f
To check the pendi ng Cl i ck the Orders Outlook
on tha t da te. When s ta tement. If not
mainmenu_frm orders a re l oa ded onto tab. Cl i ck on a da te tha t No da tes a ppea r bol d on
7 Typi ca l cl i cked, the bol d da te i mpl emented, a dd i n i f
(Orders outlook tab) the ca l enda r vi ew a nd ha s Bold font type. No the ca l enda r.
s houl d l oa d the rel eva nt s ta tement s o tha t da tes
di s pl a yed when cl i cked. i nput da ta requi red.
order deta i l s i nto the l i s t wi th orders a ppea r bol d.
boxes on the ri ght ha nd
s i de of the form.

Click

Upon clicking the Orders Outlook


tab the pending orders are
displayed. It is shown there is an order due on the
30/01/2015, however this date is not bold
on the calendar.

- None of the dates which orders fall on are in bold.


Modify and
re-test

165
Output Tests
Test Description
NO.

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)
All the cus tomers i n the
To ens ure that al l the All cus tomers i n the
mainmenu_frm Cl i ck on the customer s ys tem are l oaded and
cus tomers wi thi n the databas e s houl d be
8 (Customer management tab. No Typi cal thei r detai l s are No acti on requi red
s ys tem are l oaded and di s pl ayed i n the all
Management tab) i nput data requi red. di s pl ayed i n the adjacent
di s pl ayed correctl y. customers tabl e.
coul mns

Click

All of the four customers that had been


added so far into the system loaded.
Finish
All customers load so the test is Test
complete successfully.

166
Output Tests
Test Description
NO.

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

To ens ure that all the


Click on the stock All s tock in the databas e All s tock in the databas e
s tock items within the
9 mainmenu_frm management tab. No Typical s hould be dis played in the is correctly dis played in No action required
s ys tem are loaded and
input data required. all stock table. the all stock table.
dis played correctly.

Click

Finish
Test
All stock loads so the test is
All of the stock that had been added so complete successfully.
far into the system loaded.

167
Output Tests
Test Description
NO.

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)
The l ow s tock form s houl d
Tes ts that al l the l ow
Cl i ck the s how l ow s how and any s tock i tems All s tock bel ow the s tock
s tock (any s tock wi th
10 lowstock_frm s tock button on the Typi cal wi th l ow s tock s houl d be reorder l evel i s No acti on requi red
l evel bel ow i ts reorder
mai n menu (s tock tab). di s pl ayed i n the l i s t box di s pl ayed i n the wi ndow.
l evel ) i s di s pl ayed.
tabl e.

I clicked the Show


low stock button on
the stock
management tab.

Click The current stock level is less than


the re-order level for the items in
the list. This shows that the program
correctly loaded the items that had
low stock. Finish
Test

168
Output Tests
Test Description
NO.

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

The Sugges ted Re-Order


Checks that the s ys tem
quantity s hould be The s ugges tedd reorder Modify Code to s how the
predicts s tock reorder Open the low s tock
11 lowstock_frm Typical greater than (reorder level quantity is zero for all s ugges tedre-order quantity
levels to an accurate form.
+ number need for low s tock. in the column.
degree.
outs tanding orders .)

All items have a suggested re-order quantity


of Zero, this is incorrect as the reorder
quantity should at least exceed the re-order
level.

Modify and
re-test

169
Output Tests
Test Description
NO.

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

To tes t that all orders All orders s hould


mainmenu_frm Open the order viewer All the orders load
12 load into the order Typical automatically load in the No action required
(Order Viewer) tab. correctly withou errors
viewer all orders table. all orders table.

Click

All the orders load into the table


The test has been successful as all when the Order viewer is clicked.
orders are loaded into the table
with their respective details
loading into the rows.
Finish
Test

170
Output Tests
Test Description
NO.

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)
The i nforma ti on i n the
The i nforma ti on wi thi n the
order deta i l s s ecti on
order deta i l s s ecti on
outputs the fol l owi ng
s houl d be a s fol l ows :
da ta :
Tes ts tha t the res pecti ve
Cl i ck on the order Order Id: 1003 Order Id: 1003
mainmenu_frm order deta i l s l oa d i nto
13 number 1003 i n the a l l Norma l No a cti on requi red
(Order Viewer) the order i nforma ti on Order due: 21/02/2015 Order due: 21/02/2015
orders fra me.
deta i l s fra me. order placed on: 24/01/2015 order placed on: 24/01/2015
order s ta tus : pendi ng order s ta tus : pendi ng
pa i d In ful l : No pa i d In ful l : No
Del i very Requi red: Yes Del i very Requi red: Yes

I clicked on pin
number 1003.
Click

When clicked
Here the order the order
details are blank as details
no order has expected order
previously been details loaded
selected. into the order Finish
details frame. Test

171
Output Tests
Test Description
NO.

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

The items on order table


Tes ts that the items on a Click on the order There are two items In
mainmenu_frm s hould dis play two item
14 s pecific order load into number 1002 in the all Typical the item id column, 1003 No action required
(Order Viewer) ID's iin the Item id column -
the information table. orders frame. nd 1004.
1003 and 1004

Before selecting an order After clicking the order ID 1002, the


id the items on order item IDs 1003 and 1004 load into
table was empty. the items on order table.

Click
I clicked the order ID 1002, as Finish
specified in the test plan.
Test

172
Output Tests
Test Description
NO.

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)
The s tock ID numbers
1001, 1005, 1012 and 1014
The s tock ID numbers
To tes t that the parts Cl i ck the i tem ID 1004 i n are l i s ted i n the stock ID
1001, 1005, 1012 and 1014
mainmenu_frm needed for each i tem the i tems on order col umn. Thei r rel evant
15 Typi cal s houl d be l i s ted i n the No acti on requi red
(Order Viewer) l oad i nto the parts tabl e. (After s el ecti ng part des cri pti ons and
stock ID col umn of the parts
wi thi n i tem on order. order number 1003). quanti ty's have al s o
within item on order tabl e.
l oaded from the data
fi l es .

Before selecting an item id After clicking the order ID 1004, the


the parts within items on stock IDs 1001, 1005, 1012 and
order table was empty. 1014 are listed in the stock ID
column.

Click Finish
I clicked the item ID 1004, as Test
specified in the test plan.

173
Output Tests
Test Description
NO.

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)
The order matching ID
Click the s earch orders
s hould be dis played in the
To tes t the s earch order by cus tomer id button There is one entry in the
mainmenu_frm all orders table. I.E. the
16 by cus tomer id function on the order viewer Normal orders table with order No action required
(Order Viewer) table will contail one
works correctly form. Input the order ID ID 1004.
entry with the order ID
1004 and click OK.
1004.

The orders found for this customer


are displayed in the all orders table.

Click
Click

Finish
Test

I
Click

Input
Input pin 1004

174
Output Tests
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

To ens ure that all the


Click on the stock All s tock in the databas e All s tock in the databas e
s tock items within the
9 mainmenu_frm management tab. No Typical s hould be dis played in the is correctly dis played in No action required
s ys tem are loaded and
input data required. all stock table. the all stock table.
dis played correctly.

Click

All the stock from within the file loads into the stock table.
Finish
Test

175
Output Tests
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

Two cus tomers , Us er IDs The table update


Tes t that the s earch Type 0161 into the filter
mainmenu_frm 1001 and 1003 s hould be s howing the two
cus tomer filter operates term text box on the
18 (Customer Typical the res ult in the table cus tomer ids 1001 and No action required
correctly and delivers a cus tomer management
Management tab) (both phone number begin 1003 are dis played in the
res ult with valid input. tab.
with 0161) table.

I Input

Finish
The orders which match the filter Test
are displayed in the table. (Phone
numbers start 0161)

176
Output Tests
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

Tes t that the s earch Type -3 i nto the fi l ter The tabl e s houl d update
mainmenu_frm The tabl e s tates that
cus tomer fi l ter operates term text box on the and read a mes s age to
19 (Customer Erroneous there are 'no matchi ng No acti on requi red
correctl y and res ponds to cus tomer management i nform that no cus tomers
Management tab) res ul ts ' i n the s ys tem.
i nval i d data correctl y. tab. match the s earch cri teri a.

I Input
Input text -3

The table informs that no matching results were found and


also indicates this below the text box.
Finish
Test

177
Output Tests
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

Onl y i tems contai ni ng a


The tabl e updates to
Tes ts whether the text des cri pti on or col our
mainmenu_frm di s pl ay the detai l s of the
fi l ter on the Stock Input the data: whi te property of whi te s houl d
20 (Stock Management Typi cal s tock i d 1001 and 1010 No acti on requi red
management tab works i nto the fi l ter box. be di s pl ayed i n the res ul ts
Tab) whi ch are both col our
correctl y. tabl e. I.E. s tock i d 1001 and
whi te.
1010

I Input
Input text white

The table shows the two results that have been found in the
columns. This happened automatically when the input was
Finish
keyed in.
Test

178
Output Tests
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

An output wi ndow wi l l
open. The pa ge wi l l
di s pl a y a wi ndow A wi ndow i s dra wn wi th 4
Go to the order vi ewer
To tes t tha t the CAD a pproxi ma tel y 4 ti mes a s wi ndow s ecti ons . The
ta b a nd cl i ck order i d
mainmenu_frm des i gn of a wi ndow ca n wi de a s hi gh. There two centre wi ndows a re
21 1004. Then s el ect the Typi ca l No a cti on requi red
(Order Viewer) s ucces s ful l y be retri eved s houl d be 4 wi ndow openers a nd ha ve
i tem i d 1007. Cl i ck the
from the s ys tem. s ecti ons . The two centre ha ndl es on the ri ght
CAD Design view button.
wi ndows s houl d be ha nd s i de.
openers a nd ha ve ha ndl es
on the ri ght ha nd s i de.

Click
Click
Click Order ID 1004, Then
item ID 1007 in the tables.

Click
Clicking the CAD design View button loaded the
design on the window drawing onto a popup
dialog form. Finish
Test

179
Input Tests
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

The form s houl d cl os e a nd


return to ma i n menu. The The cus tomer wa s not
Input the data below then fol l owi ng cus tomer detai l s s a ved a s a bus i nes s
click add customer. s houl d be vi s i bl e i n the cus tomer. Al l other
a l l customers table detai l s s a ved correctly.
(customer management tab)

Title: Mr Title: Mr Title: Mr


Forename: Frank Forename: Frank Forename: Frank Check code a nd modi fy
To tes t whether Surname: Johnson Surname: Johnson Surname: Johnson to ens ure bus i nes s
Address Line 1: Unit 89j Address Line 1: Unit 89j Address Line 1: Unit 89j
22 addcustomer_frm cus tomers a re s a ved i nto Typi ca l property of record i s
Address Line 2: Bury Address Line 2: Bury Industrial Address Line 2: Bury
the s ys tem correctly. s et a nd s a ved correctly.
Industrial Park Park Industrial Park
Retest
Postcode: BL192L Postcode: BL192L Postcode: BL192L
City: Manchester City: Manchester City: Manchester
Telephone Number: Telephone Number: Telephone Number:
01617896653 01617896653 01617896653
Email Address: Email Address: Email Address:
fjohnson@Mywindows.uk fjohnson@Mywindows.uk fjohnson@Mywindows.uk

Business Customer: Tick Business Customer: Ticked Business Customer: Unticked


(True) (True) (False)
Business Name: My
Business Name: My Windows Business Name: My Windows
Windows

180
INPUT DATA
Title: Mr
Forename: Frank
Surname: Johnson
Address Line 1: Unit 89j
Address Line 2: Bury Industrial Park
Postcode: BL192L
City: Manchester
Telephone Number: 01617896653
Click Email Address: fjohnson@Mywindows.uk
Business Customer: Tick (True)
Business Name: My Windows

Click

Modify and
The new customer record has not been saved as a business customer. re-test

181
Input Tests
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)
Input the data below then
click add customer.
Title: Mrs
Forename: LEAVE BLANK
Surname: Millett
Address Line 1: Unit 89j
A di a l og a ppea rs tel l i ng
Address Line 2: the us er to i nput a
A di a l og s houl d be
To ens ure tha t cus tomers Huddersfield Industrial forena me. The a dd
Park di s pl a yed to i nform the
wi th no forena me ca n cus tomer form then
23 addcustomer_frm Erroneous us er a cus tomer ca nnot be No a ction requi red
not be s a ved i nto the Address Line 3: HO1J3 becomes a va i l a bl e for
crea ted tha t ha s no
da taba s e. i nput a ga i n. No detai l s
City: Huddersfield forena me.
for the i nva l i d cus tomer
Telephone Number: were s a ved.
07899847589
Email Address:
lmillett@huddwin.co.uk
Business Customer: Tick
(True)
Business Name:
Huddersfield Windows

182
INPUT DATA

Click

Click
I inputted the data and pressed add customer. A dialog then informed
me a customer name must be given. The add customer form then Finish
allowed me to amend the input Test

183
Input Tests
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

Make a note of the


current s tock l evel of
part 1007. Cl i ck the The new s tock l evel
mainmenu_frm Tes ts that the update The new s tock l evel of the
update s tock l evel equal s 320 therefore the
24 (Customer s tock l evel functi on Typi cal part 1007 s houl d = (ol d No acti on requi red
Management tab)
button. Enter the part i nformati on has been
works . s tock l evel (120) + 200)
ID: 1007 and the updated s ucces s ful l y.
addi ti onal s tock uni ts :
200.

Click
Inputting the given data caused the stock level
to be updated to 200 more than its previous

I
level.
Click
Input
Input text 1007

I Input
Input text 200
Click
Finish
Test

184
Input Tests
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

Data for the cus tomer


Cl i ck the edi t cus tomer s houl d l oad from data fi l e The data i n forename
mainmenu_frm Tes ts that the edi t
button on mai n menu. record i nto the textboxes box reads Mi tch. All
25 (Customer cus tomer form l oads the Typi cal No acti on requi red
Enter the pi n 1003 when ready for edi t. The data i n boxes contai n data from
Management tab) correct record.
prompted. the forename box s houl d the cus tomers record.
be Mi tch.

I
Click

Click Input
Input text 1003

The program correctly loads up the details of the


customer into the edit customer form so that the
details can be edited and saved back to that
Finish
record.
Test

185
Input Tests
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

Wi th cus tomer data pi n The other data i s not


Ens ures the edi t
1003 ready for edi t, The new emai l addres s The emai l addres s i s cons erved when the
cus tomer form wri tes
change the emai l s houl d be di s pl ayed i n the di s pl ayed however al l edi t occurs . Modi fy the
26 editcustomer_frm data back to fi l e, Typi cal
addres s to mi tchwi n@ cus tomer tabl e, wi th al l other detai l s are wi ped code s o that the un-
modi fyi ng data where
yahoo.co.uk then cl i ck other data cons erved. from the record. edi ted fi el ds data i s
neces s ary.
s ave. pres erved. Retes t

I Input
Input email address:
Modify and
re-test
mitchwin@yahoo.co.uk Click

The other details from


the record have been
wiped. This should not
have happened. The
teat has therefore
failed.
Click

186
Input Tests
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

To tes t whether the Cl i ck the Di s conti nue


mainmenu_frm An error mes s age s houl d An error mes s age pops
Di s conti nue Stock s tock button. Input the
27 (Stock Management Erroneous i ndi cate the s tock ID coul d up i ndi cati ng that the ID No acti on requi red
feature functi ons Stock ID 952 when
Tab) not be found. coul d not be found.
correctl y. prompted.

Click

I Input
Input text 952

Click

The system responds to the invalid pin by


informing the user it could not find a match. Finish
Test

187
Input Tests
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

To tes t whether the The i ntended s tock i tem The s tock parts tabl e
mainmenu_frm Cl i ck the Di s conti nue
Di s conti nue Stock (ID 1009 s houl d be updates and the s tock ID
28 (Stock Management s tock button. Input the Typi cal No acti on requi red
feature functi ons removed from the al l s tock 1009 i n no l onger i n the
Tab) Stock ID 1009.
correctl y. tabl e) tabl e.

Click

Click

I Input
Input text 1009
The system responds by removing the intended
part from the system. Finish
Test

188
Input Tests
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)
The order s tatus of the
Cl i ck the Mark order as The order s tatus of order
To tes t that the order can order 1002 s houl d change
mainmenu_frm di s patched button. ID 1002 i s marked as
29 be marked as di s patched Typi cal to 'di s patched'. Thi s No acti on requi red
(Order Viewer tab) Input the Order ID 1002 di s patched. No errors
i n the s ys tem. s houl d be refl ected i n the
and pres s ok. occurred.
al l orders tabl e.

Click
Click

Click

I Input
Input text 1002
The system responds by changing the status of
the intended order (1002) to dispatched in the
system.
Finish
Test

189
Input Tests
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)
To tes t that the mark The code needs to be
Cl i ck mark order The s ys tem s houl d
order as di s patched modi fi ed s o the
mainmenu_frm di s patched button and res pond wi th a mes s age The program cras hes and
30 functi ons res ponds Erroneous program handl es the
(Order Viewer tab) i nput the erroneous box i nformi ng that no s uch no mes s age box occurs .
correctl y wi th i nval i d i nval i d data wi thout
data 0010. order ID exi s ts .
i nput. error. Retes t.

Click

The system crashes and does not handle the


erroneous data. The test has therefore failed.

Click

I Input
Input text 0010
Modify and
re-test

190
Input Tests
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

The program changes the


The s ys tem s hould allow The s ys tem s hould change
Click the mark order as order s tatus of the order
mainmenu_frm s taff to mark an order as the order s tatus to
31 complete. Input the Typical 1004 to complete. This is No action required
(Order Viewer tab) complete. This will tes t Complete in the all orders
order ID 1004. reflected in the all
that function. table.
orders table.

Click

Click

I Input
Input text 1004
The system responds by changing the status of
the intended order (1004) to dispatched status
in the system.
Finish
Test

191
Input Tests
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

The s el ected cus tomers


Cl i ck the cus tomer ID
To tes t that the s el ect detai l s s houl d l oad i nto
number 1002 i n the The detai l s vi ew s hows
cus tomer functi on of the the detai l s vi ew. Thi s
32 createorder_frm s el ect cus tomer l i s tobx Typi cal the cus tomer forename No acti on requi red
create order works s houl d forename for thi s
on the create order i s John. No errors occur.
correctl y. cus tomer ID s houl d read:
form.
John

Click

Clicking the customer ID 1002 loads up the correct


data into the details labels. (John Reid in both list
and details.) The test has therefore passed. Finish
Test

192
Input Tests
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

Select the date


This will ens ure the The text above the
15/02/2015 on the The text above the
calendar on the create calendar reads
33 createorder_frm calendar which is in Typical calendar s hould update No action required
order interprets the 15/02/2015 and no errors
the top left corner of and now read: 15/02/2015.
correct date input. occurred.
the create order form.

Click

The Order Due date label updates to the selected


date (15/02/2015) after this date is clicked in the
calendar. Finish
Test

193
Input Tests
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

Crea te a new wi ndow


pa rt. On the CAD
Wi ndow des i gn form The ca nva s s hows a
i nput: The ca nva s s houl d conta i n wi ndow tha t i s wi der
CAD Tool a l l ows a
a wi ndow dra wi ng tha t tha n i t i s ta l l , ha s two
wi ndow to be correctl y Wi dth: 2.2
a ccura tel y depi cts the verti ca l ba rs a nd three
34 cadtoolwindow_frm dra wn gi ven the des i red Hei ght: 1.5 Typi ca l No a cti on requi red
gi ven i nputs . (The wi ndow pa nes of gl a s s . It a l s o
di mens i ons of the Verti ca l Ba rs : 2
s houl d ha ve three pa nes ha s one opener wi th a
wi ndow. Verti ca l Openers : 1
of gl a s s , one ha ndl e etc.) ha ndl e on the l eft ha nd
Opener Pos i ti on: Cyl cl e
s i de.
through to centre
Ha ndl e Si de: Left

After the given specifications had been inputted, Finish


Before input. the window automatically re-drew itself. Test

194
Input Tests
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

The wi ndow CAD tool form


The tabl e on the create
Us i ng the above s houl d cl os e. The create
Tes t that the order page updates and
wi ndow s peci fi cati on order form s houl d have a
s peci fi cati on of a drawn has a new entry that
35 cadtoolwindow_frm as the i nput, cl i ck the Typi cal new wi ndow i tem i n i ts No acti on requi red
wi ndow i s pas s ed back detai l s the correct
s ave button i n the i tems l i s t. The di mes i ons
to the create order form. di mens i ons of the
opti ons frame. s houl d be 2.2 wi de and 1.5
wi ndow.
hi gh.

Click
After clicking save the details are passed over to
the order form. The correct details for this window
are displayed here. Finish
Test

195
Input Tests
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

Crea te a new wi ndow


pa rt. On the CAD
Thi s tes t ens ures the
Wi ndow des i gn form
progra m ca n us e the ca d The progra m s houl d us e
i nput di mens i ons
da ta to a ccura tel y the CAD da ta a nd i nform The s ugges ted qua nti ty
2.2(w), 1(h). 2 verti ca l
36 createorder_frm s ugges t the l ength of PVC Typi ca l the us er of the requi red i s correct. (2.2 + 2.2 + 1 + 1 No a cti on requi red
ba rs . Cl i ck s a ve. Sel ect
requi red to ma ke a 2.2 by l ength of PVC. The qua nti ty + 1 + 1) = 8.4 (metres ).
the i tem i d i n the ta bl e
1 wi ndow wi th 2 verti ca l s houl d rea d 8.4 (meters ).
on the crea te order
ba rs .
form. Then cl i ck s tock
ID 1001 (Whi te PVC)

I
The window is automatically
drawn on the canvas. The parts frame
automatically updates to
reflect the amount of each Finish
Input part required. The calculated
Test
Input the windows specification given in the test plan. length of PVC is correct (8.4
metres).

196
Input Tests
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

The s el ected s tock s houl d


Cl i ck the i tem ID 100x i n The requi red part has
Tes ts that the us er can be added to the parts for
the al l i tems tabl e. beed added to the parts
add s tock to the order each i tem l i s t. The Item ID
37 createorder_frm Cl i ck the s tock ID 1006 Typi cal l i s t and the i tem ID 100X No acti on requi red
and the as s oci ated for the s el ected i tem
then cl i ck the add has been added to the
ordered i tem ID i s us ed. s houl d be i n the adjacent
button. Item ID col umn.
Item ID col umn.

Click
(ID number 1009)

Click
Click
(Part ID number 1006)
When I clicked the add button, the part added
onto the list of required parts for order.
Finish
Test

197
Input Tests
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

Create an order whi ch


Thi s tes t wi l l make s ure The total cos t for the parts
requi res 5 handl es , The cos t i s total ed up
that the create order s houl d be: 734.50 Thi s
20m of PVC and 5 correctl y (734.50). The
38 createorder_frm feature adds up the total Typi cal s houl d be di s pl ayed next No acti on requi red
s quare metres of s i ngl e text i s updated and no
cos t of An orders to the total parts cos t
gl azi ng. Add thes e errors occur.
cons ti tuent parts . l abel .
parts to the parts l i s t.

When the parts were added to the order the system automatically
added up the total cost of them, using the quantity and part cost. No Finish
errors occurred during this test. Test

198
Input Tests
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)
Create an order with The total cos t for the order The total cos t text
To tes t that the grand
parts cos t 734.50, input (dis played in the finalize updates automatically.
39 createorder_frm total of the order is Typical No action required
labour cos t of 560, order frame) s hould equal The grand total of the
correctly calculated.
additional charges 28. 1581.4 order is 1581.4

I Input
Input Labour cost 560
Add. Charges 28

The total amount to pay was equal to the sum of thee parts cost, tax, labour Finish
cost and additional charges. This test was therefore passed as the function Test
worked correctly.

199
Input Tests
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

Us i ng the a bove
wi ndow s peci fi ca ti on
a s the i nput, i n The order i s crea ted (i t i s
The order s houl d be s a ved
a ddi ti on to the a bove s hown i n the order
i nto the s ys tem. There
cos ts to crea te the vi ewer) s ucs es s ufl l y. No
To tes t tha t a typi ca l s houl d be no errors a nd a
order for us er ID 1002 errors occurred a fter
40 createorder_frm order ca n be crea ted Typi ca l di a l og s houl d i nform the No a cti on requi red
due on 10/02/2015. cl i cki ng s a ve a nd the
wi thi n the s ys tem. order ha s been crea ted
Del i very i s not requi red di a l og confi rmed the
wi th the ma i n menu form
a nd the order ha s beed order wa s ma de
l oa di ng up a fterwa rds .
pa i d i n ful l . Cl i ck s ucs es s ful l y.
confi rm a nd proces s
order.

The order was created and added to the all


orders list on the mainmenu_frm. This means
the data was saved successfully and since no
errors occurred, the program has passed the
test.
Finish
Test

200
Validation Tests
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

The order i s crea ted (i t i s


Crea te a new order wi th s hown i n the order
The s ys tem s houl d a l l ow
To ens ure a n order wi th jus t one i tem. Fi l l a l l vi ewer) s ucs es s ufl l y. No
the order to be crea ted
42 createorder_frm one i tem ca n be crea ted other fi el ds wi th typi ca l Extreme errors occurred a fter No a cti on requi red
a nd s houl d s a ve the
i n the s ys tem. da ta . Cl i ck confi m a nd cl i cki ng s a ve a nd the
deta i l s i nto the da ta ba s e.
proces s order. di a l og confi rmed the
order wa s ma de.

I added just one item to this order.

The order was created (1006) and added to the


all orders list on the mainmenu_frm. This
means the data was saved successfully and
since no errors occurred, the program has
passed the extreme data test.
Finish
Test

201
Validation Tests
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

A di al og i nforms the us er
Create a new order wi th the order needs a
The s ys tem s houl d i nform
To ens ure that an order no i tems . Fi l l al l other mi ni mum of one part.
the us er that an order
43 createorder_frm wi th no parts cannot be fi el ds wi th typi cal data. Erroneous The create order form No acti on requi red
requi res at l eas t one part.
created i n the s ys tem Cl i ck confi m and s tays open for edi t and
The order s houl d not s ave.
proces s order. the order was not yet
created.

I added no items to this order.

Because no item was added to the order


before attempting to create it, the program
handles the error with a dialog message. The
test has therefore passed.

Finish
Test

202
Validation Tests
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

Input typical cus tomer The s ys tem s hould inform A mes s age dialog
To check the length of a
details into the form. the us er that the cus tomer informs the us er that the
44 addcustomer_frm cus tomers phone number Erroneous No action required
Us e the phone number mus t have a vaild contact phone number mus t be
cannot be 10 digits long.
1097598478. Click Save. phone number. 11 digits long.

The program

I
responded by
Here I informing me the
inputted an input for phone
invalid phone number was invalid.
Click Input
number. All
the rest of
the data was
typical. Finish
Click
Test

203
Validation Tests
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)
Typical/
The s ys tem s hould accept The s ys tem accepts the
Input typical cus tomer Extreme.
To check the length of a the phone number as phone number as valid.
details into the form. (Phone
45 addcustomer_frm cus tomers phone number valid. It s hould s ave the It s aves the cus tomer No action required
Us e the phone number numbers
cannot be 11 digits long. cus tomer into the s ys tem into the s ys tem without
10975984781. Click Save. mus t be 11
without any errors . any errors .
digits )

I Input
Here I inputted a
typical phone
number. All the
rest of the data
was typical.

Click The form closed, then the menu loaded. On the menu,
within the all customers table, the new customer had Finish
been added. No errors occurred so the test passed. Test

204
Validation Tests
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

The s ys tem s houl d i nform


The s ys tem i nforms the
To check that a wi ndow Input wi ndow wi th the us er of the mi ni mum
us er of the mi ni mum
cannot be ordered wi th a wi dth 0.1, hei ght 1, no hei ght requi red and
46 cadtoolwindow_frm Erroneous hei ght requi red and No acti on requi red
hei ght of l es s that 0.2 varti cal bars or modi fy the val ue i n the
modi fi es the val ue i n the
metres . openers . hei ght box to 0.2 to avoi d

I
hei ght box to 0.2.
drawi ng errors .

Input
I input the
width as 0.1m

Finish
Test
The width changed to 0.2 automatically after
A dialog informs closing the dialog and the canvas reflected this.
of the minimum The test has passed since the program handled the
width. erroneous data correctly.

205
Validation Tests
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

The s ys tem s houl d i nform


The s ys tem i nforms the
the us er of the mi ni mum
To check that a door wi th us er of the mi ni mum
Input door wi th wi dth wi dth requi red and modi fy
47 cadtooldoor_frm l es s that 0.8 metres Erroneous wi dth requi red and No acti on requi red
0.59, hei ght 1.6, s tyl e 3. the val ue i n the wi dth box
wi dth cannot be ordered. modi fi es the val ue i n the
to 0.6 to avoi d drawi ng
wi dth box to 0.6.

I
errors .

Input A dialog
informs
I input the of the
width as 0.59m minimum
width.

The width changed to 0.6


automatically after
closing the dialog and
the canvas reflected this.
The test has passed since
the program handled the
erroneous data correctly.

Finish
Test

206
Validation Tests
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

To check that a door with The s ys tem s hould auto The s ys tem auto redraws
Input door with width
48 cadtooldoor_frm width 0.6 m (minimum) Extreme redraw the cad des ign and the cad des ign and no No action required
0.6, height 1.6, s tyle 3.
can be created. no errors s hould occur. errors have occured.

I Input
I input the
width as 0.6m

No error occurs and the


extreme inputs are
accepted. This means
the test has passed
successfully.

Finish
Test

207
Validation Tests
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

The s ys tem rejects the


Create a typi cal order The s ys tem s houl d reject
To ens ure an order order and di s pl ays an
but do not enter any the order and di s pl ay an
cannot be created error mes s age i nformi ng
49 createorder_frm cus tomer detai l s . Erroneous error mes s age i nformi ng No acti on requi red
wi thout a cus tomer that cus tomer detai l s
Attempt to s ave the that cus tomer detai l s mus t
s el ected. have not s el ected and
order be s el ected.
are requi red.

Click

Click

This resulted in the program creating a dialog which


informed the user to confirm customer details.

The details correct


checkbox was left Finish
unchecked. Test

208
Validation Tests
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

Click the update s tock A dialog appears


To tes t that the update The s ys tem s hould inform
button on the s tock informing the us er that
s tock function res ponds the us er that an invalid
50 mainmenu_frm management tab. Inpur Erroneous the s tock levelwas not No action required
to invalid s tock level s tock update level has
s tock ID 1009. Input the changed and invalid
inputs correctly. been entered.
additional s tock as /@. input was detectd.

Click

Click Here I input the erroneous data /@

Click

This resulted in an error message and the


I input the stock ID 1009c program handled the erroneous data Finish
correctly. Test

209
Retests
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)
Open the create order
51 (Restest of 5)

form and add an item.


To ens ure the correct cad The door cad des ign tool
Select the door 'Type' Door CAD des ign tool No futher action
cadtooldoor_frm tool loads when the us er Typical s hould open without any
option and input opens without any errors . required.
adds a part to an order errors .
quantity 1. Click add
item.

Click

I selected the door option


from the dropdown and then
inputted the quantity 5. I then
clicked add and design.
Finish
The door cad designer opened without any Test
errors, so the test was successful.

210
Retests
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

The ca l enda r s houl d ha ve


da tes i n bol d type to
The da tes whi ch ha ve
52 (Restest of 7)

i ndi ca te a n order i s due


To check the pendi ng Cl i ck the Orders Outlook orders due a re s hown i n
on tha t da te. When
mainmenu_frm orders a re l oa ded onto tab. Cl i ck on a da te tha t bol d. Cl i cki ng them now No futher a cti on
Typi ca l cl i cked, the bol d da te
(Orders outlook tab) the ca l enda r vi ew a nd ha s Bold font type. No s hows the order deta i l s requi red.
s houl d l oa d the rel eva nt
di s pl a yed when cl i cked. i nput da ta requi red. i n the rel eva nt l oca ti ons
order deta i l s i nto the l i s t
on the form.
boxes on the ri ght ha nd
s i de of the form.

It can be seen there is an


order due on the
21/02/2015.

This date is shown in


bold on the all orders
calendar.

Finish
Test

211
Retests
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)
53 (Restest of 11)

The Sugges ted Re-Order


Checks that the s ys tem
quanti ty s houl d be The s ugges ted reorder
predi cts s tock reorder Open the l ow s tock No futher acti on
lowstock_frm Typi cal greater than (reorder l evel quanti ty a s ens i bl e val ue
l evel s to an accurate form. requi red.
+ number need for for al l s tock.
degree.
outs tandi ng orders .)

The reorder level is greater than the


current stock level and the reorder
level. It therefore is a sensible value
and the test has passed.

Finish
Test

212
Retests
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

The form s houl d cl os e a nd The cus tomer now s a ves


return to ma i n menu. The a s a bus i nes s cus tomer.
Input the data below then fol l owi ng cus tomer detai l s Al l other detai l s a re
click add customer. s houl d be vi s i bl e i n the s a ved correctly. The new
a l l customers table entry i s vi s i bl e i n the a l l
(customer management tab) cus tomers tabl e.
Title: Mr Title: Mr Title: Mr
Forename: Frank Forename: Frank Forename: Frank
54 (Restest of 15)

Surname: Johnson Surname: Johnson Surname: Johnson


To tes t whether Address Line 1: Unit 89j Address Line 1: Unit 89j Address Line 1: Unit 89j
No futher a ction
addcustomer_frm cus tomers a re s a ved i nto Address Line 2: Bury Typi ca l Address Line 2: Bury Industrial Address Line 2: Bury requi red.
the s ys tem correctly. Industrial Park Park Industrial Park
Address Line 3: Bury Address Line 3: Bury Address Line 3: Bury
City: Manchester City: Manchester City: Manchester
Telephone Number: Telephone Number: Telephone Number:
01617896653 01617896653 01617896653
Email Address: Email Address: Email Address:
fjohnson@Mywindows.uk fjohnson@Mywindows.uk fjohnson@Mywindows.uk
Business Customer: Tick Business Customer: Ticked Business Customer: Ticked
(True) (True) (True)
Business Name: My
Business Name: My Windows Business Name: My Windows
Windows

213
INPUT DATA
Title: Mr
Forename: Frank
Surname: Johnson
Address Line 1: Unit 89j
Address Line 2: Bury Industrial Park
Postcode: BL192L
City: Manchester
Telephone Number: 01617896653
Click Email Address: fjohnson@Mywindows.uk
Business Customer: Tick (True)
Business Name: My Windows

Click

The customer details are saved and the customer is now saved as a business customer, His Finish
business name is also saved. The code has therefore been correctly modified and the test Test
has passed.

214
Retests
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)

Wi th cus tomer data pi n


55 (Restest of 26)

Ens ures the edi t


1003 ready for edi t, The new emai l addres s
cus tomer form wri tes The new emai l addres s
change the emai l s houl d be di s pl ayed i n the No futher acti on
editcustomer_frm data back to fi l e, Typi cal i s added and al l other
addres s to mi tchwi n@ cus tomer tabl e, wi th al l requi red.
modi fyi ng data where detai l s are modi fi ed.
yahoo.co.uk then cl i ck other data cons erved.
neces s ary.
s ave.

Click

I
Click

Input
Input the pin 1003.

Click Finish
Test

The customers email has been updated successfully. All the other customers details have been conserved.

215
Retests
Number

Test Description
Test

Form (tab) Reason For Test Type Of Data Expected Result Actual Result Action To Be Taken
(Including Test Data)
To tes t that the mark
56 (Restest of

Cl i ck mark order The s ys tem s houl d


order as di s patched The program i nforms the
mainmenu_frm di s patched button and res pond wi th a mes s age No futher acti on
30)

functi ons res ponds Erroneous us er that s uch order ID


(Order Viewer tab) i nput the erroneous box i nformi ng that no s uch requi red.
correctl y wi th i nval i d exs i s ts .
data 0010. order ID exi s ts .
i nput.

Click

I Input
Input the pin 0010.

The program created a dialog that informed the


order ID could not be found. This was the originally
intended action, therefore the test has passed.
Finish
Test

216
Evaluation of Test Results
Using a test as you code method during the creation of my program enabled time effective
problem correcting. This involved testing the software after each function was written,
focusing on whether the function operated as expected and desired. After all functions were
created and tested individually, the whole form was tested as a unit. This enabled conflicts
to be detected before moving on to program another form. Testing by function enabled me
to understand which function was causing the error, (whenever any errors occurred) this
was because if an error occurred, but was not happening prior to the function being written,
then the newest coded function must have been responsible.

Overall the testing went well. It was productive and ensured a fully functioning program was
the end product. I did carry out well over 400 tests, however due to time constraints, only
documented a proportion of these. This saved many hours. This is due to the fact tests can
be carried out quickly and easily, but when it is required the tests are documented and
evidence is given, much longer time is taken. It is a very tedious process to screen print,
then paste and annotate tests. Some further impromptu testing was also carried out.
These tests were not planned in the test plans, therefore I did not find it necessary to
evidence these tests in the documentation.

Whilst testing was carried out, several major errors occurred. One example of this was the
business customer property not saving to the record correctly. This issue took a while to fix
and the solution did not happen to be a simple one. An algorithm oversight was deemed the
cause, with a fix being applied to eventually solve the issue. During fixing this solution many
causes of error were explored, with both record reading and record inserting algorithms
being analysed for defect. Other smaller hiccups were encountered along the way, but the
testing method I adhered to ensured that the smaller errors did not build up leading to an
mammoth issue of debugging. In my opinion, the best method of software testing is the one
demonstrated, in addition to a final fully comprehensive test, as well as an onsite test,
demonstrating the capabilities and correctly working functions of the final revision of the
program. This could be compared to alpha and beta testing, in which the program would be
tested in house by the developers, followed by testing within its final expected environment
respectively.

217
Evaluation of Program Objectives
To evaluate whether my program is successful in meeting the outlined aims, I will carefully analyse
each objective set out in the analysis section of the documentation.

1. The software will enable office staff to order uPVC windows and doors from the company factory
on behalf of customers. The order should hold enough information so that the labourers can
create the uPVC products without direct communication with the customer.

The software allows the office staff to gather a significant level of information from the
customer. Information regarding the dimensions of the product, type of product and style of
product are all stored in the system. The program also utilises a CAD (Computer Automated
Design) tool that creates a drawing of the desired product. Accompanied with the CADD viewer,
labourers can use all this information in addition to the parts (stock) list for each item that
needs to be made. This provides more than sufficient information for the labourer whilst also
minimizing the likelihood of a miscommunication; the CAD drawing represents the design the
customer has agreed to, therefore adhering to this design means that the end product will meet
the required specification.

2. The system design should use meaningful button and label text to describe the function
accurately. For example a button which closes the current screen should be named Close or
Exit.
This design principle is demonstrated throughout the program. All functions such as exit or save,
are labelled Close or Save Details. This provides a consistent user experience and ensures that
users do not become mystified or confused when trying to operate the program. The labelling of
inputs and outputs is also descriptive, but consistent in nature. All order outputs follow the
same style and design despite the different filtration criterion. This is the same as with the other
outputs on the system. Inputs into the program are clearly labelled. A good example of this: the
forename field input is labelled Forename:, which is more descriptive than just Name:.

3. The system should use logical organisation categories, for example different data views, such as
orders or customers, should be under a View menu category.

This objective is strictly used in the core design of the system. In order to attain this set out
target, the system was designed around a categorised tab system. The main menu features four
navigation tabs; Order Outlook, Customer Management, Stock Management and Order
Management. These tabs offer tools and functions that fall within their descriptors territory.
This has led to a design that is easy to use, intuitive in nature. An office worker can carry out a
task such as adding a new customer to the system from the Customer Management tab, which
would be the office workers first choice of places to look within the program.

218
4. The staff should have the option to create new customers, new orders, new jobs (i.e. a window
or door required for the customers order) and new stock parts.
The use of two basic files (only a primary key) and three linked files (contain a foreign key)
means the staff can easily add and remove customers from the system. The addition of both
customers and stock involves opening the respective file. The record is then added. This is a
simple and easy to carry out process. The addition of an order to the system involves linked files
(three in total), however this is simple and the user it not made aware of this. The order is
created on one simple screen, with algorithms doing the complex work. Very little user effort is
required as job, item and job link records are all created automatically.

5. The staff should be able to edit stock and customer details. This will allow correction of incorrect
data for customers.

Tools within the software allow both stock and customer records to be easily edited. The layout
of the screens used to edit are similar to the add record forms. The program loads up the details
into editable fields (text boxes) that changes can be made to then the modified record can be
saved by clicking the save button. Alternatively the user can cancel the modifications by clicking
cancel, which will not save the modifications to the record.

6. The package should provide all available options for the uPVC products such as handles, glass
type and colour specification from drop down boxes in the product designer view.

This is done very effectively. Each attribute, type and colour, acts as a filter, enabling quick
sorting and selection of parts. The stock can also be searched using a key term. Any term
inputted for search will check for matches with various fields within the stock record. This
means the staff can quickly locate a part by colour, type, manufacturer, description, name and
cost. This enables much quicker processing of orders and saves both the customer and dekko
money, since less time taken means less time is wasted, hence lower overhead costs.

7. The package should allow customers details to be stored in the system for future purchase
streamlining, i.e. they will not have to provide all their details, and the office worker will not
have to carry out re-entry of data.

The system has been designed with this in consideration. The mechanism for ordering is as
follows:
Customer must first be added to database (if not a previous customer)
An order is created, with reference to the customers unique ID number, which is generated
automatically.
The program assists with finding customers in the event they do not know their customer ID
number. This ensures orders can be created as fast as possible.

219
8. The system should contain a view orders section where the orders and jobs can be viewed by
the labourers, thus manufacturing can take place. From this view the parts required and overall
constructed item should be detailed. The due date, quantity and any additional item notes
should be displayed.

All these functions are incorporated into the Order Management tab of the program. Here any
member of staff can view details specific to each order. All recorded order information can be
displayed through this output. Details such as dates and costs are readily available, as are lists of
items and parts that are required to complete the order. Upon selection of an item (if a window
or door) the cad drawing will be available. This is done using a CAD viewer tool. This allows the
labourers to view and check anything about the items or order in general.

9. Each part should have an individual cost. This will allow the system to calculate production costs
so the office worker is well advised when settling a final order cost.

The system has been created with this feature in its design. When a dekko staff member adds
an item of stock to the systems database, the cost of the stock (no profit, just outlay) must be
added into the record. When an order is created, the parts and quantities are listed and a total
parts cost for the order is generated. This is added to the grand total. From there the staff can
add additional charges, labour costs and tax addition/deduction. This forms a grand total which
is payable by the customer before the order is dispatched.

10. The manufactures name should be stored along with a reorder quantity in the stock file. This
should then be used to provide a summary of low stock and name for reorder by staff when
looked at from a summary view.

Within the software I have created a low stock tool. This function gathers stock information
from all orders which are due for manufacturing. It then looks at the stock file and analyses
whether the stock level of each item is low. If it is, using the crunched data, it will output
predictive order quantities that would replenish the stock levels high enough to satisfy the
demand for the part, as well as exceeding the reorder quantity defined in each stock record.

11. The software should provide a method of adding new stock types that can then be included in
orders. Old stock types should not be allowed to be deleted so that historical orders can be
viewed, however the option to discontinue a part should be available.

The stocked parts can be added to the system very easily. With consideration for historical
order viewing the system uses a discontinued attribute the effectively remove any given item of
stock from use in the system. Using this method means that historical orders keep their
integrity, but ensures that new orders cannot be made to require this part. This is done as the
add stock to order functions check each item in the stock files discontinued Boolean attribute. If
it is set to true, the stock is not listed or displayed.

220
Evaluation of Solution
To provide a further level of analysis I will analyse my program and end solution against the initially
drawn up evaluation criteria. This will enable close and rigorous scrutiny of the system and my
solution, in addition to appraisal and satisfaction. Since each criterion is quantifiable, I will use my
testing and user documentation to support justification where necessary.

1. The program should be intuitive in design and should allow use without reference to the
program documentation, specifically the user guide.

The design of the program is consistent throughout. The use of a minimal number of user screens
ensures the user does not become confused when navigating the system. The animated tab design
ensures the user always knows where they are when on the main menu. The use of the form title
property also ensures that, with screens not implemented into the home screen, the user can
understand what tool/screen they are using. This ensures the user guide is not compulsory, system
knowledge is quickly learned through the use of this and concisely labelled objects on each screen.

2. The program should provide detailed error messages in response to any invalid actions or
program crashes.

The program uses detailed error messages and suggests appropriate actions in addition to the
probable cause of error. The full list of possible error messages and solutions can be found in the
troubleshooting section of the user guide. The use of error messages is simple. When invalid data is
handled by the program, or data is not supplied for the action, an error message is displayed with
appropriate reasons. This ensures invalid data is not processed by the software, preventing the
likelihood of a system failure or catastrophic error.

3. The navigation should revolve around the tabbed design to ensure the user does not need to
navigate menu to menu to carry out simple tasks.

The use of a tabbed design allows the most common tasks to be centralised within the program. The
tabs offer descriptive and concise labelled tabs, four in total. This design leads to a navigation path
where all functions of the program are accessible through the main screen. This enables quick
navigation when tasks need to be carried out. The main outputs from the system, both basic and
linked, all fall into the tabs of the menu. This means that the staff can quickly jump from tab to tab
and compare and analyse data for customers, stock and orders.

221
4. The system should follow a design that adheres to the dekko green outlined in the problem
analysis. This colour should be used throughout and the system should use consistent design.

The use of green is software wide. All table headers use the dekko green colour, in addition to areas
of interest and the main menus title bar. This creates a professional look that blends into dekkos
feel whilst showing their green environment business aim. The system also only uses one font
typeface, utilising bold type and variety of font sizes. The use is professional, with all controls in the
software being styled the same.

5. The program should not crash when invalid inputs are given, the program should deal with
this through validation.

When invalid data is handled by the program, or data is not supplied for the action, an error
message is displayed with appropriate reasons. This ensures invalid data is not processed by the
software, preventing the likelihood of a system failure or catastrophic error. These validation
routines are outlines in earlier pages. The messages displayed are simple yet somewhat descriptive,
ensuring the user can avoid this error in the future.

6. The program should not allow required information, such as customer name, to be left null
when creating new records.

The use of validation and verification checks, as detailed above, means that all records have required
fields - such as names and addresses filled in with valid data before allowing the record to be
written to the appropriate data file.

7. The program should provide all tools and features outlined in previous pages of this
document.

All planed features have been included in the final version of the software package. The feature set
enables a final working solution, that is capable of operating in field at a company such as dekko.
Some program tools, such as the CAD designer, that were not of compulsory nature for this project,
enable the program to actually collect order data in a feasible manner; data collection any other
way, such as manual part quantity entry, would require extensive work on behalf of the user, which
would be unrealistic and not used in practice. The implementation of these features has also
enabled me to learn how to use non-conventional objects, such as shapes. The methods used to
draw the windows use loops in a creative manner that has given me a better understanding of
computer programming.

8. The program should support a large number of customers and stock parts, i.e. 400 of each.

I have run a test with the program adding 411 stock parts into the data files. (This was done using a
loop and all fields featured extreme data) The program handled this well and no poor performance
was noted. This means the program could handle this within the environment, quite possibly many
more than this figure.

222
9. The user guide should cover all features of the software comprehensively, enabling novice
users to navigate and use the system.

The program user guide uses many screenshots of the program in action, accompanied with
comprehensive descriptions and annotated actions. This means the guide can be interpreted by the
most novice computer user. All features of the program are included in the guide. The nature of the
guide means that tasks such as creating an order for a customer, are sequential and follow a
chronological order of use. This means that if a user needed to learn how to add an order they could
follow the guide strictly, entering their data where instructed.

10. It should be easy to create a new order: search tools should aid input of customer pin number
and stock items for each part.

The create order screen follows a design that incorporates filter and search tools into the main
inputs. The select customer section of the screen features a search text box where pins or names can
be typed to filter the results in the list box. The customer is then selected and confirmed by the user.
This ensures the order is assigned to a valid customer (as inputs by the user is minimal). This is the
same for adding stock parts to the order. The user can select a colour or type filter from drop down
boxes, in addition to a text box filter. The user then selects the part by clicking and a button ads the
part to the order.

11. The CAD tool should provide a detailed drawing of the end product and enable customer
confirmation that the ordered item is the desired and intended design.

The CAD (computer automated design) tool provides a drawing that is very similar to other industry
standard CAD drawing software packages (ISO in AutoCAD etc.). This means that dekko labourers
that have previous engineering experience will be familiar with the drawings produced by my
software. The basic line drawings ensure focus is on the structural attributes of the item ordered,
and not the aesthetical design, which is chosen and decided upon using dekko brochures.

12. Orders that have been marked as complete of due date has passed should be archived and
not shown in regular system outputs.

This is automatically done by the system when a member of staff marks an order as complete. This
avoids confusion and enables cleaner outputs which are not cluttered with outdated information.
This ensures the staff can manage the orders that are due etc. and maintain a schedule of work, with
minimal fuss. When searches are carried out, the orders marked dispatched are shown in certain
circumstances, such as if the order is a direct match for a searched order id.

223
Program Enhancements
The program I have created serves many functions, enabling a fully functioning package, which could
be used at dekko windows successfully. While the program does allow management of orders at a
company such as dekko, it is far from perfect and furthermore, several improvements could be made
in order to enhance the package and make the ordering process easier. Some improvements and
enhancements detailed below were attempted for implementation, however, due to the lack of
modern UI controls in VB6, were unable to be implemented.

I planned to design and implement a function that allowed the managers at DEKKO to monitor peak
periods of order due by calendar dates. I was aiming to design the calendar so that each date on
the view (on the orders outlook tab) had a different background. They all would have changed
colour according to number of orders due on the date. This would have meant that dates with many
orders due (all would have been relative to the dates with least orders due) would have been
intense in shade of colour. On the contrary, the date which had few orders due would have been
coloured in a lighter shade. This would provide an order due date intensity analysis. This would have
been useful for many reasons, one being the face newly placed orders could be strategically planned
to fall on due dates with fewer orders already due. Given the limited functionality of the VB6
calendar control, I was only able to implement this to a certain degree. The calendar dates turn bold
to indicate orders are due on the given dates. It is impossible however, to determine the number of
orders due on the date upon quick glance, it requires the user to click on the date, with the orders
then listed in a list box.

The implementation of a HTML & Java/PHP frontend for the software package would enable dekko
to scale their business and increase growth on a huge scale. The use of a web interface for the
software would allow several improvements over the system I have designed. Firstly dekko
representatives could carry out home visits, known as remedials, to measure the windows, then
work with the customer via a GSM/3G/4G enabled tablet device. This would allow them to place
orders through the web frontend, as an alternative to the windows desktop only (VB6 designed)
frontend. This would create a more personalised experience for the regular customers that place
orders with dekko. Alternatively this web based frontend would enable dekko to allocate access to
business customers, who know the measurements and design of the products they need to order. It
would allow them to place orders without the administration of a dekko employee, saving money
and time for both businesses. This enhancement is one which would require a team of skilled
developers. The implementation would be difficult and complex, requiring migration from the
custom .DAT files, to a web query enabled DBMS, such as MySQL. This is a professional grade
enhancement, which dekko would most likely seek if they required a new order management system
to be implemented.

An alternative implementation that would be more feasible (with a lower skill level required) would
be the implementation of a standalone program, which would be part of the software package I
created, but has a touch based UI and allows labourers in the factory to view orders and CAD
drawings with ease. This would simplify the view order requirement for the factory workers. If
created, the factory workers would no longer need to launch the DEKKO order management
software. Instead they could be given access to a program (which only has order viewing rights)
through a touch screen kiosk on the factory floor. This would allow them to easily view any details
and reduce dekkos carbon footprint, by lowering the number of orders being printed out. This
would move dekko one step closer towards achieving a greener environmental status, something
which they have been aiming to do.

224
225
1

Click

To begin the installation, copy the software directory


file from within the install media.

Click

Next, locate the program files windows directory, on


the main install partition. The path should be similar
to the following: C:\Program Files or use
C:\Program Files (x86) if you are a 64-bit machine
user.
Paste the copied software directory here, providing
administrator permission if required.
226
3

Click

Open up the software directory folder (C:\Program


Files (x86)\Dekko Windows Directory). Confirm that
both the software application named Dekko
Windows 1.0 and the Img folder are present in this
parent directory. Click and run the dekko windows
application (.exe).

The software should run for the first time. Wait for it
to load then close the software.

227
5

Open back up the software Dekko Windows


Directory, there will now be 5 newly created files.
These will hold the data for the software. The
program is now correctly installed. For ease of use
and security reasons, place a shortcut pointing to
the dekko windows application, on the system
desktop. For further instructions, refer to your OSs
user guide.

228
1

Click

Open the customer management tab and click add


customer.

2 The add customer form will load.


Here add the customer details.
Click save to save the customer.
If errors occur, see
troubleshooting guide. Once
saved the customer will be
entered into the system and the
add customer screen will close.
The new customer entry will now
be present in the all customers
table and can be used to create
Click orders for.
229
1
Click

Open the stock management tab and click add


stock.

2 The add stock form will load.


Here input the stock details.
Click save to save the stock
record. If any errors occur, see
the troubleshooting guide.
Once saved the stock will be
entered into the system and the
add stock screen will close. The
new stock entry will now be
present in the all stock table
and can be used to create
Click items for an order.
230
1

Click

Open the order viewer tab and click the Create new
order button.

The create order window will open, here we will


specify order details, choose a customer, add items
and stock.
231
3

Click

Begin by selecting the order due date. Click the date


desired on the calendar. The order ID will be
assigned automatically. Once selected the due date
text above will update to the chosen date.

Click

Click
Next, we must assign a customer to the order. This is
done by selecting and confirming a customer (customer
IDs can be searched) in the customer section of the order
screen. Once the customer is selected, confirm the
selection by checking the details correct checkbox.
232
5
Click

Click the text in the table to begin adding an item to


the order.

The add item controls will become enabled and here


the item details can be keyed in.

Once the quantity and type have been input, click add
and design to add the item to the order. For windows
and doors the CAD Designer will load. Learn how to
use this tool in the next section.

Once an item has been added, stock parts can be added


as the required components to manufacture the item.

233
6
Click

To add stock to a item, begin by clicking the item ID


number in the items table.

Click

The stock table will then be enabled. Use filters to


locate the appropriate stock required. To add the stock,
click an stock item, then input the quantity required for
each item. If the CAD tool has been used, the quantity
required will automatically calculated. Click add to add
the stock to the parts table.

The stock will now be listed in the required parts


column, along with the item id its required for and the
quantity per item.
234
6
Click

To add stock to a item, begin by clicking the item ID


number in the items table.

Click

The stock table will then be enabled. Use filters to


locate the appropriate stock required. To add the stock,
click an stock item, then input the quantity required for
each item. If the CAD tool has been used, the quantity
required will automatically calculated. Click add to add
the stock to the parts table.

The stock will now be listed in the required parts


column, along with the item id its required for and the
quantity per item.
235
7

Once all stock has been added to the order, the final step
can be undertaken.
Begin by specifying a labour cost for the order. Include profit
under this entry, I.E. If it costs 500 in labour and a 30%
profit is desired, then the labour cost input would be 650
(As 500*1.3 = 650). The TAX will be calculated
automatically.

Input any additional charges that the customer is liable to


pay for, such as delivery costs or rapid processing
surcharges. The reasons for the costs should be noted in the
additional charges details box.

In the finalize order section, the grand total payable by the


customer will be displayed. Quote this to the customer and
ensure the order is to proceed. Set whether the order has
been paid and whether delivery is required for the items.
Once all data has been entered, the order can be placed by
clicking the confirm and process order button.

The order will be saved and the order screen will close. If any
errors occur, use the troubleshooting guide to solve the
issue.

236
1

The CAD tool is great for calculating the amount of


each material needed quickly and efficiently. To use
the tool, input the desired specification for the
customers item.

These settings have created


the window shown in the
design view.
237
The appropriate CAD tool will launch by selecting the
Note desired item type on the create order menu. The
CAD Door tool operates in the same way.

Create the items design and confirm with the customer.

3
Once the CAD designs have been approved and checked the
design can be saved by clicking the save button. All the
parts quantities and dimensions will be passed back to the
order form.

238
There are two methods of viewing orders that have been
placed in the system.
Method 1 Using the calendar view

This method is best for viewing orders at glance, and can be


used to schedule item manufacturing. This is because this view
displays orders by due date, making dates on the calendar bold
to show when they must be dispatched by.

2 By clicking a date in bold on the calendar


the orders on that date will load into the
orders table. Clicking a specific order ID
will load the items on that order into the
table beneath, similarly, clicking the item
ID in that table will load thee stock parts
required for that item into the table
beneath.
239
Method 2 Using the order viewer tab

This method is best for viewing orders in detail. This view


provides order details such as Tax, Labour, Parts and additional
costs. It also details the order status information regarding the
order placement date. This view is available by navigating to
the order viewer tab.

2
Clicking a specific order ID from
within the orders table will load
the items on that order into the
table beneath and also load the
order details into view.
Similarly, clicking the item ID in
thee items on order table will
load the stock parts required
for that item into the table
beneath.

240
There are a wide selection of tools available to edit the
data within the system. Each of these adheres to a easy
to follow mechanism.

Mechanism Type 1 Used for editing stock and customer records.

1 To edit the stock or customer records, click the respective


button in the relevant tab.

2 2

3 3

2 Input the ID number of the customer/stock you wish to edit

3 Edit the details in the window that opens. So save changes,


click the save changes button. If any errors occur,
troubleshoot using the trouble section.

241
Mechanism Type 2 Used for editing stock levels and order
status.
When editing a single field in a record the system will present a
1 series of easy to use input dialogs. Below are the functions that
use this method of input.

2 Clicking one of the tools will open an input dialog where you will
either input a Stock ID, Customer ID or Order ID.
Once the ID number has been input click OK.

In cases of order status, the order status will be instantly


updated and no further action is required.
With tools such as edit stock level, there will be additional
inputs required before the changes are made. In this case the
additional units of stock are inputted. Click OK to make the
changes. These changes will be reflected in the viewers.
242
There is an advanced tool coded into the software that
enables stock ordering assistance and aims to prevent
complete stock level depletion.

To load the tool navigate to the stock management tab and


click view low stock.

Using advanced algorithms the software will calculate the


number of orders that require each stocked part, then using
the low stock value, determine whether the stock should be
considered low and requires a re-order. This will be shown
in a window with a stock table. If a re-order is required a
factor will be used to accurately estimate the quantity of
stock to reorder. This will ensure the stock is replenished
to a adequate level.

The items of stock should be re-ordered from the suppliers


by the suggested level.

243
Once an item of stock has been discontinued it will still
be shown in orders that have already been made and
use it. However, the part will no longer be displayed
when new items are made, the system stock is output or
within the re-order view.

Begin by clicking the discontinue stock button, which is


located on the stock management tab.

Input the Stock ID number of the stock that is desired for


removal from the system.

The following message will be displayed to notify the user


the action has occurred.

244
The following messages can occur when errors are inflicted
upon the software. Use the following table to diagnose the
sources of error and take the suggested action.

Error Message Cause of Error Suggested Action


Spare Parts don't have a The user has attempted to Choose either a window
CAD design. view a cad design for an or door to use the CAD
item that does not have viewer.
one.
Select an item to view the There is no item selected Choose an item from the
CAD design. when trying to view the items on order table.
CAD design.
Stock not discontinued, The stock ID inputted was Check the stock ID and try
stock ID not found. not found. again.
The inputted Customer ID The customer ID inputted Check the input is four
is invalid. was invalid. digits long.
The inputted Stock ID is The stock ID given for Check the input is four
invalid. input was invalid. digits long.

Order ID not found. No order could be found Check the input was
that matched the input. correct and try again.
Input an order ID. No order ID number was Attempt the action again,
specified for the action. this time specifying an
order ID.
No orders found for the The inputted customer ID Check the input was
searched customer ID. had no orders. correct and try again.
System will display all
orders.
No orders found for the The inputted order ID Check the input was
searched order ID. System does not exist in the correct and try again.
will display all orders. system.

Stock level not updated, No stock could be found Check the input was
stock ID not found. that matched the input. correct and try again.

245
Error Message Cause of Error Suggested Action
Please Input Customer This is a required field and Input the data to the form
Title. has been missed out. before re-attempting the
action.
Please Input Customer This is a required field and Input the data to the form
Forename. has been missed out. before re-attempting the
action.
Please Input Customer This is a required field and Input the data to the form
Surname. has been missed out. before re-attempting the
action.
Please Input Customer This is a required field and Input the data to the form
Address Line 1. has been missed out. before re-attempting the
action.
Please Input Customer This is a required field and Input the data to the form
Address Line 2. has been missed out. before re-attempting the
action.
Please Input Customer This is a required field and Input the data to the form
Address Line 3. has been missed out. before re-attempting the
action.
Please Input Customer This is a required field and Input the data to the form
Postcode. has been missed out. before re-attempting the
action.
Please Input Customer This is a required field and Input the data to the form
Phone number. has been missed out. before re-attempting the
action.
Please Input Customer This is a required field and Input the data to the form
Email Address. has been missed out. before re-attempting the
action.
Please Input Customer's This is a required field and Input the data to the form
Business Name. has been missed out. before re-attempting the
action.
No matching customer ID The customer ID inputted Check the input and try
found. could not be located again.
within the system.
Please Input Part Name. This is a required field and Input the data to the form
has been missed out. before re-attempting the
action.

246
Error Message Cause of Error Suggested Action
Please Input Valid stock The value input for the Check the input and
level. [Must be Greater cost of the item is invalid. correct to valid data.
than 0]
Please Confirm Customer The details of the Click the checkbox to
Details. customer have not been confirm the customer
confirmed while placing details before trying to
an order. save the order.
Please Select a date in the The order due date Choose an order due date
future. selected is in the past. the lies in the future.
Please add at least one No items have been Add at least one item to
item to make an order. added to the order. the order before
processing.
Please add at least one No stock has been added Add at least one stock
stock part to make an to the order. part to the order before
order. processing.
Please input a labour cost. No labour cost has been Input a reasonable labour
input for the order. cost to charge the
customer.
The Stock ID has not been No stock ID matching the Check the input and try
found. input could be located in again.
thee system.
Window must be at least The window does not Input a dimension that
20cm in height meet the minimum meets the minimum
required dimensions. requirement.
Window must be at least The window does not Input a dimension that
20cm in width meet the minimum meets the minimum
required dimensions. requirement.
Door must be at least The door does not meet Input a dimension that
1.6m in height the minimum required meets the minimum
dimensions. requirement.
Door must be at least The door does not meet Input a dimension that
0.6m in width the minimum required meets the minimum
dimensions. requirement.
Please Input Colour This is a required field and Input the data to the form
Description. has been missed out. before re-attempting the
action.

247
Error Message Cause of Error Suggested Action
Please Input Part Type. This is a required field and Input the data to the form
has been missed out. before re-attempting the
action.
Please Input Part Units. This is a required field and Input the data to the form
has been missed out. before re-attempting the
action.
Please Input This is a required field and Input the data to the form
Manufacturer. has been missed out. before re-attempting the
action.
Please Input Valid Cost. The value input for the Check the input and
[Must be Greater than cost of the item is invalid. correct to valid data.
0.00]
Please Input Valid Re- The value input for the Check the input and
order Value. [Must be cost of the item is invalid. correct to valid data.
Greater than 0]

248

You might also like