Capstone Virtual Nook Inventory Management System

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 114

IMPLEMENTATION OF VINOOK INVENTORY MANAGEMENT

SYSTEM

TITLE PAGE

A Undergraduate Capstone

Presented to the Faculty of the

COLLEGE OF INFORMATION AND COMMUNICATIONS TECHNOGY

Catanduanes State University

Virac, Catanduanes

In Partial Fulfillment of the

Requirements for the Course

CAP102 – Capstone Project 2

ALBAO, HANNAH ISOBELLE J.

VARGAS, DYN RYK A.

VILLAFUERTE, JOSHUA R.

December 2022
Republic of the Philippines
Catanduanes State University
Virac, Catanduanes
______________________________________________________________________________

CERTIFICATE OF AUTHENTIC AUTHORSHIP

We certify that this Undergraduate Capstone is our own work, and to the best of

our knowledge, has not previously been submitted for any course requirement except as

fully acknowledged within the text. Any contribution made to this research work and the

preparation itself has been acknowledged. In addition, we certify that all information,

sources, and literature cited are indicated in this thesis.

________________________

JOSHUA R. VILLAFUERTE

________________________

HANNAH ISOBELLE J. ALBAO

________________________

DYN RYK A. VARGAS


Republic of the Philippines
Catanduanes State University
Virac, Catanduanes
______________________________________________________________________________

College of Bachelor of Science and Information Technology

RECOMMENDATION FOR ORAL PRESENTATION AND EVALUATION

This undergraduate capstone titled “Implementation of ViNook Inventory


Management System” prepared and submitted by Joshua R. Villafuerte, Dyn Ryk A.
Vargas and Hannah Isobelle J. Albao in partial fulfillment of the requirements for the
course CAP102 – Capstone Project 2 is hereby recommended for Oral Presentation and
Evaluation through a College’s Research Colloquium.

________________ ASTER VIVIEN VARGAS, MSIT


Date Research Adviser

CERTIFICATION ON THE RESULT OF ORAL PRESENTATION AND


EVALUATION

This is to certify that this undergraduate capstone titled “Implementation of


ViNook Inventory Management System” prepared and submitted by Joshua R.
Villafuerte, Dyn Ryk A. Vargas and Hannah Isobelle J. Albao in partial fulfillment of
the requirements for the course CAP102 – Capstone Project 2, passed the Oral
Presentation and Evaluation conducted on _________________________ through a
College’s Research Colloquium.

______________________________
Subject Specialist

_________________________ ________________________
Language Critic Statistician
Republic of the Philippines
Catanduanes State University
Virac, Catanduanes
______________________________________________________________________________

College of Bachelor of Science and Information Technology

APPROVAL SHEET

On the certification that this undergraduate capstone titled “Implementation of

ViNook Inventory Management System” passed the Oral Presentation and Evaluation

is hereby approved in partial fulfillment of the requirements for the course CAP102 –

Capstone Project 2.

GEMMA G. ACEDO Ph.D., DIT


Research Professor

____________________________
Department Chairperson,
Teacher Education

GEMMA G. ACEDO Ph.D., DIT


Dean
v

TABLE OF CONTENTS

TITLE PAGE........................................................................................................................i

CERTIFICATE OF AUTHENTIC AUTHORSHIP...........................................................ii

RECOMMENDATION FOR ORAL PRESENTATION AND EVALUATION.............iii

CERTIFICATION ON THE RESULT OF ORAL PRESENTATION AND

EVALUATION..................................................................................................................iii

APPROVAL SHEET..........................................................................................................iv

TABLE OF CONTENTS....................................................................................................v

LIST OF TABLES..............................................................................................................ix

LIST OF FIGURES.............................................................................................................x

CHAPTER 1 INTRODUCTION......................................................................................12

PROJECT CONTEXT...................................................................................................12

PURPOSE AND DESCRIPTION.................................................................................13

OBJECTIVES................................................................................................................14

SCOPE AND LIMITATIONS.......................................................................................15

DEFINITION OF TERMS.............................................................................................15

CHAPTER 2 RELATED LITERATURE/SYSTEMS......................................................16

SYNTHESIS..................................................................................................................20

CHAPTER 3 DESIGN AND METHODOLOGY.............................................................21


vi

TECHNICAL BACKGROUND....................................................................................21

Hardware Requirements.............................................................................................21

Software Requirements..............................................................................................22

Data Requirements.....................................................................................................23

METHODOLOGY.........................................................................................................23

Define system requirements.......................................................................................24

Design and develop....................................................................................................25

Testing and get feedback............................................................................................25

Finalize system or implementation.............................................................................25

CONCEPTUAL FRAMEWORK..................................................................................26

SYSTEM ARCHITECTURE........................................................................................30

EVALUATION..............................................................................................................31

Data Gathering Procedure..........................................................................................31

Respondents of the Study...........................................................................................31

Statistical Tools..........................................................................................................32

PROFESSIONAL AND ETHICAL CONSIDERATION.............................................33

CHAPTER 4 RESULT AND DISCUSSION....................................................................34

PROJECT TECHNICAL DESCRIPTION....................................................................34

DEVELOPMENT OF VINOOK IMS...........................................................................34

SYSTEM FEATURES...................................................................................................35
vii

EVALUATION RESULT..............................................................................................41

IMPLEMENTATION PLAN........................................................................................43

CHAPTER 5 RECOMMENDATION...............................................................................45

SUMMARY...................................................................................................................45

RECOMMENDATIONS...............................................................................................45

REFERENCES..................................................................................................................47

APPENDICES...................................................................................................................50

APPENDIX 1 Approval of Project Title........................................................................50

APPENDIX 2 Acceptance Form of Advisorship...........................................................52

APPENDIX 3 Project Schedule.....................................................................................53

APPENDIX 4 Implementation Plan..............................................................................54

APPENDIX 5 Modules and Storyboard........................................................................56

APPENDIX 6 Relevant Source Codes...........................................................................70

Login Module.............................................................................................................70

User Module...............................................................................................................70

Inventory Module.......................................................................................................73

Sales Module..............................................................................................................82

Customer Module.......................................................................................................86

Supplier Module.........................................................................................................90

History Module...........................................................................................................95
viii

Password Module.......................................................................................................96

APPENDIX 7 Database Design...................................................................................100

APPENDIX 8 User Manual.........................................................................................102

Shortcut Keys Available...........................................................................................102

How to Start the Application....................................................................................102

How to Login............................................................................................................103

How to Reset Password............................................................................................103

How to Add New Stock............................................................................................104

How to Add New Order...........................................................................................105

How to Add New Customer.....................................................................................105

How to Add New Supplier.......................................................................................106

How to Add New Product Category.........................................................................106

How to Edit Account Details....................................................................................106

How to Change Password.........................................................................................106

How to Edit Details..................................................................................................106

How to Print.............................................................................................................107

APPENDIX 9 Questionnaire.......................................................................................108

APPENDIX 10 Pictures Showing the Data Gathering and Development...................110

APPENDIX 11 Team Members Curriculum Vitae......................................................112


ix

LIST OF TABLES

Table 1 Hardware Specifications for System Development..............................................21

Table 2 Software Requirements for System Development................................................22

Table 3 Respondents of the Study.....................................................................................31

Table 4 Evaluation Criteria................................................................................................32

Table 5 Overall results of ViNOOK IMS Functionality...................................................41

Table 6 Overall results of ViNOOK IMS Usability..........................................................42


x

LIST OF FIGURES

Figure 1 Rapid Application Development.........................................................................24

Figure 2 Conceptual Framework.......................................................................................26

Figure 3 Use Case Diagram...............................................................................................28

Figure 4 Context Diagram.................................................................................................29

Figure 5 System Architecture............................................................................................30

Figure 6 Inventory Page.....................................................................................................36

Figure 7 Sales Page............................................................................................................36

Figure 8A Customers List Page.........................................................................................37

Figure 9 Account Page.......................................................................................................39

Figure 10 History Page......................................................................................................40

Figure 11 Password Reset..................................................................................................40

Figure 12 Visual Table of the System...............................................................................41

Figure 13 Login Form........................................................................................................56

Figure 14 Reset Password..................................................................................................56

Figure 15 Inventory Page...................................................................................................57

Figure 16 Sales Page..........................................................................................................60

Figure 17 Customers Page.................................................................................................62

Figure 18 Suppliers Page...................................................................................................64

Figure 19 Product Categories Page....................................................................................65

Figure 20 User Account Page............................................................................................66

Figure 21 History Page......................................................................................................67

Figure 22 Print Preview of Inventory................................................................................67


xi

Figure 23 Print Preview of Sales.......................................................................................68

Figure 24 Print Preview of Customers List......................................................................68

Figure 25 Print Preview of Suppliers List........................................................................69

Figure 26 Print Preview of Product Categories................................................................69

Figure 27 System's Database Design...............................................................................100


12

CHAPTER 1

INTRODUCTION

PROJECT CONTEXT

Small-scale to large-scale businesses need a system to manage their inventory

because manually doing it does not improve management quality. Upgrading and

pursuing technology growth enhances the system, and its practical use can simplify

business activities. Technology improves speed, precision, planning, execution, and

management. It can raise productivity, save time, and improve inventory management.

Every business has inventory. It includes a company's raw materials, finished

goods, work-in-progress, and operational supplies. Inventory plays a significant role in

the need for adequate management of the electronic flow of information between vital

suppliers, lead times, and the quality of purchased goods.

Inventory management is a system that ensures the availability of sufficient

resources as and when they are required while limiting investment in stocks (Tom Jose et

al., 2013). Inventory management assists businesses in indicating which and how much

stock to order at what time. It keeps track of inventory from purchase to sale. The

practice identifies and responds to trends to ensure that there is always enough stock to

fulfil customer orders and that a shortage is properly announced. Inventory management

has a direct impact on a company's capacity to boost customer service, cash flow, and

profitability (Muller, 2019). Monitoring the flow of items into and out of an inventory is

the responsibility of inventory management. This method entails monitoring unit


13

transfers to prevent high or low inventory levels from interfering with business

operations.

Inventory management is necessary for major organizations and private

businesses with a significant number of daily orders and commodities. The system

monitors inventory levels and order fulfilment times. Thus, this system alerts businesses

when they are running low on inventory.

The system is intended to provide Virtual Nook with a secure and reliable

inventory management system away from the traditional way of managing inventories

through Microsoft Excel.

Moreover, the system is very much needed to improve Virtual Nook’s customer

warranty service.

PURPOSE AND DESCRIPTION

Presently, Virtual Nook Computers and General Merchandise inventory are

handled and updated on an excel spreadsheet, which is an outdated method of

documenting and keeping inventory of items and is extremely time-consuming to enter

and update data on a daily basis. In consequence, there is a challenge in placing an order

at the right time to the suppliers and how many units of each item must be ordered to

maintain operational efficiencies, and identifying which item must be sold first to prevent

the warranty period from being exceeded. Additionally, identifying which supplier the

items were purchased from for their warranty and its validity is a concern of Virtual

Nook, as they frequently file warranty claims with the wrong supplier. This manner of
14

handling inventory management is rigorous and time-consuming for the cashier and

causes a deficit in items and net loss.

More so, the system that will be developed is intended to provide reliable, user-

friendly, and secure access to the owner and cashier.

For the Cashier, they will no longer take a lot of time to add new stocks. The

owner has access to adding products, editing products, and updating products. To make

sure that the system proposed will work at its best capacity, it would require further

testing and pilot runs.

With the help of a barcode scanner, the inventory management system is capable

of adding and updating products efficiently and identification of products for claiming

warranty service.

Whereas the study entitled “Implementation of ViNook Inventory Management

System” offers an easier way of handling inventory management for both the cashier and

the owner. In this sense, the cashier and the owner will be able to solve all the

aforementioned concerns within a single functional and usable system.

OBJECTIVES

The general objective of the study is to design and develop a system application

that will provide aid to Virtual Nook’s current concerns with inventory management.

Specifically, it seeks to achieve the following objectives:

 To design and develop a system application that will provide aid to Virtual

Nook’s inventory management.

 To evaluate the system’s functionality and usability using ISO 25010:2011.


15

SCOPE AND LIMITATIONS

The inventory management system focuses on monitoring the product's status and

identifying if it requires restocking; if so, the item will receive a system-generated notice

of replenishment. The system will monitor the products from whose supplier came and

determine if the warranty is still valid. The owner will have full control of the system,

including the ability to view, add, edit and update; the cashier will only be allowed to

view and add inventory data.

DEFINITION OF TERMS

The following are the terms used and their definitions.

Cashier – the person who handles the sales, payments and receipts of ViNook.

FIFO - First in, first out (mostly regarding stock valuation and data storage methods)

follows the natural flow of inventories, with the oldest products sold first.

Inventory - the total number of items or materials available for purchase.

Inventory Management - the proper monitoring of stock level.

Owner – is the person who owns and manages Virtual Nook.

Products - the goods or services a store sell.

Supplier – a business or entity in which ViNook purchased its products.

Virtual Nook (ViNook) – the store where the inventory management system will be

implemented.

Warranty – a written guarantee issued to the purchaser of a product by its manufacturer,

promising to repair or replace it if necessary, within a specified period.


16

CHAPTER 2

RELATED LITERATURE/SYSTEMS

A smart inventory system improves supply chain management performance

(Sohel & Osman, 2018). One of the crucial business tools that aid in managing all of a

company's inventories at once is inventory management. With inventory management,

businesses can operate effectively and handle their vast amounts of data. In the past,

when technology and data collection methods were less capable of handling queries,

managing inventories of commercial goods took much work. Many intelligent processes

are now available on the market, assisting business sectors in managing their vast supply

chains of industries in a more forward-thinking manner by tracking their inventory and

purchasing. One of the best ways to think about the things that improve business

efficiency and give detailed information about the products and their availability before

running out of stock is to use an intelligent inventory management system.

In the study conducted by Mondol (2021), the smart inventory system aids

businesses in developing positive approaches to their resolutions and business

management by recording inventories through a variety of technology analytic tools. The

old and traditional inventory management working procedures are lethargic and time-

consuming. Many people were involved in the data entry procedure and sat for some time

to manually enter the full inventory details and track the record. Nevertheless, Radio

Frequency Identification (RFID) is one of the technology's most innovative solutions,

replacing the entire inventory system with a single intelligent and quick method. RFID is
17

an innovative technology that makes asset tracking and inventory management more

accessible and convenient.

In a study conducted by Kambivi et al. (2020), the development of an inventory

management application using points of sale laravel, the researchers concluded that the

computerized system was anticipated to aid in the preparation of reports and allow for

better control of sales and inventory. The researchers employed the application to

ascertain the entry and exit of stock goods. Lastly, the web application can show a report

on each purchase.

According to Liu et al. (2020), inventory management is arduous since sales

forecasting can be difficult for any organization. It also varies from industry to industry.

In the retail industry, demand varies depending on the purchasing power of the

customers, where there are many different types of goods, such as convenience,

shopping, and luxury goods. In this regard, a smart inventory system is an absolute

necessity. A smart inventory system can keep track of inventory levels and scalability and

provide security and backups. Smart inventory systems are required in the retail industry.

For example, through smart shelves, real-time inventory management has become

possible.

Panganiban and Bermusa (2020) conducted a study titled "Simplified Barcode-

based Point of Sales and Inventory Management System with Replenishment Decision"

for a grocery store to better achieve its goals by remaining customer-focused and

delivering the products and services that the customers want. The system includes a Real-

time Tracking Point of Sale, Inventory, and Sales Management and an upgraded system

for the Grocery Point of Sale, Inventory, and Sales Management. The system enables the
18

administration to manage and track inventory and sales. It can also keep and organize

records based on the desired outcome and create user accounts for security purposes. It

also includes the following features: User-Friendly, CPU-Friendly, Data Safety, Special

Roles and Permissions. The established system used a barcode system integrated with an

inventory management process for product records. The software development and

evaluation demonstrated that the project system performs its intended functions and is an

adequate inventory and sales management system. It was tested in a grocery store and

received a strongly agree rating for usability, functionality, and dependability. The

system also includes an expiration date entry for replenishment decisions and product

quality maintenance. The study concluded that expiration dates must be included in any

inventory system used by companies that sell food; this will benefit not only the food's

quality but also the customers' safety.

In the study of Archana Bhattacharyya et al. (2022), ABC Analysis, VED

analysis, FSN analysis, forecasting inventory, stock-in-charge, FIFO system for stock

keeping unit and LIFO system, Strategic supplier system, Economic ordering quantity

system, Open to buy (OTB) system, Just-in-time system, cycle counting, RFID system,

barcoding system, enterprise resource planning system are the common inventory

techniques used by retail sectors.

The study by Muchaendepi et al. (2019) found that inventory management

strategies improved the financial performance of SMEs in the manufacturing sector over

the study period; this indicates a substantial relationship between inventory management

tactics and financial, namely working capital and return on investment decisions. SMEs

incurred higher-than-necessary operational costs to provide superior customer service by


19

stockpiling extra inventory. This strategy was attributable to inadequate inventory

planning and the failure of most SMEs to strike a balance between efficiency and

responsiveness in inventory management.

In a study by E. Ahmadi et al. (2018), the researchers presented an up-to-date

review of research in the inventory management of surgical supplies and instruments. A

comprehensive analysis of the literature divided the papers into two groups: those written

by practitioners who documented their observations of the present problems in the

operating room and those written by scientists who created optimization techniques.

Additionally, pinpoint the upcoming research lines that will lower the cost of operating

room inventory.

Shahridan et al. (2022) conducted the research entitled "Improving the Inventory

Management System at Shams Best Technic Sdn Bhd by Implementing Barcode

System". Implementing a barcode system in SBT SB warehouses shows several

advantages, including reducing errors in goods receipt and accelerating the inventory

management process. The barcode system can also automatically determine the amount

of inventory remaining for each type of items, such as glass and aluminum items,

reducing errors in the storage and making it simple to type and check inventory

quantities. Every process in a warehouse equipped with barcodes can be completed more

quickly and accurately than in a warehouse that still relies on manual labor. To achieve

warehouse efficiency, a warehouse must incorporate barcode technology into its

warehouse management system. The issue that SBT SB deals with is manually recording

the stock of goods. As a result of the barcode system, the process of entering and exiting

goods will be streamlined, with no problems or incorrect item records.


20

The scanning and recognition technology of barcodes in the inventory machine

was systematically researched and designed. The critical technology of computer image

processing was applied to identify the barcode image and conducted field tests combined

with the actual use scenario. It overcomes the problems caused by environmental factors,

improves the accuracy of barcode information input, and reduces the time cost of single

barcode scanning and recognition. The innovation of crucial functions in the inventory

machine will maximize its role in the inventory process and accumulate experience for

future localization of the inventory industry (Li B. and Liu Y., 2019).

SYNTHESIS

The researchers found that having a reliable inventory management system means

a business can operate effectively. In addition, it provides businesses with an efficient

and convenient way of handling data, queries, and product management. With less human

error, an inventory management system means improved financial performance, as it

prevents overlooked sales and unattended customer support. IMS benefits the business

owner and its customers because of the streamlined process of claiming a warranty.
21

CHAPTER 3

DESIGN AND METHODOLOGY

TECHNICAL BACKGROUND

The development of the proposed system has an important requirement needed for

successful development and implementation. Some of the software requirements are

Visual Studio IDE and MySQL server. Hardware requirements consist of a computer set

or laptop, barcode scanner and printer. Visual Basic .Net was used as the programming

language. Minimum requirements for client hardware and software was determined after

the design and development phase.

Below are the complete technical requirements specifications in terms of software

and hardware.

Hardware Requirements

The researchers identified the hardware components needed for the

development and maintenance of the system.

Table 1 Hardware Specifications for System Development

Hardware Specification
Intel Core i3 @
Processor
2.30GHz
Windows 10 64bit
Laptop System Type
operating system
Storage and Type 500GB SSD
RAM 12GB
Barcode Scanner Scan Type Linear CCD (Charge-
22

Coupled-Device)
Supported Barcode Type 1D and 2D
USB wired connection,
Connection Type
plug and play
Any printer that can print at least Letter, Legal and A4
Printer
paper sizes.
Any router that can have access to internet connection
Router
either wireless or wired connection.

Software Requirements

The researchers used different software in designing and developing the

system.

Table 2 Software Requirements for System Development

Software Specification Function


Perform computer’s basic
Operating System Windows 10 64bit functions, launch and
execute programs.
Allow software developers
to design and create
Programming Language Visual Basic .NET
applications that run
on .NET.
Used for performing
Database Management database operations such as
MySQL Server
System creating, reading, and
updating database data.
Integrated Development Used to create, edit, debug
Visual Studio 2019
Environment and build the system.
Used to print reports in the
Crystal Reports Runtime
Report Writer system, such as the list of
Engine 64bit
stocks.
Will be used to send
GMAIL Simple Mail
Mail Server verification code to email
Transfer Protocol
when resetting password.
Prerequisites  Dot Net Framework Required to run the system.
23

4.7.2
 MS Visual C++
2019
Redistributable

Data Requirements

The data that were used in this study are, list of products and their

category, stock details such as how many stocks are available and which supplier

the product is purchased. List of customers and suppliers, and their required

details. The data will be inputted in the system by the user.

METHODOLOGY

The method that will be used during system development is the Rapid Application

Development commonly known as RAD. Rapid Application Development (RAD) is a

development model that prioritizes rapid prototyping and quick feedback over long-

drawn-out development and testing cycles.

Figure 1 Rapid Application Development


24

With rapid application development, developers can make multiple iterations and

updates to software quickly without starting from scratch each time. This helps ensure

that the final outcome is more quality-focused and is in alignment with the end-user’s

requirements (Kissflow, 2022). The development process of this study will consist of four

steps which are as follows: a) Define system requirements; b) Design and develop; c)

Testing and get feedback; d) Finalize system or implementation.

Define system requirements

This step comprised of an interview with the target client to determine the system

requirements on what will be the major functions or features of the system. And add

additional minor features that will be needed and possible issues that may come up during

the development.

Design and develop

Once the gathered information has been sorted and organized, the researchers

began the design step by building the system algorithms and prototypes. The prototype

includes the system overall design and event actions. In this step, the researchers used

Figma for the creation of the design. The prototype serves as the testing application for

the client to evaluate and approve.

In the development stage the coding has taken place, the researchers used Visual

Studio IDE to develop the prototype into functioning system and all the technical

requirements needed.
25

Testing and get feedback

During this step the researchers demonstrate the functioning system into the

client, and after demonstration the client used the system for testing. If there are changes

on the clients’ testing, this step will go back to design and development step until the

system met the clients’ requirements.

Finalize system or implementation

In this step the system will be finalized for the implementation. The researchers

will refactor the code in order to optimize the implementation and improve stability.

CONCEPTUAL FRAMEWORK

The figure below represents the project's conceptual framework. It is based on the

input, process, and output model.


26

Figure 2 Conceptual Framework

Figure 2 shows that the input consist of hardware, software and data requirements.

These requirements will be used in the process of developing the system. The hardware

requirements consist of laptop, barcode scanner, printer and router. For the software

requirements, it consist of an operating system windows 10 64bit, Visual Basic .NET,

MySQL Server, Visual Studio IDE, Crystal Reports Runtime Engine, Mail Server, Dot

Net Framework 4.7.2 and MS Visual C++ Redistributable. The data requirements consist

of products and their information, category, customers and their information, suppliers
27

and their information. These requirements are prerequisites in order to develop and make

the system function. In the development process, the researchers used the Rapid

Application Development which consist of four steps as follow: a) System Requirements;

b) Design and Develop; c) Testing and get feedback; d) Finalize system or

implementation. Lastly the project output will be the ViNook Inventory Management

System.

Figure 3 Use Case Diagram


28

Figure 3 shows the use case diagram of the system. Use case diagram is one of the

requirements in software development that will give visual representation on how the

system will function. The above figure shows two entities which are the administrator or

owner, and the user or the cashier employee that can access the inventory. The owner has

full control over the system whereas the user is only given specific access.

Figure 4 Context Diagram

The figure above shows the overall process of the system. It shows the interaction

between two major users which is the owner and the cashier. Both the user has the same

interaction with the system but with the cashier having limited access to perform data

operations in the system.


29

SYSTEM ARCHITECTURE

Figure 5 System Architecture

Figure 5 shows the system architecture, the architecture consists of the client

computer, barcode scanner, printer, router, internet connection and mail server. The

system installed in the client is a standalone application. The architecture will function as

follows:

 The client computer will be the one performing operations on the system operated

by the user.

 The barcode scanner will be used to scan the products Universal Product Code

and Serial Number, the scanned data will then be transferred to the system in the

client computer.

 The printer will be used to print out reports generated by the system based on the

data the users entered.


30

 The router, internet connection, mail server and email recipient will only be used

when the user requested a password reset, the system will connect to the internet

and generate a verification code that will be sent to the user email address.

EVALUATION

Data Gathering Procedure

Before the start of the study, the researchers interviewed the owner to

know the problems they encountered in their manual inventory management. The

researchers asked questions and explained the purpose and importance of the

study. The researchers assured and told the respondents that all information to be

gathered would be confidential and used only for the study.

Respondents of the Study

The respondents of the study are the owner and cashier of Virtual Nook.

The researchers selected these respondents for the reason that they will be the

ones who will use and benefit from using the system. The total size of the

respondents is shown in table 3 below.

Table 3 Respondents of the Study

Respondent Total Number of Population Total Number of Respondent


Owner 1 1
Cashier 1 1
31

Statistical Tools

The researchers will use the Likert scale to evaluate the system in terms of

functionality and usability. Likert scale (typically) provides five possible answers

to a statement or question that allows respondents to indicate their positive-to-

negative strength of agreement or strength of feeling regarding the question or

statement (SimplyPsychology, 2019).

Table 4 Evaluation Criteria

Scale Mean Range Interpretation


5 4.21-5.00 Excellent
4 3.41-4.20 Very Satisfactory
3 2.61-3.40 Satisfactory
2 1.81-2.60 Unsatisfactory
1 1.00-1.80 Very Unsatisfactory

Table 4 shows the evaluation criteria which has a scale of 1 to 5, mean

range of 1.00-1.80, 1.81-2.60, 2.61-3.40, 3.41-4.20, 4.21-5.00 respectively and

interpretation of very unsatisfactory, unsatisfactory, satisfactory, very satisfactory

and excellent respectively. The above criteria will be used to evaluate the

system’s functionality and usability. The mean range was computed using the

following formula:

Gap = series / number of the group

Gap = 4/5

Gap = 0.80
32

PROFESSIONAL AND ETHICAL CONSIDERATION

The following ethical considerations will be employed in this system:

 The information that will be provided by users would be treated with the utmost

confidentiality.

 The system will use words or phrases that are respectful in the eyes of the users.

 The system will be created carefully and will not damage any intellectual

property.

 Research participants should not be subjected to any kind of harm.

Other professional and ethical considerations:

 Confidentiality is very critical when proposing a system in which the respondents

are the key subject for the system.

 Health and safety strive to provide each employee with a safe and healthy work

environment.
33

CHAPTER 4

RESULT AND DISCUSSION

PROJECT TECHNICAL DESCRIPTION

The main goal of this study is to provide aid by developing a system to overcome

Virtual Nook’s current concerns with inventory management. The system will enable

Virtual Nook to keep track of its products and replenish on time, as well as which

suppliers the products was bought from in order to file accurate warranty claims, and

utilize the First-In, First-Out method in selling the products.

DEVELOPMENT OF VINOOK IMS

The main user interface consists of header, navigation menu, and the content of

the system. In the header, it consists of the store logo, module title, warning notice, and

user controls – minimize, maximize or close application – the warning notice shows the

number of products that are low on stock, the notice is available in every page. In the

navigation menu, it consists of inventory, sales, customers, suppliers, product categories,

user profile, history and logout button. In the body, the displayed content will depend on

the chosen module.

The following are the modules and their functions in the system:

Login Module – This module validates the users that log in to the system.
34

User Module – This module contains the personal information of the logged in user.

They can update their basic information as well as change their password.

Inventory Module – This module contains the product lists and their information. In this

module the user can view, add, edit or print stock list and view report.

Sales Module – This module contains the record of sold products. The user can view the

sold products information and date sold. The user can also print the report of sales list.

Customer Module – This module contains the list of customers purchased in the store

and their basic information. The user can also print the customers list.

Supplier Module – This module contains the list suppliers that provide products and

their basic information. The user can also print the suppliers list.

History Module – This module contains the actions performed by the user such as

adding and updating data. The changes made by the user is saved along with the date of

operation and who perform the operation.

Password Module – This module will be used when the user requests a password reset.

SYSTEM FEATURES

The features of the ViNOOK IMS revolves around the inventory of the products

and the sold products.

The following figures are the main features in the system:


35

Figure 6 Inventory Page

Figure 6 is the user interface for the inventory page. The features that are

available here are view, store and update product information and print product or stock

list.
36

Figure 7 Sales Page

Figure 7 is the user interface for sales page. The features here are view and store

sales record, the process of decreasing the stock in the system is when a customer

purchased a product. After the product is purchased, it is automatically deducted in the

system. Print sales list.


37

Figure 8A Customers List Page

Figure 8B Suppliers List Page


38

Figure 8C Product Categories Page

Figure 8 shows the user interface for customers list, suppliers list and product

categories respectively. The features here are view, store and update customer and

supplier information respectively. Print customers list and suppliers list.


39

Figure 9 Account Page

Figure 9 is the user interface for account page. Here, the logged in user can update

their information and change password.

Figure 10 History Page


40

Figure 10 is the user interface for the history page, this page shows what

operation the user made in the system.

Figure 11 Password Reset

Figure 11 is the user interface when resetting the password, the user will enter

their email and verification code that was sent in their email in order to reset their

password.

The visual process of the system is described as follows.

Figure 12 Visual Table of the System


41

EVALUATION RESULT

The results of the user’s evaluation of the system are tallied in the following

tables to arrive at the overall result. The researchers conducted the evaluation in Virtual

Nook with the corresponding respondents which is the owner and the cashier, in which

each used the system for testing, with the researchers, presented a demonstration on how

the system works especially the major functions that they needed to be in the system.

The following table shows the overall results of evaluation in terms of

functionality and usability.

Table 5 Overall results of ViNOOK IMS Functionality

Very Very
Excellent Satisfactory Unsatisfactory No. of
FUNCTIONALITY (5)
Satisfactory
(3) (2)
Unsatisfactory
Respondents
Mean Interpretation
(4) (1)
The system has
the suitable set of
functions in 2 2 5 Excellent
accordance with
its objectives
The system has
secure access
2 2 5 Excellent
through the use of
password.
The system
interacts with the
2 2 5 Excellent
specified modules
as intended
The system
displays precise 2 2 5 Excellent
results
The system’s
ability to reset
password on user
request through
1 1 2 4.5 Excellent
verification code
using the email
address provided
in their account
Grand Mean 4.9 Excellent
42

Table 5 shows the evaluation results of the system functionality done by the

owner and the cashier with the grand mean of 4.9 which interprets as “Excellent”. It can

be observed that all of the system functionality obtained the same highest mean of 5

except for the ability to reset password through verification code using email address

which obtained the mean of 4.5. Overall, the system functionality obtained an excellent

rating.

Table 6 Overall results of ViNOOK IMS Usability

Very Very
Excellent Satisfactory Unsatisfactory No. of
USABILITY (5)
Satisfactory
(3) (2)
Unsatisfactory
Respondents
Mean Interpretation
(4) (1)
The system
has a user-
2 2 5 Excellent
friendly
interface
The system
occupied
memory is
2 2 5 Excellent
within the
given
requirement
The system is
responsive on 2 2 5 Excellent
user request
The system
provides a
message
2 2 5 Excellent
dialog when
performing
operations
Grand Mean 5 Excellent

Table 6 shows the evaluation results of the system usability done by the owner

and the cashier with the grand mean of 5 which interprets as “Excellent”.
43

IMPLEMENTATION PLAN

The implementation plan is the document that outlines the steps that must be

taken to execute a plan or project by making a clear implementation procedure.

The ViNOOK IMS was planned to be implemented in a single client computer.

This means that the researchers created an installer in order for the system to be installed

on the client computer. The researchers must make sure that the target computer meets all

the requirements needed for the system to run.

Client-side hardware requirements:

 Computer or Laptop at least 2Ghz dual core processor or higher.

 HDD or SSD Storage with at least 1GB of free space

 RAM with at least 1GB of free space

 Barcode Scanner

 Printer

 Router (with internet connection)

Client-side software requirements

 Windows 10 64bit operating system

 MySQL Server

 Crystal Reports Runtime Engine

 Dot Net Framework 4.7.2

 MS Visual C++ 2019 Redistributable

When all these requirements are met by the client computer the system can now be

installed. The users (owner / cashier) can start the system either from the desktop shortcut

or start menu shortcut.


44
45

CHAPTER 5

RECOMMENDATION

This chapter provides the summary and recommendations for the whole study.

SUMMARY

The main goal of this study was to provide aid by developing a system to

overcome Virtual Nook’s current concerns with inventory management. The system

enabled Virtual Nook to keep track of its products and replenish on time, as well as

which suppliers the products was bought from in order to file accurate warranty claims,

and utilize the First-In, First-Out method in selling the products.

The development of this study adapted the Rapid Application Development

(RAD) methodology. RAD focuses on prototyping and testing of the system, which is

why it was used in this study for the reason of having a limited time to develop the

system.

RECOMMENDATIONS

The system can be enhanced by future interested researchers.

 The ViNOOK IMS can be improved by adding a functionality to send verification

code through SMS.

 Add printing of graph report.

 Add automatic system backup.


46

 Add a photo and signature of customer for basic information required to help law

enforcement agency in anti-theft.

 Add an email order request of low stock products to supplier.

 Add a customer order request through online by integrating the application to web

application, or offline order request directly in the store.


47

REFERENCES

Bhattacharyya, A., Chanu, A., & Dutta, S. (2022). A Study On Inventory Management

Practices: A Review. Journal of Positive School Psychology, 6(2), 587-601.

https://journalppw.com/index.php/jpsp/article/view/12280

Sohel. S., & Bin Osman., A. (2018) "Impact of Supply Chain Drivers on Retail Supply

Chain Performance," The Journal of Social Sciences Research, Academic

Research Publishing Group, vol. 4(10), pages 176-183

Mondol, E. P. (2021). The Impact of Block Chain and Smart Inventory System on Supply

Chain Performance at Retail Industry. International Journal of Computations,

Information and Manufacturing (IJCIM), 1(1).

https://doi.org/10.54489/ijcim.v1i1.30

Kambivi, H., Junirianto, E., & Fadhliyah, NR. (2020). Development of Inventory

Management Application Using Points Of Sale laravel.

https://scholar.google.com/scholar?

q=related:gHeyMvdwkH4J:scholar.google.com/

&hl=en&as_sdt=0,5#d=gs_qabs&t=1667524524898&u=%23p

%3DgHeyMvdwkH4J

Liu W., Wang S., Lin Y., Xie D., Zhang J. (2020) Effect of intelligent logistics

policy on shareholder value: Evidence from Chinese logistics companies

Transportation Research Part E: Logistics and Transportation Review, Volume

137
48

Panganiban, E., & Bermusa, J. (2020). Simplified Barcode-Based Point Of Sales And

Inventory Management System With Replenishment Decision. International

Journal of Scientific & Technology Research.

https://www.researchgate.net/profile/Edward-Panganiban/publication/

363796625_Simplified_Barcode-

Based_Point_Of_Sales_And_Inventory_Management_System_With_Replenishm

ent_Decision/links/632e3cb786b22d3db4d9d381/Simplified-Barcode-Based-

Point-Of-Sales-And-Inventory-Management-System-With-Replenishment-

Decision.pdf

Shahridam, M. A., Nahar, N. N., Devamanoharan, S. K., Azlan, N. S.,

Khairulnizam, A. I., Talib, N. F., & Sha’ari, N. (2022). IMPROVING THE

INVENTORY MANAGEMENT SYSTEM AT SHAMS BEST TECHNIC SDN

BHD BY IMPLEMENTING BARCODE SYSTEM. Joirnal of Technical and

Social Sciences, 1.

https://www.researchgate.net/publication/360699621_IMPROVING_THE_INVE

NTORY_MANAGEMENT_SYSTEM_AT_SHAMS_BEST_TECHNIC_SDN_B

HD_BY_IMPLEMENTING_BARCODE_SYSTEM

Li Bing and Liu Yang 2019 IOP Conf. Ser.: Mater. Sci. Eng. 563 042092

McLeod, S. A. (2019, August 03). Likert scale. Simply Psychology.

www.simplypsychology.org/likert-scale.html
49

5-Point Likert scale: The key to easily understanding your audience. (n.d.). Ombea®.

https://www.ombea.com/resources/articles/5-point-likert-scale-the-key-to-easily-

understanding-your-audience

Just a moment... (n.d.). ResearchGate | Find and share research.

https://www.researchgate.net/figure/Gap-widths-of-quintet-likert-scale-Source-

Author_tbl1_319322734

ISO/IEC 25010:2011. (n.d.). ISO. https://www.iso.org/standard/35733.html


50

APPENDICES

APPENDIX 1 APPROVAL OF PROJECT TITLE

College of Bachelor of Science and Information Technology

Approval for Capstone Project Title


(Thesis / Dissertation)
The following titles are proposed. Justifications are provided on separated sheets
hereto attached.
PROPOSED TITLES
Title 1. Implementation of ViNook Inventory Management System

Title 2. _________________________________________________________________
Title 3. _________________________________________________________________
Submitted by:
Albao, Hannah Isobelle J.
Vargas, Dyn Ryk A.
Villafuerte, Joshua R.
Candidate
BS INFORMATION TECHNOLOGY
Program
Action of Thesis / Dissertation Specialization Committee
(Please affix signature on the preferred title)
Specialization Committee Title 1 Title 2 Title 3
Chairperson:
Members:
1.
2.
3.

APPROVED for Title No. _____


________________________
Dean, College of Information
and Communications
Technology
Date: ___________
51

Title: Implementation of ViNOOK Inventory Management System

Currently, Virtual Nook Computers and General Merchandise have problems


keeping track of their inventory manually. During our interview with Ma’am Rosette
Canlapan the owner of Virtual Nook, they have 3 major concerns. First concern, they
have difficulty recounting the products when tracking which needs replenishment so they
needed something that will give them a warning or notification when a product needs
replenishment so that they can re-order early. Second concern, they needed to keep track
which supplier they bought the product because sometimes they claim warranty on wrong
supplier and to keep track of the coverage of the warranty to know whether the products
warranty is still in effect. Last concern, they needed to apply the FIFO method (First In,
First Out). Their store selling style is to sell all the first batch of products arrived to avoid
exceeding the warranty period but sometimes the products that arrived later were sold
first. So, they needed something that will keep track of these, like when the products
serial number were scanned it will be checked which batch the product arrived and deny
if there are still unsold products on the earlier batch.

As a result of this considering their concerns, our group will develop and
implement an inventory management system. The systems primary objective is to solve
Virtual Nook current concerns and to assist them.

Albao, Hannah Isobelle J.


Vargas, Dyn Ryk A.
Villafuerte, Joshua R.
52

APPENDIX 2 ACCEPTANCE FORM OF ADVISORSHIP

College of Bachelor of Science and Information Technology

ASSIGNMENT OF RESEARCH ADVISER

You are hereby designated as dissertation/thesis adviser for Villafuerte, Joshua


R., Albao, Hannah Isobelle J., Vargas, Dyn Ryk A. whose proposed dissertation/thesis
is entitled Implementation of ViNOOK Inventory Management System.

As such, you are enjoined to provide encouragement, guidance and direction to


your advisee’s undertaking. His/her performance shall be understood to reflect, in large
measure, your capacity and ability to influence a meaningful and effective endeavor.

GEMMA G. ACEDO Ph.D., DIT


Date (Name and Signature of Dean)

ACCEPTANCE OF RESEARCH ADVISORSHIP

The undersigned accepts the advisor ship for the dissertation/thesis writing and
defense effort of                                                                                                              and
hereby commits to provide the necessary encouragement, guidance and direction for the
candidate’s successful completion of his/her dissertation/thesis work.

ASTER VIVIEN VARGAS, MSIT


Date (Name and Signature of Adviser)
53

APPENDIX 3 Project Schedule

Task Mar Apr May June July Aug Sept Oct Nov Dec

Virtual Nook Interview / Data


Gathering

Project Proposal

Writing Manuscript

Consultation with research adviser

System Development

System Test Run


54

APPENDIX 4 Implementation Plan

This document outlines the implementation plan for ViNOOK IMS.

The ViNOOK IMS was implemented in a single client computer. This means that

the researchers created an installer in order for the system to be installed on the client

computer. The researchers made sure that the target computer meets all the requirements

needed for the system to run.

Client-side hardware requirements:

 Computer or Laptop at least 2Ghz dual core processor or higher.

 HDD or SSD Storage with at least 1GB of free space

 RAM with at least 1GB of free space

 Barcode Scanner

 Printer

 Router (with internet connection)

Client-side software requirements

 Windows 10 64bit operating system

 MySQL Server

 Crystal Reports Runtime Engine

 Dot Net Framework 4.7.2

 MS Visual C++ 2019 Redistributable

When all these requirements are met by the client computer the system can now

be installed. The users (owner / cashier) can start the system either from the desktop

shortcut or start menu shortcut.


55

Below shows the process for the implementation of the system:

1. The researchers conducted the evaluation on the client’s hardware if it meets the

minimum requirements needed.

2. The researcher’s setup the hardware to match the system architecture.

3. The researchers installed all the software requirements needed to run the system.

4. The researchers used the ViNOOK IMS installer to implement the system.

5. The researchers launched the ViNOOK IMS Application to be used officially.


56

APPENDIX 5 Modules and Storyboard

Figure 13 Login Form

Figure 13 is the user interface for the login form. The user will enter their

credentials such as the username and password in order to login to the system.

Figure 14 Reset Password


57

Figure 14 shows the user interface when resetting password if forgotten. First the

user will enter email which is saved in the account information and enter the verification

code that will be sent to the email after clicking the sent verification code button. If the

email and code entered are correct the user can now enter the new password.

Figure 15 Inventory Page

Figurer 15 shows the user interface for the inventory page. This is the page where

the user will see the products stock list.


58

Figure 15A Inventory Add New Stock

Figure 15A is where the user will add the new stock along with its specifications

or details by scanning the product code and serial number of the product.

Figure 15B Inventory Add New Product


59

Figure 15B is where the user will add new product if the product has not been

added to the list.

Figure 15C Inventory Stock Report

Figure 15C shows the graphical report of the stocking. The stocks list will be

shown below along their statistics of how many available stocks and how many of them

are sold.
60

Figure 16 Sales Page

Figure 16 shows the user interface for the sales page. All the sales will be listed

here.

Figure 16A Sales Add New Order


61

Figure 16B Sales Save Order

Figure 16A and 16B is where the user will add and save the new order.

Figure 16C Sales Report


62

Figure 16C shows the sales graphical report. The top sold products and how many

of them are sold.

Figure 17 Customers Page

Figure 17 is the user interface for the customers page, the list of the customers

will be shown here as well a simple graph of which customer always buy in the store.
63

Figure 17A Customers Add New

Figure 17B Customers Update Details

Figure 17A and 17B is where the user will add and update customer details.
64

Figure 18 Suppliers Page

Figure 18 is the user interface for the supplier’s page, the suppliers list is shown

here as well as a simple graph of which supplier has supplied the store the most.

Figure 18A Suppliers Add New


65

Figure 18B Suppliers Update Details

Figure 18A and 18B is where the user will add and update new supplier details.

Figure 19 Product Categories Page


66

Figure 19 is the user interface for product categories, all the product categories is

listed here as well as a simple graph of which categories has the most sold products.

Figure 20 User Account Page

Figure 20 is the user interface for the user account details, here the user will be

able to update their profile details as well change password.


67

Figure 21 History Page

Figure 21 shows the operation history of the user in the system such as adding and

updating data.

The following figures below shows the report list or print preview of the selected module:

Figure 22 Print Preview of Inventory


68

Figure 23 Print Preview of Sales

Figure 24 Print Preview of Customers List


69

Figure 25 Print Preview of Suppliers List

Figure 26 Print Preview of Product Categories


70

APPENDIX 6 Relevant Source Codes

Login Module

Public Function verifyLoginCredential(user As userModel) As Boolean


Try
openConnection()
Dim que As String = "select first_name, last_name, username, userpassword, role from user_accounts
where username=@user and userpassword=sha2(@password, 512) and not deleted"
com = New MySqlCommand(que, condb)
With com
.Parameters.Add("@user", MySqlDbType.VarChar).Value = user.username
.Parameters.Add("@password", MySqlDbType.String).Value = user.userpassword
End With
reader = com.ExecuteReader(CommandBehavior.CloseConnection)
If reader.Read = True Then
session_firstname = reader(0)
session_lastname = reader(1)
session_username = reader(2)
session_role = reader(4)
Return True
Else
Return False
End If
Catch ex As MySqlException
MessageBox.Show("Error: " & ex.Message, "Verification Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
Return False
Finally
reader.Close()
closeConnection()
End Try
End Function

User Module

Public Function changePassword(user As userModel) As Boolean


Try
openConnection()
user.updated_at = Date.Now
Dim que As String = "update user_accounts set userpassword=sha2(@pass, 512), updated_at=@updated
where username=@username"
com = New MySqlCommand(que, condb)
With com
.Parameters.Add("@username", MySqlDbType.VarChar).Value = user.username
.Parameters.Add("@pass", MySqlDbType.VarChar).Value = user.userpassword
.Parameters.Add("@updated", MySqlDbType.DateTime).Value = user.updated_at
End With

_content = "Changed Password."


Dim modelHistory As New historyModel(session_username, "UPDATE", "ACCOUNT", _content,
user.updated_at)
71

Dim funcHistory As New historyFunction

If com.ExecuteNonQuery = 1 Then
funcHistory.addToHistory(modelHistory)
Return True
Else
Return False
End If

Catch ex As MySqlException
MessageBox.Show("Error: " & ex.Message, "System Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
Return False
Finally
closeConnection()
End Try
End Function

Public Function updateAccountDetails(user As userModel) As Boolean


Try
openConnection()
user.updated_at = Date.Now
Dim que As String = "update user_accounts set first_name=@fname, last_name=@lname,
phone=@phone, email=@email, address=@address, updated_at=@updated where username=@username"
com = New MySqlCommand(que, condb)
With com
.Parameters.Add("@username", MySqlDbType.VarChar).Value = user.username
.Parameters.Add("@fname", MySqlDbType.VarChar).Value = user.firstname
.Parameters.Add("@lname", MySqlDbType.VarChar).Value = user.lastname
.Parameters.Add("@phone", MySqlDbType.VarChar).Value = user.phone
.Parameters.Add("@email", MySqlDbType.VarChar).Value = user.email
.Parameters.Add("@address", MySqlDbType.VarChar).Value = user.address
.Parameters.Add("@updated", MySqlDbType.DateTime).Value = user.updated_at
End With

If String.Equals(trackAccount_firstname, user.firstname) Then


_firstName = "First Name: " & trackAccount_firstname & Environment.NewLine
Else
_firstName = "First Name: " & trackAccount_firstname & Environment.NewLine
new_firstName = "First Name: " & user.firstname & Environment.NewLine
End If
If String.Equals(trackAccount_lastname, user.lastname) Then
_lastName = "Last Name: " & trackAccount_lastname & Environment.NewLine
Else
_lastName = "Last Name: " & trackAccount_lastname & Environment.NewLine
new_lastName = "Last Name: " & user.lastname & Environment.NewLine
End If
If String.Equals(trackAccount_phone, user.phone) Then
_phone = ""
Else
If trackAccount_phone = "" Then
trackAccount_phone = "None"
End If
If user.phone = "" Then
user.phone = "None"
End If
_phone = "Phone: " & trackAccount_phone & Environment.NewLine
new_phone = "Phone: " & user.phone & Environment.NewLine
End If
72

If String.Equals(trackAccount_email, user.email) Then


_email = ""
Else
If trackAccount_email = "" Then
trackAccount_email = "None"
End If
If user.email = "" Then
user.email = "None"
End If
_email = "Email: " & trackAccount_email & Environment.NewLine
new_email = "Email: " & user.email & Environment.NewLine
End If
If String.Equals(trackAccount_address, user.address) Then
_address = ""
Else
If trackAccount_address = "" Then
trackAccount_address = "None"
End If
If user.address = "" Then
user.address = "None"
End If
_address = "Address: " & trackAccount_address & Environment.NewLine
new_address = "Address: " & user.address & Environment.NewLine
End If

_content = user.username & Environment.NewLine & _firstName & _lastName & _phone & _email &
_address
_newContent = new_firstName & new_lastName & new_phone & new_email & new_address

Dim modelHistory As New historyModel(session_username, "UPDATE", "ACCOUNT", _content,


_newContent, user.updated_at)
Dim funcHistory As New historyFunction

If com.ExecuteNonQuery = 1 Then
funcHistory.addToHistory(modelHistory)
Return True
Else
Return False
End If
Catch ex As MySqlException
MessageBox.Show("Error: " & ex.Message, "Update Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
Return False
Finally
closeConnection()
End Try
End Function

Public Sub getAccountDetails(user As userModel)


Try
openConnection()
Dim que As String = "select username, first_name, last_name, phone, email, address, role from
user_accounts where username=@user"
com = New MySqlCommand(que, condb)
With com
.Parameters.Add("@user", MySqlDbType.VarChar).Value = user.username
End With
reader = com.ExecuteReader(CommandBehavior.CloseConnection)
If reader.Read = True Then
73

user.username = reader("username")
user.firstname = reader("first_name")
user.lastname = reader("last_name")
user.name = user.firstname & " " & user.lastname
user.phone = reader("phone").ToString
user.email = reader("email").ToString
user.address = reader("address").ToString
If reader("role") = 0 Then
user.role = "Administrator"
ElseIf reader("role") = 1 Then
user.role = "Cashier"
End If
End If
Catch ex As MySqlException
MessageBox.Show("Error: " & ex.Message, "Account Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
Finally
reader.Close()
closeConnection()
End Try
End Sub

Inventory Module

Public Function updateStockDetails_Status() As Boolean


Try
openConnection()
Dim que As String = "update products_detail set _status=@status where on_hand=0"
com = New MySqlCommand(que, connection)
With com
.Parameters.Add("@status", MySqlDbType.VarChar).Value = "Sold"
End With
If com.ExecuteNonQuery = 1 Then
Return True
Else
Return False
End If
Catch ex As MySqlException
MessageBox.Show("Error: " & ex.Message, "System Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
Return False
Finally
closeConnection()
End Try
End Function

Public Sub updateAllProducts_QuantityInStock()


Try
openConnection()
Dim que As String = "update products set quantity=(select sum(quantity) from products_detail where
product_id=products.product_id and not deleted), on_hand=(select sum(on_hand) from products_detail where
product_id=products.product_id and not deleted)"
com = New MySqlCommand(que, connection)
com.ExecuteNonQuery()
Catch ex As MySqlException
74

'MessageBox.Show("Error: " & ex.Message, "System Error", MessageBoxButtons.OK,


MessageBoxIcon.Error)
Finally
closeConnection()
End Try
End Sub

Public Function updateProductDetail_StockQuantity(inventory As inventoryModel) As Boolean


Try
openConnection()

Dim que As String = "update products set quantity=(select sum(quantity) from products_detail where
product_id=@id and not deleted), on_hand=(select sum(on_hand) from products_detail where product_id=@id
and not deleted) " &
"where product_id=@id"
com = New MySqlCommand(que, connection)
With com
.Parameters.Add("@id", MySqlDbType.Int64).Value = inventory.productid
End With
If com.ExecuteNonQuery = 1 Then
Return True
Else
Return False
End If
Catch ex As MySqlException
MessageBox.Show("Error: " & ex.Message, "System Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
Return False
Finally
closeConnection()
End Try
End Function

Public Function updateProductDetail(inventory As inventoryModel) As Boolean


Try
openConnection()
inventory.updated_at = Date.Now
Dim que As String = "update products set item_code=@code, _name=@name, brand=@brand,
model=@model, category_id=@category, unit=@unit, price=@price, updated_at=@updated where
product_id=@id"
com = New MySqlCommand(que, connection)
With com
.Parameters.Add("@id", MySqlDbType.Int64).Value = inventory.productid
.Parameters.Add("@code", MySqlDbType.VarChar).Value = inventory.itemcode
.Parameters.Add("@name", MySqlDbType.VarChar).Value = inventory.name
.Parameters.Add("@brand", MySqlDbType.VarChar).Value = inventory.brand
.Parameters.Add("@model", MySqlDbType.VarChar).Value = inventory.model
.Parameters.Add("@category", MySqlDbType.Int64).Value = inventory.category
.Parameters.Add("@unit", MySqlDbType.VarChar).Value = inventory.unit
.Parameters.Add("@price", MySqlDbType.Decimal).Value = inventory.price
.Parameters.Add("@updated", MySqlDbType.DateTime).Value = inventory.updated_at
End With

If String.Equals(trackProduct_itemCode, inventory.itemcode) Then


_itemCode = "Product Code: " & trackProduct_itemCode & Environment.NewLine
Else
_itemCode = "Product Code: " & trackProduct_itemCode & Environment.NewLine
new_itemCode = "Product Code: " & inventory.itemcode & Environment.NewLine
End If
75

If String.Equals(trackProduct_name, inventory.name) Then


_name = "Product Name: " & trackProduct_name & Environment.NewLine
Else
_name = "Product Name: " & trackProduct_name & Environment.NewLine
new_name = "Product Name: " & inventory.name & Environment.NewLine
End If

If String.Equals(trackProduct_brand, inventory.brand) Then


_brand = ""
Else
_brand = "Brand: " & trackProduct_brand & Environment.NewLine
new_brand = "Brand: " & inventory.brand & Environment.NewLine
End If

If String.Equals(trackProduct_model, inventory.model) Then


_model = ""
Else
_model = "Model: " & trackProduct_model & Environment.NewLine
new_model = "Model: " & inventory.model & Environment.NewLine
End If

If String.Equals(trackProduct_category, inventory.categoryname) Then


_category = ""
Else
_category = "Category: " & trackProduct_category & Environment.NewLine
new_category = "Category: " & inventory.categoryname & Environment.NewLine
End If

If String.Equals(trackProduct_unit, inventory.unit) Then


_unit = ""
Else
_unit = "Unit: " & trackProduct_unit & Environment.NewLine
new_unit = "Unit: " & inventory.unit & Environment.NewLine
End If

If String.Equals(Convert.ToString(trackProduct_price), Convert.ToString(inventory.price)) Then


_price = ""
Else
_price = "Price: " & Format(trackProduct_price, "n")
new_price = "Price: " & Format(inventory.price, "n")
End If

_productID = "Product ID: " & inventory.productid & Environment.NewLine

_content = _itemCode & _name & _brand & _model & _category & _unit & _price
_newContent = new_itemCode & new_name & new_brand & new_model & new_category & new_unit
& new_price

Dim modelHistory As New historyModel(session_username, "UPDATE", "PRODUCT", _content,


_newContent, inventory.updated_at)
Dim funcHistory As New historyFunction

If com.ExecuteNonQuery = 1 Then
funcHistory.addToHistory(modelHistory)
Return True
Else
Return False
End If
76

Catch ex As MySqlException
MessageBox.Show("Error: " & ex.Message, "System Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
Return False
Finally
closeConnection()
End Try
End Function

Public Function addNewProduct(inventory As inventoryModel) As Boolean


Try
openConnection()

inventory.created_at = Date.Now
Dim que As String = "insert into products (item_code, _name, brand, model, category_id, unit, price,
created_at, updated_at) " &
"values(@code, @name, @brand, @model, @category, @unit, @price, @created, @updated)"
com = New MySqlCommand(que, connection)
With com
.Parameters.Add("@code", MySqlDbType.VarChar).Value = inventory.itemcode
.Parameters.Add("@name", MySqlDbType.VarChar).Value = inventory.name
.Parameters.Add("@brand", MySqlDbType.VarChar).Value = inventory.brand
.Parameters.Add("@model", MySqlDbType.VarChar).Value = inventory.model
.Parameters.Add("@category", MySqlDbType.Int64).Value = inventory.category
.Parameters.Add("@unit", MySqlDbType.VarChar).Value = inventory.unit
.Parameters.Add("@price", MySqlDbType.Decimal).Value = inventory.price
.Parameters.Add("@created", MySqlDbType.DateTime).Value = inventory.created_at
.Parameters.Add("@updated", MySqlDbType.DateTime).Value = inventory.created_at
End With

_itemCode = "Product Code: " & inventory.itemcode & Environment.NewLine


_name = "Product Name: " & inventory.name & Environment.NewLine
_brand = "Brand: " & inventory.brand & Environment.NewLine
_model = "Model: " & inventory.model & Environment.NewLine
_category = "Category: " & inventory.categoryname & Environment.NewLine
_unit = "Unit: " & inventory.unit & Environment.NewLine
_price = "Price: " & Format(inventory.price, "n")

_content = _itemCode & _name & _brand & _model & _category & _unit & _price
Dim modelHistory As New historyModel(session_username, "CREATE", "PRODUCT", _content,
inventory.created_at)
Dim funcHistory As New historyFunction

If com.ExecuteNonQuery = 1 Then
funcHistory.addToHistory(modelHistory)
Return True
Else
Return False
End If
Catch ex As MySqlException
MessageBox.Show("Error: " & ex.Message, "System Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
Return False
Finally
closeConnection()
End Try
End Function

Public Function updateStockDetail(inventory As inventoryModel) As Boolean


77

Try
openConnection()
inventory.updated_at = Date.Now

Dim que As String = "update products_detail set serial_number=@serial, at_cost=@cost,


supplier_id=@supplier, updated_at=@updated where reference=@id;"
com = New MySqlCommand(que, connection)
With com
.Parameters.Add("@id", MySqlDbType.VarChar).Value = inventory.reference_id
.Parameters.Add("@serial", MySqlDbType.VarChar).Value = inventory.serialnumber
.Parameters.Add("@cost", MySqlDbType.Decimal).Value = inventory.atCost
.Parameters.Add("@supplier", MySqlDbType.VarChar).Value = inventory.supplier
.Parameters.Add("@updated", MySqlDbType.DateTime).Value = inventory.updated_at
End With

If String.Equals(trackStock_serialNumber, inventory.serialnumber) Then


_serialNumber = "Serial Number: " & inventory.serialnumber & Environment.NewLine
Else
_serialNumber = "Serial Number: " & trackStock_serialNumber & Environment.NewLine
new_serialNumber = "Serial Number: " & inventory.serialnumber & Environment.NewLine
End If
If trackStock_atCost <> inventory.atCost Then
_atCost = "At Cost: " & Format(trackStock_atCost, "n") & Environment.NewLine
new_atCost = "At Cost: " & Format(inventory.atCost, "n") & Environment.NewLine
Else
_atCost = ""
End If
If String.Equals(trackStock_suppliername, inventory.suppliername) Then
_supplier = "Supplier: " & trackStock_suppliername
Else
_supplier = "Supplier: " & trackStock_suppliername
new_supplier = "Supplier: " & inventory.suppliername
End If

_detailID = "Product Detail ID: " & inventory.detailid & Environment.NewLine


_name = "Product Name: " & inventory.name & Environment.NewLine

_content = _name & _serialNumber & _atCost & _supplier


_newContent = new_serialNumber & new_atCost & new_supplier

com.ExecuteNonQuery()

Dim modelHistory As New historyModel(session_username, "UPDATE", "STOCK", _content,


_newContent, inventory.updated_at)
Dim funcHistory As New historyFunction
funcHistory.addToHistory(modelHistory)

Return True
Catch ex As MySqlException
MessageBox.Show("Error: " & ex.Message, "System Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
Return False
Finally
closeConnection()
End Try
End Function

Public Function addNewStock(inventory As inventoryModel) As Boolean


Try
78

openConnection()

inventory.created_at = Date.Now
Dim que As String = "insert into products_detail (product_id, serial_number, at_cost, date_in,
supplier_id, _status, reference, created_at, updated_at) " &
"values(@id, @serial, @cost, @datein, @supplier, @status, @reference, @created,
@updated)"
com = New MySqlCommand(que, connection)
With com
.Parameters.Add("@id", MySqlDbType.Int64).Value = inventory.productid
.Parameters.Add("@serial", MySqlDbType.VarChar).Value = inventory.serialnumber
.Parameters.Add("@cost", MySqlDbType.Decimal).Value = inventory.atCost
'.Parameters.Add("@quantity", MySqlDbType.Int64).Value = inventory.quantity
'.Parameters.Add("@onhand", MySqlDbType.Int64).Value = inventory.onhand
.Parameters.Add("@datein", MySqlDbType.DateTime).Value = inventory.created_at
.Parameters.Add("@supplier", MySqlDbType.VarChar).Value = inventory.supplier
.Parameters.Add("@status", MySqlDbType.VarChar).Value = inventory.status
.Parameters.Add("@reference", MySqlDbType.VarChar).Value = Format(Date.Now,
"yyyyMMddHHmmss")
.Parameters.Add("@created", MySqlDbType.DateTime).Value = inventory.created_at
.Parameters.Add("@updated", MySqlDbType.DateTime).Value = inventory.created_at
End With

_productID = "Product ID: " & inventory.productid & Environment.NewLine


_name = "Product Name: " & inventory.name & Environment.NewLine
_serialNumber = "Serial Number: " & inventory.serialnumber & Environment.NewLine
_atCost = "At Cost: " & Format(inventory.atCost, "n") & Environment.NewLine
_quantity = "Quantity: " & inventory.quantity & Environment.NewLine
_supplier = "Supplier: " & inventory.suppliername

_content = _productID & _name & _serialNumber & _atCost & _quantity & _supplier
Dim modelHistory As New historyModel(session_username, "ADD", "STOCK", _content,
inventory.created_at)
Dim funcHistory As New historyFunction

Do While inventory.quantity >= 1


com.ExecuteNonQuery()
inventory.quantity -= 1
Loop

funcHistory.addToHistory(modelHistory)
Return True
Catch ex As MySqlException
MessageBox.Show("Error: " & ex.Message, "System Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
Return False
Finally
closeConnection()
End Try
End Function

Public Sub getProductDetails(inventory As inventoryModel, opt As String)


Try
openConnection()
Dim que As String = ""
If opt = "id" Then
que = "select products.product_id, products.item_code, products._name, products.brand,
products.model, categories.category_id, categories.category, products.quantity, products.on_hand, products.unit,
products.price " &
79

"from products inner join categories on products.category_id=categories.category_id " &


"where product_id=@id"
ElseIf opt = "itemcode" Then
que = "select products.product_id, products.item_code, products._name, products.brand,
products.model, categories.category_id, categories.category, products.quantity, products.on_hand, products.unit,
products.price " &
"from products inner join categories on products.category_id=categories.category_id " &
"where item_code=@code"
End If
com = New MySqlCommand(que, connection)
With com
.Parameters.Add("@id", MySqlDbType.Int64).Value = inventory.productid
.Parameters.Add("@code", MySqlDbType.VarChar).Value = inventory.itemcode
End With
reader = com.ExecuteReader(CommandBehavior.CloseConnection)
If reader.Read = True Then
inventory.productid = reader("product_id")
inventory.itemcode = reader("item_code")
inventory.name = reader("_name")
inventory.brand = reader("brand")
inventory.model = reader("model")
inventory.category = reader("category_id")
inventory.categoryname = reader("category")
inventory.quantity = reader("quantity")
inventory.onhand = reader("on_hand")
inventory.unit = reader("unit")
inventory.price = reader("price")
End If
Catch ex As MySqlException
MessageBox.Show("Error: " & ex.Message, "System Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
Finally
reader.Close()
closeConnection()
End Try
End Sub

Public Sub populateSearchProductsDataGrid(dgv As DataGridView, search As String, category As String)


Try
openConnection()
Dim que As String = ""
If category = "ALL" Then
que = "select products.product_id, products.item_code, products._name, products.brand,
products.model, categories.category, products.on_hand, products.unit, products.price " &
"from products inner join categories on products.category_id=categories.category_id " &
"where (item_code like @code or _name like @name or concat(brand, ' ', model) like @bmodel)
and not products.deleted
order by category, brand, _name"
Else
que = "select products.product_id, products.item_code, products._name, products.brand,
products.model, categories.category, products.on_hand, products.unit, products.price " &
"from products inner join categories on products.category_id=categories.category_id " &
"where (item_code like @code or _name like @name or concat(brand, ' ', model) like @bmodel)
and category=@category
and not products.deleted
order by category, brand, _name"
End If
com = New MySqlCommand(que, connection)
With com
80

.Parameters.Add("@code", MySqlDbType.VarChar).Value = "%" & search & "%"


.Parameters.Add("@name", MySqlDbType.VarChar).Value = "%" & search & "%"
.Parameters.Add("@bmodel", MySqlDbType.VarChar).Value = "%" & search & "%"
.Parameters.Add("@category", MySqlDbType.VarChar).Value = category
End With

reader = com.ExecuteReader(CommandBehavior.CloseConnection)
dgv.Rows.Clear()

Do While reader.Read = True


dgv.Rows.Add(reader(0), reader(1), reader(2), reader(3), reader(4), reader(5), reader(6), reader(7),
reader(8))
Loop
Catch ex As MySqlException
MessageBox.Show("Error: " & ex.Message, "System Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
Finally
reader.Close()
closeConnection()
End Try
End Sub

Public Function checkIfProductExist(productId As Long) As Boolean


Try
openConnection()
Dim que As String = "select product_id from products_detail where product_id=@id"
com = New MySqlCommand(que, connection)
com.Parameters.Add("@id", MySqlDbType.Int64).Value = productId
reader = com.ExecuteReader(CommandBehavior.CloseConnection)
If reader.Read = True Then
Return True
Else
Return False
End If
Catch ex As MySqlException
MessageBox.Show("Error: " & ex.Message, "System Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
Return False
Finally
closeConnection()
End Try
End Function

Public Sub getProductsDetails_NewStock(inventory As inventoryModel)


Try
openConnection()
Dim que As String = "select products.product_id, products.item_code, products._name, products.brand,
products.model, categories.category_id, categories.category, products.quantity, products.on_hand, products.unit,
products.price " &
"from products inner join categories on products.category_id=categories.category_id " &
"where item_code=@code and not products.deleted"
com = New MySqlCommand(que, connection)
With com
.Parameters.Add("@id", MySqlDbType.Int64).Value = inventory.productid
.Parameters.Add("@code", MySqlDbType.VarChar).Value = inventory.itemcode
End With
reader = com.ExecuteReader(CommandBehavior.CloseConnection)
If reader.Read = True Then
inventory.productid = reader("product_id")
81

inventory.itemcode = reader("item_code")
inventory.name = reader("_name")
inventory.brand = reader("brand")
inventory.model = reader("model")
inventory.category = reader("category_id")
inventory.categoryname = reader("category")
inventory.quantity = reader("quantity")
inventory.onhand = reader("on_hand")
inventory.unit = reader("unit")
inventory.price = reader("price")
End If
Catch ex As MySqlException
MessageBox.Show("Error: " & ex.Message, "System Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
Finally
reader.Close()
closeConnection()
End Try
End Sub

Public Sub populateDGVInventory(dgv As DataGridView, search As String, category As String)


Try
openConnection()
Dim que As String = ""

If category = "ALL" Then


que = "select products.product_id, products.item_code, products._name, products.brand,
products.model, categories.category, products.on_hand, products.unit, products.price
From products inner Join categories On products.category_id=categories.category_id
Where (item_code Like @code or _name like @name or concat(brand, ' ', model) like @bmodel)
and not products.deleted
Order By category, brand, model, _name"
Else
que = "Select products.product_id, products.item_code, products._name, products.brand,
products.model, categories.category, products.on_hand, products.unit, products.price
from products inner join categories On products.category_id=categories.category_id
where(item_code Like @code Or _name Like @name Or concat(brand, ' ', model) like @bmodel)
and category=@category
and not products.deleted
order by category, brand, model, _name"
End If

com = New MySqlCommand(que, connection)


With com
.Parameters.Add("@code", MySqlDbType.VarChar).Value = "%" & search & "%"
.Parameters.Add("@name", MySqlDbType.VarChar).Value = "%" & search & "%"
.Parameters.Add("@bmodel", MySqlDbType.VarChar).Value = "%" & search & "%"
.Parameters.Add("@category", MySqlDbType.VarChar).Value = category
End With

reader = com.ExecuteReader(CommandBehavior.CloseConnection)
dgv.Rows.Clear()

Do While reader.Read = True


dgv.Rows.Add(reader(0), reader(1), reader(2), reader(3), reader(4), reader(5), reader(6), reader(7),
reader(8))
Loop
Catch ex As MySqlException
82

MessageBox.Show("Error: " & ex.Message, "System Error", MessageBoxButtons.OK,


MessageBoxIcon.Error)
Finally
reader.Close()
closeConnection()
End Try
End Sub

Sales Module

Public Function insertOrderDetails(order As orderModel) As Boolean


Try
openConnection()

order.created_at = Date.Now
Dim que As String = "insert into orders_detail (transaction_code, serial_number, _name, brand, model,
category, supplier, quantity, unit, price, total, warranty_start, warranty_end, product_id, created_at, updated_at) "
&
"values (@code, @serial, @name, @brand, @model, @category, @supplier, @quantity,
@unit, @price, @total, @warrantyStart, @warrantyEnd, @product_id, @created, @updated)"
com = New MySqlCommand(que, condb)
With com
.Parameters.Add("@code", MySqlDbType.Int64).Value = order.transactionCode
.Parameters.Add("@serial", MySqlDbType.VarChar).Value = order.serialnumber
.Parameters.Add("@name", MySqlDbType.VarChar).Value = order.productname
.Parameters.Add("@brand", MySqlDbType.VarChar).Value = order.productbrand
.Parameters.Add("@model", MySqlDbType.VarChar).Value = order.productmodel
.Parameters.Add("@category", MySqlDbType.VarChar).Value = order.productcategory
.Parameters.Add("@supplier", MySqlDbType.VarChar).Value = order.suppliername
.Parameters.Add("@quantity", MySqlDbType.Int64).Value = order.quantity
.Parameters.Add("@unit", MySqlDbType.VarChar).Value = order.unit
.Parameters.Add("@price", MySqlDbType.Decimal).Value = order.price
.Parameters.Add("@total", MySqlDbType.Decimal).Value = order.total
.Parameters.Add("@warrantyStart", MySqlDbType.Date).Value = order.warrantystart
.Parameters.Add("@warrantyEnd", MySqlDbType.Date).Value = order.warrantyend
.Parameters.Add("@product_id", MySqlDbType.Int64).Value = order.productid
.Parameters.Add("@created", MySqlDbType.DateTime).Value = order.created_at
.Parameters.Add("@updated", MySqlDbType.DateTime).Value = order.created_at
End With

If com.ExecuteNonQuery = 1 Then
Return True
Else
Return False
End If
Catch ex As MySqlException
MessageBox.Show("Error: " & ex.Message, "System Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
Return False
Finally
closeConnection()
End Try
End Function

Public Function saveNewOrder(order As ordersModel) As Boolean


Try
83

openConnection()

order.created_at = Date.Now
Dim que As String = "insert into orders (transaction_code, invoice_no, order_date, customer,
total_amount, balance, received_amount, _change, payment_type, cheque_no, pay_status, created_at,
updated_at) " &
"values (@code, @invoice, @orderDate, @customer, @total, @balance, @received,
@change, @payment_type, @cheque_no, @paystatus, @created, @updated)"
com = New MySqlCommand(que, condb)
With com
.Parameters.Add("@code", MySqlDbType.Int64).Value = order.transactioncode
.Parameters.Add("@invoice", MySqlDbType.Int64).Value = order.invoice
.Parameters.Add("@orderDate", MySqlDbType.DateTime).Value = order.created_at 'order_date
.Parameters.Add("@customer", MySqlDbType.Int64).Value = order.customerid
.Parameters.Add("@total", MySqlDbType.Decimal).Value = order.totalamountdue
.Parameters.Add("@balance", MySqlDbType.Decimal).Value = order.balance
.Parameters.Add("@received", MySqlDbType.Decimal).Value = order.received_amount
.Parameters.Add("@change", MySqlDbType.Decimal).Value = order.change
.Parameters.Add("@payment_type", MySqlDbType.VarChar).Value = order.paymenttype
.Parameters.Add("@cheque_no", MySqlDbType.VarChar).Value = order.cheque_no
.Parameters.Add("@paystatus", MySqlDbType.VarChar).Value = order.paystatus
.Parameters.Add("@created", MySqlDbType.DateTime).Value = order.created_at
.Parameters.Add("@updated", MySqlDbType.DateTime).Value = order.created_at
End With

_transactionCode = "Transaction Code: " & order.transactioncode & Environment.NewLine


_invoice = "Invoice Number: " & order.invoice & Environment.NewLine
_customerID = "Customer: " & order.customername & Environment.NewLine
_totalAmountDue = "Total Amount: " & order.totalamountdue & Environment.NewLine
_received_amount = "Received Amount: " & order.received_amount & Environment.NewLine
_paymentType = "Payment Type: " & order.paymenttype & Environment.NewLine
If order.cheque_no = "" Then
_cheque_no = ""
Else
_cheque_no = "Cheque Number: " & order.cheque_no
End If

_content = _transactionCode & _invoice & _customerID & _totalAmountDue & _received_amount &
_paymentType & _cheque_no
Dim modelHistory As New historyModel(session_username, "CREATE", "ORDER", _content,
order.created_at)
Dim funchistory As New historyFunction

If com.ExecuteNonQuery = 1 Then
funchistory.addToHistory(modelHistory)
Return True
Else
Return False
End If
Catch ex As MySqlException
MessageBox.Show("Error: " & ex.Message, "System Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
Return False
Finally
closeConnection()
End Try
End Function
#End Region
84

Public Sub getCustomerDetails(customer As customerModel)


Try
openConnection()
Dim que As String = "select customer_id, _name, address, phone, tinID " &
"from customers " &
"where _name=@name and not deleted"
com = New MySqlCommand(que, condb)
With com
.Parameters.Add("@name", MySqlDbType.VarChar).Value = customer.name
End With
reader = com.ExecuteReader(CommandBehavior.CloseConnection)
If reader.Read = True Then
customer.id = reader(0)
customer.name = reader(1)
customer.address = reader(2)
customer.phone = reader(3).ToString
customer.tin_id = reader(4).ToString
End If
Catch ex As MySqlException
MessageBox.Show("Error: " & ex.Message, "System Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
Finally
reader.Close()
closeConnection()
End Try
End Sub

Public Sub getOrderDetails(order As ordersModel)


Try
openConnection()
Dim que As String = "select orders.transaction_code, orders.invoice_no, orders.order_date,
customers._name, customers.address, orders.total_amount, orders.payment_type, orders.cheque_no " &
"from orders inner join customers on orders.customer=customers.customer_id " &
"where transaction_code=@code"
com = New MySqlCommand(que, condb)
With com
.Parameters.Add("@code", MySqlDbType.VarChar).Value = order.transactioncode
End With
reader = com.ExecuteReader(CommandBehavior.CloseConnection)
If reader.Read = True Then
order.transactioncode = reader("transaction_code")
order.invoice = reader("invoice_no")
order.orderdate = reader("order_date")
order.customername = reader("_name")
order.customeraddress = reader("address")
order.totalamountdue = reader("total_amount")
order.paymenttype = reader("payment_type")
order.cheque_no = reader("cheque_no")
End If
Catch ex As MySqlException
MessageBox.Show("Error: " & ex.Message, "System Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
Finally
reader.Close()
closeConnection()
End Try
End Sub

Public Sub populateOrderItemsDatagrid(dgv As DataGridView, search As String, transactionCode As Long)


85

Try
openConnection()
Dim que As String = "select order_detailID, serial_number, _name, brand, model, category, supplier,
quantity, unit, price, total, warranty_start, warranty_end " &
"from orders_detail " &
"where (serial_number like @serial Or _name like @name Or concat(brand, ' ', model) like
@bmodel) and transaction_code=@code and not deleted order by order_detailID"
com = New MySqlCommand(que, condb)
With com
.Parameters.Add("@code", MySqlDbType.Int64).Value = transactionCode
.Parameters.Add("@serial", MySqlDbType.VarChar).Value = "%" & search & "%"
.Parameters.Add("@name", MySqlDbType.VarChar).Value = "%" & search & "%"
.Parameters.Add("@bmodel", MySqlDbType.VarChar).Value = "%" & search & "%"
End With
reader = com.ExecuteReader(CommandBehavior.CloseConnection)
dgv.Rows.Clear()
Do While reader.Read = True
dgv.Rows.Add(reader(0), reader(1), reader(2), reader(3), reader(4), reader(5), reader(6), reader(7),
reader(8), reader(9), reader(10), reader(11), reader(12))
Loop
Catch ex As MySqlException
MessageBox.Show("Error: " & ex.Message, "System Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
Finally
reader.Close()
closeConnection()
End Try
End Sub

Public Sub populateOrdersDataGrid(dgv As DataGridView, search As String, orderDate As Date)


Try
openConnection()
Dim que As String = "select orders.transaction_code, orders.invoice_no, orders.order_date,
customers._name, customers.address, orders.total_amount, orders.payment_type
from orders inner join customers on orders.customer=customers.customer_id
where (_name like @name or transaction_code like @code or invoice_no like @invoice)
and DATE(order_date)=@date
and (not orders.deleted and not customers.deleted)
order by order_date desc, customers._name"

com = New MySqlCommand(que, condb)


With com
.Parameters.Add("@name", MySqlDbType.VarChar).Value = "%" & search & "%"
.Parameters.Add("@code", MySqlDbType.VarChar).Value = "%" & search & "%"
.Parameters.Add("@invoice", MySqlDbType.VarChar).Value = "%" & search & "%"
.Parameters.Add("@date", MySqlDbType.Date).Value = orderDate
End With
reader = com.ExecuteReader(CommandBehavior.CloseConnection)
dgv.Rows.Clear()
Do While reader.Read = True
dgv.Rows.Add(reader(0), reader(1), reader(2), reader(3), reader(4), reader(5), reader(6))
Loop
Catch ex As MySqlException
MessageBox.Show("Error: " & ex.Message, "System Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
Finally
reader.Close()
closeConnection()
End Try
86

End Sub

Customer Module

Public Function updateCustomerDetail(customer As customerModel) As Boolean


Try
openConnection()

customer.updated_at = Date.Now
Dim que As String = "update customers set _name=@name, address=@address, phone=@phone,
tinID=@tinid, updated_at=@updated_at " &
"where customer_id=@id"
com = New MySqlCommand(que, condb)
With com
.Parameters.Add("@id", MySqlDbType.Int64).Value = customer.id
.Parameters.Add("@name", MySqlDbType.VarChar).Value = customer.name
.Parameters.Add("@address", MySqlDbType.VarChar).Value = customer.address
.Parameters.Add("@phone", MySqlDbType.VarChar).Value = customer.phone
.Parameters.Add("@tinid", MySqlDbType.LongText).Value = customer.tin_id
.Parameters.Add("@updated_at", MySqlDbType.DateTime).Value = customer.updated_at
End With

_id = "Customer No.: " & customer.id & Environment.NewLine

If String.Equals(trackCustomer_name, customer.name) Then


_name = "Customer Name: " & trackCustomer_name & Environment.NewLine
Else
_name = "Customer Name: " & trackCustomer_name & Environment.NewLine
new_name = "Customer Name: " & customer.name & Environment.NewLine
End If

If String.Equals(trackCustomer_address, customer.address) Then


_address = ""
Else
_address = "Address: " & trackCustomer_address & Environment.NewLine
new_address = "Address: " & customer.address & Environment.NewLine
End If
If String.Equals(trackCustomer_phone, customer.phone) Then
_phone = ""
Else
If trackCustomer_phone = "" Then
trackCustomer_phone = "None"
End If
If customer.phone = "" Then
customer.phone = "None"
End If
_phone = "Phone: " & trackCustomer_phone & Environment.NewLine
new_phone = "Phone: " & customer.phone & Environment.NewLine
End If
If String.Equals(trackCustomer_tinID, customer.tin_id) Then
_tinID = ""
Else
If trackCustomer_tinID = "" Then
trackCustomer_tinID = "None"
End If
If customer.tin_id = "" Then
87

customer.tin_id = "None"
End If
_tinID = "TIN ID: " & trackCustomer_tinID
new_tinID = "TIN ID: " & customer.tin_id
End If

_content = _name & _address & _phone & _tinID


_newContent = new_name & new_address & new_phone & new_tinID

Dim modelHistory As New historyModel(session_username, "UPDATE", "CUSTOMER", _content,


_newContent, customer.updated_at)
Dim funcHistory As New historyFunction

If com.ExecuteNonQuery = 1 Then
funcHistory.addToHistory(modelHistory)
Return True
Else
Return False
End If
Catch ex As MySqlException
MessageBox.Show("Error: " & ex.Message, "System Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
Return False
Finally
closeConnection()
End Try
End Function

Public Function addNewCustomer(customer As customerModel) As Boolean


Try
openConnection()
customer.created_at = Date.Now
Dim que As String = "insert into customers (_name, address, phone, tinID, created_at, updated_at) " &
"values(@name, @address, @phone, @tinid, @created, @updated)"
com = New MySqlCommand(que, condb)
With com
.Parameters.Add("@name", MySqlDbType.VarChar).Value = customer.name
.Parameters.Add("@address", MySqlDbType.VarChar).Value = customer.address
.Parameters.Add("@phone", MySqlDbType.VarChar).Value = customer.phone
.Parameters.Add("@tinid", MySqlDbType.LongText).Value = customer.tin_id
.Parameters.Add("@created", MySqlDbType.DateTime).Value = customer.created_at
.Parameters.Add("@updated", MySqlDbType.DateTime).Value = customer.created_at
End With

If Not customer.name = "" Then


_name = "Customer Name: " & customer.name & Environment.NewLine
Else
_name = ""
End If
If Not customer.address = "" Then
_address = "Address: " & customer.address & Environment.NewLine
Else
_address = ""
End If
If Not customer.phone = "" Then
_phone = "Phone: " & customer.phone & Environment.NewLine
Else
_phone = ""
End If
88

If Not customer.tin_id = "" Then


_tinID = "TIN ID: " & customer.tin_id
Else
_tinID = ""
End If

_content = _name & _address & _phone & _tinID


Dim modelHistory As New historyModel(session_username, "CREATE", "CUSTOMER", _content,
customer.created_at)
Dim funcHistory As New historyFunction

If com.ExecuteNonQuery = 1 Then
funcHistory.addToHistory(modelHistory)
Return True
Else
Return False
End If
Catch ex As MySqlException
MessageBox.Show("Error: " & ex.Message, "System Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
Return False
Finally
closeConnection()
End Try
End Function

Public Function getTopCustomers() As DataTable


Dim topCustomerList As New DataTable
With topCustomerList
.Columns.Add("customer", GetType(String))
.Columns.Add("orders", GetType(Long))
End With

Using connection()
openConnection()
Using command As New MySqlCommand
With command
.Connection = connection()
.CommandText = "select distinct _name,
(select count(customer)
from orders
where orders.customer=customers.customer_id) as OrderCount
from customers
inner join orders on customers.customer_id=orders.customer
where not orders.deleted
order by OrderCount desc, order_date
limit 5;"
End With
Using dataReader As MySqlDataReader = command.ExecuteReader
While dataReader.Read
topCustomerList.Rows.Add(dataReader(0).ToString, Convert.ToInt64(dataReader(1)))
End While
End Using

With command
.CommandText = "select count(customer_id) as TotalCustomer
from customers where not deleted;"
End With
totalCustomer = Convert.ToInt64(command.ExecuteScalar)
89

End Using
closeConnection()
End Using
Return topCustomerList
End Function

Public Function checkIfCustomerExists(txt As String) As Boolean


Try
openConnection()
Dim que As String = "select customer_id, _name from customers " &
"where _name=@name and not deleted"
com = New MySqlCommand(que, condb)
com.Parameters.Add("@name", MySqlDbType.VarChar).Value = txt
reader = com.ExecuteReader(CommandBehavior.CloseConnection)
If reader.Read = True Then
Return True
Else
Return False
End If
Catch ex As MySqlException
MessageBox.Show("Error: " & ex.Message, "System Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
Return False
Finally
closeConnection()
End Try
End Function

Public Sub getCustomerDetails(customer As customerModel)


Try
openConnection()
Dim que As String = "select customer_id, _name, address, phone, tinID from customers where
customer_id=@id"
com = New MySqlCommand(que, condb)
com.Parameters.Add("@id", MySqlDbType.Int64).Value = customer.id
reader = com.ExecuteReader(CommandBehavior.CloseConnection)
If reader.Read = True Then
customer.id = reader(0)
customer.name = reader(1)
customer.address = reader(2)
customer.phone = reader(3).ToString
customer.tin_id = reader(4).ToString
End If
Catch ex As MySqlException
MessageBox.Show("Error: " & ex.Message, "System Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
Finally
reader.Close()
closeConnection()
End Try
End Sub

Public Sub populateDGVCustomer(dgv As DataGridView, search As String)


Try
openConnection()
Dim que As String = "select customer_id, _name, address, phone, tinID from customers " &
"where _name like @name or customer_id like @id and not deleted order by _name"
com = New MySqlCommand(que, condb)
With com
90

.Parameters.Add("@id", MySqlDbType.VarChar).Value = "%" & search & "%"


.Parameters.Add("@name", MySqlDbType.VarChar).Value = "%" & search & "%"
End With

reader = com.ExecuteReader(CommandBehavior.CloseConnection)
dgv.Rows.Clear()

Do While reader.Read = True


dgv.Rows.Add(reader(0), reader(1), reader(2), reader(3), reader(4))
Loop
Catch ex As MySqlException
MessageBox.Show("Error: " & ex.Message, "System Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
Finally
reader.Close()
closeConnection()
End Try
End Sub

Supplier Module

Public Function updateSupplierDetail(supplier As supplierModel) As Boolean


Try
openConnection()

supplier.updated_at = Date.Now
Dim que As String = "update suppliers set _name=@name, address=@address, phone=@phone,
email=@email, other_details=@otherdetails, updated_at=@updated_at " &
"where supplier_id=@id"
com = New MySqlCommand(que, condb)
With com
.Parameters.Add("@id", MySqlDbType.Int64).Value = supplier.supplierid
.Parameters.Add("@name", MySqlDbType.VarChar).Value = supplier.name
.Parameters.Add("@address", MySqlDbType.VarChar).Value = supplier.address
.Parameters.Add("@phone", MySqlDbType.VarChar).Value = supplier.phone
.Parameters.Add("@email", MySqlDbType.VarChar).Value = supplier.email
.Parameters.Add("@otherdetails", MySqlDbType.LongText).Value = supplier.other_details
.Parameters.Add("@updated_at", MySqlDbType.DateTime).Value = supplier.updated_at
End With

If String.Equals(tracking_Suppliername, supplier.name) Then


name = "Supplier Name: " & tracking_Suppliername & Environment.NewLine
Else
name = "Supplier Name: " & tracking_Suppliername & Environment.NewLine
new_name = "Supplier Name: " & supplier.name & Environment.NewLine
End If
If String.Equals(tracking_Supplieraddress, supplier.address) Then
address = ""
Else
address = "Address: " & tracking_Supplieraddress & Environment.NewLine
new_address = "Address: " & supplier.address & Environment.NewLine
End If
If String.Equals(tracking_Supplierphone, supplier.phone) Then
phone = ""
Else
If tracking_Supplierphone = "" Then
91

tracking_Supplierphone = "None"
End If
If supplier.phone = "" Then
supplier.phone = "None"
End If
phone = "Phone: " & tracking_Supplierphone & Environment.NewLine
new_phone = "Phone: " & supplier.phone & Environment.NewLine
End If
If String.Equals(tracking_Supplieremail, supplier.email) Then
email = ""
Else
If tracking_Supplieremail = "" Then
tracking_Supplieremail = "None"
End If
If supplier.email = "" Then
supplier.email = "None"
End If
email = "Email: " & tracking_Supplieremail & Environment.NewLine
new_email = "Email: " & supplier.email & Environment.NewLine
End If
If String.Equals(tracking_SupplierotherDetails, supplier.other_details) Then
otherDetails = ""
Else
If tracking_SupplierotherDetails = "" Then
tracking_SupplierotherDetails = "None"
End If
If supplier.other_details = "" Then
supplier.other_details = "None"
End If
otherDetails = "Other Details: " & tracking_SupplierotherDetails
new_otherDetails = "Other Details: " & supplier.other_details
End If

id = "Supplier ID: " & supplier.supplierid & Environment.NewLine

content = name & address & phone & email & otherDetails
_newContent = new_name & new_address & new_phone & new_email & new_otherDetails
Dim modelHistory As New historyModel(session_username, "UPDATE", "SUPPLIER", content,
_newContent, supplier.updated_at)
Dim funcHistory As New historyFunction

If com.ExecuteNonQuery = 1 Then
funcHistory.addToHistory(modelHistory)
Return True
Else
Return False
End If
Catch ex As MySqlException
MessageBox.Show("Error: " & ex.Message, "System Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
Return False
Finally
closeConnection()
End Try

End Function

Public Function addNewSupplier(supplier As supplierModel) As Boolean


Try
92

openConnection()
supplier.created_at = Date.Now
Dim que As String = "insert into suppliers (_name, address, phone, email, other_details, created_at,
updated_at) " &
"values(@name, @address, @phone, @email, @otherdetails, @created, @updated)"
com = New MySqlCommand(que, condb)
With com
.Parameters.Add("@name", MySqlDbType.VarChar).Value = supplier.name
.Parameters.Add("@address", MySqlDbType.VarChar).Value = supplier.address
.Parameters.Add("@phone", MySqlDbType.VarChar).Value = supplier.phone
.Parameters.Add("@email", MySqlDbType.VarChar).Value = supplier.email
.Parameters.Add("@otherdetails", MySqlDbType.LongText).Value = supplier.other_details
.Parameters.Add("@created", MySqlDbType.DateTime).Value = supplier.created_at
.Parameters.Add("@updated", MySqlDbType.DateTime).Value = supplier.created_at
End With

If Not supplier.name = "" Then


name = "Supplier Name: " & supplier.name & Environment.NewLine
Else
name = ""
End If
If Not supplier.address = "" Then
address = "Address: " & supplier.address & Environment.NewLine
Else
address = ""
End If
If Not supplier.phone = "" Then
phone = "Phone: " & supplier.phone & Environment.NewLine
Else
phone = ""
End If
If Not supplier.email = "" Then
email = "Email: " & supplier.email & Environment.NewLine
Else
email = ""
End If
If Not supplier.other_details = "" Then
otherDetails = "Other Details: " & supplier.other_details
Else
otherDetails = ""
End If

content = name & address & phone & email & otherDetails
Dim modelHistory As New historyModel(session_username, "CREATE", "SUPPLIER", content,
supplier.created_at)
Dim funcHistory As New historyFunction

If com.ExecuteNonQuery = 1 Then
funcHistory.addToHistory(modelHistory)
Return True
Else
Return False
End If

Catch ex As MySqlException
MessageBox.Show("Error: " & ex.Message, "System Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
Return False
Finally
93

closeConnection()
End Try
End Function

Public Function getTopSupplier() As DataTable


Dim topSupplierList As New DataTable
With topSupplierList
.Columns.Add("supplier", GetType(String))
.Columns.Add("stock", GetType(Long))
End With

Using connection()
openConnection()
Using command As New MySqlCommand
With command
.Connection = connection()
.CommandText = "select _name,
(select count(quantity) from products_detail
where products_detail.supplier_id=suppliers.supplier_id
and not products_detail.deleted) as numProducts
from suppliers
order by numProducts desc
limit 5;"
End With
Using dataReader As MySqlDataReader = command.ExecuteReader
While dataReader.Read
topSupplierList.Rows.Add(dataReader(0).ToString, Convert.ToInt64(dataReader(1)))
End While
End Using
With command
.CommandText = "select count(supplier_id) as TotalSuppliers
from suppliers where not deleted;"
End With
totalSuppliers = Convert.ToInt64(command.ExecuteScalar)
End Using
closeConnection()
End Using
Return topSupplierList
End Function

Public Function checkIfSupplierExists(txt As String) As Boolean


Try
openConnection()
Dim que As String = "select supplier_id, _name from suppliers " &
"where _name=@name and not deleted"
com = New MySqlCommand(que, condb)
With com
.Parameters.Add("@name", MySqlDbType.VarChar).Value = txt
End With
reader = com.ExecuteReader(CommandBehavior.CloseConnection)
If reader.Read = True Then
Return True
Else
Return False
End If

Catch ex As MySqlException
MessageBox.Show("Error: " & ex.Message, "System Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
94

Return False
Finally
reader.Close()
closeConnection()
End Try
End Function

'view
Public Sub getSupplierDetails(supplier As supplierModel)
Try
openConnection()
Dim que As String = "select supplier_id, _name, address, phone, email, other_details from suppliers " &
"where supplier_id=@id"
com = New MySqlCommand(que, condb)
com.Parameters.Add("@id", MySqlDbType.Int64).Value = supplier.supplierid
reader = com.ExecuteReader(CommandBehavior.CloseConnection)
If reader.Read = True Then
supplier.supplierid = reader(0)
supplier.name = reader(1)
supplier.address = reader(2)
supplier.phone = reader(3).ToString
supplier.email = reader(4).ToString
supplier.other_details = reader(5).ToString
End If
Catch ex As MySqlException
MessageBox.Show("Error: " & ex.Message, "System Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
Finally
reader.Close()
closeConnection()
End Try
End Sub

'load supplier list


Public Sub populateDGVSupplier(dgv As DataGridView, search As String)
Try
openConnection()
Dim que As String = "select supplier_id, _name, address, phone, email from suppliers " &
"where _name like @name or supplier_id like @id and not deleted order by _name"
com = New MySqlCommand(que, condb)
With com
.Parameters.Add("@id", MySqlDbType.VarChar).Value = "%" & search & "%"
.Parameters.Add("@name", MySqlDbType.VarChar).Value = "%" & search & "%"
End With

reader = com.ExecuteReader(CommandBehavior.CloseConnection)
dgv.Rows.Clear()

Do While reader.Read = True


dgv.Rows.Add(reader(0), reader(1), reader(2), reader(3), reader(4))
Loop
Catch ex As MySqlException
MessageBox.Show("Error: " & ex.Message, "System Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
Finally
reader.Close()
closeConnection()
End Try
End Sub
95

History Module

Public Sub addToHistory(history As historyModel)


Try
openConnection()
Dim que As String = "insert into sys_history (username, _action, title, content, newContent, _date) " &
"values(@username, @action, @title, @content, @new, @date)"
com = New MySqlCommand(que, condb)
With com
.Parameters.Add("@username", MySqlDbType.VarChar).Value = history.username
.Parameters.Add("@action", MySqlDbType.VarChar).Value = history.action
.Parameters.Add("@title", MySqlDbType.VarChar).Value = history.title
.Parameters.Add("@content", MySqlDbType.LongText).Value = history.content
.Parameters.Add("@new", MySqlDbType.LongText).Value = history.newcontent
.Parameters.Add("@date", MySqlDbType.DateTime).Value = history.execdate
End With
com.ExecuteNonQuery()
Catch ex As MySqlException
MessageBox.Show("Error: " & ex.Message, "System Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
Finally
closeConnection()
End Try
End Sub

Public Sub getHistoryDetails(history As historyModel)


Try
openConnection()
Dim que As String = "select * from sys_history where id=@id"
com = New MySqlCommand(que, condb)
com.Parameters.Add("@id", MySqlDbType.Int64).Value = history.id
reader = com.ExecuteReader(CommandBehavior.CloseConnection)
If reader.Read = True Then
history.id = reader(0)
history.username = reader(1)
history.action = reader(2)
history.title = reader(3)
history.content = reader(4)
history.execdate = reader(5)
End If
Catch ex As MySqlException
MessageBox.Show("Error: " & ex.Message, "System Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
Finally
reader.Close()
closeConnection()
End Try
End Sub

Public Sub populateDGVHistory(dgv As DataGridView, search As String)


Try
openConnection()
Dim que As String = ""
If session_role = 0 Then
que = "select * from sys_history order by _date desc"
ElseIf session_role = 1 Then
que = "select * from sys_history where username=@user order by _date desc"
End If
96

com = New MySqlCommand(que, condb)


'com.Parameters.Add("@name", MySqlDbType.VarChar).Value = "%" & search & "%"
With com
.Parameters.Add("@user", MySqlDbType.VarChar).Value = session_username
End With
reader = com.ExecuteReader(CommandBehavior.CloseConnection)
dgv.Rows.Clear()

Do While reader.Read = True


dgv.Rows.Add(reader(0), reader(1), reader(2), reader(3), reader(4), reader(5), Format(reader(6), "dd-
MMM-yyyy hh:mm:ss tt"))
Loop
Catch ex As MySqlException
MessageBox.Show("Error: " & ex.Message, "System Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
Finally
reader.Close()
closeConnection()
End Try
End Sub

Password Module

Public Function generateOTP() As String


Const lowerLetter As String = "abcdefghijklmnopqrstuvwxyz"
Dim alphaNumeric() As Char = (lowerLetter & lowerLetter.ToUpper & "0123456789").ToCharArray
Dim otpResult As New StringBuilder
Dim rand As New Random
For i As Integer = 0 To 5
otpResult.Append(alphaNumeric(rand.Next(alphaNumeric.Length)))
Next
Return otpResult.ToString
End Function

#Region "->Forgot Password by Email"


Public Function verifyEmail(email As String) As Boolean
Try
openConnection()
Dim que As String = "select email from user_accounts where email=@email"
com = New MySqlCommand(que, condb)
With com
.Parameters.Add("@email", MySqlDbType.VarChar).Value = email
End With
reader = com.ExecuteReader(CommandBehavior.CloseConnection)
If reader.Read = True Then
Return True
Else
Return False
End If

Catch ex As MySqlException
MessageBox.Show("Error: " & ex.Message, "Email Verify Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
Return False
Finally
reader.Close()
97

closeConnection()
End Try
End Function

Public Sub sendOTP_ToMail(emailAddress As String, otp As String)


Try
Dim email As New MailMessage
With email
.From = New MailAddress("[email protected]")
.To.Add(emailAddress)
.Subject = "ViNOOK Inventory Forgot Password"
.Body = $"ViNOOK Inventory Verification" &
Environment.NewLine &
Environment.NewLine &
"Code: " & otp &
Environment.NewLine &
"A verification code was requested using your account. If this was you, please use the code above.
The code is valid for 10 minutes."
.IsBodyHtml = False
End With

Dim smtp_server As New SmtpClient("smtp.gmail.com")


With smtp_server
.UseDefaultCredentials = False
.DeliveryMethod = SmtpDeliveryMethod.Network
.Credentials = New Net.NetworkCredential("[email protected]", "zvwzfafphhxnezwh")
.Port = 587
.EnableSsl = True
End With
smtp_server.Send(email)
customMessageBox.show("Verification Code was sent to " & emailAddress, "Verification Code",
MessageBoxButtons.OK, MessageBoxIcon.Information)
Catch ex As Exception
MessageBox.Show("Error: " & ex.Message, "Recovery Send Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
End Try
End Sub
Public Sub updateOTP_byEmail(user As userModel)
Try
openConnection()
Dim que As String = "update user_accounts set recovery_code=sha2(@code, 512), code_expire=@expiry
where email=@email "
com = New MySqlCommand(que, condb)
With com
.Parameters.Add("@email", MySqlDbType.VarChar).Value = user.email
.Parameters.Add("@code", MySqlDbType.VarChar).Value = user.recoverycode
.Parameters.Add("@expiry", MySqlDbType.DateTime).Value = Date.Now.AddMinutes(10)
End With
com.ExecuteNonQuery()

Catch ex As MySqlException
MessageBox.Show("Error: " & ex.Message, "Recovery Update Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
Finally
closeConnection()
End Try
End Sub

Public Sub getUsername_byEmail(email As String)


98

Try
openConnection()
Dim que As String = "select username from user_accounts where email=@email"
com = New MySqlCommand(que, condb)
With com
.Parameters.Add("@email", MySqlDbType.VarChar).Value = email
End With
reader = com.ExecuteReader(CommandBehavior.CloseConnection)
If reader.Read = True Then
session_username = reader("username")
End If
Catch ex As MySqlException
MessageBox.Show("Error: " & ex.Message, "Account Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
Finally
reader.Close()
closeConnection()
End Try
End Sub

Public Function getExpiryDate(email As String, verification As String) As Date


Dim expireDate As Date
Try
openConnection()
Dim que As String = "select code_expire from user_accounts where email=@email and
recovery_code=sha2(@code, 512)"
com = New MySqlCommand(que, condb)
With com
.Parameters.Add("@email", MySqlDbType.VarChar).Value = email
.Parameters.Add("@code", MySqlDbType.VarChar).Value = verification
End With
reader = com.ExecuteReader(CommandBehavior.CloseConnection)
If reader.Read = True Then
expireDate = reader("code_expire")
End If
Return expireDate
Catch ex As MySqlException
MessageBox.Show("Error: " & ex.Message, "Expire Code Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
Return expireDate
Finally
reader.Close()
closeConnection()
End Try
End Function

Public Function verifyOTP(user As userModel) As Boolean


Try
openConnection()
Dim que As String = "select recovery_code from user_accounts where email=@email and
recovery_code=sha2(@code, 512)"
com = New MySqlCommand(que, condb)
With com
.Parameters.Add("@email", MySqlDbType.VarChar).Value = user.email
.Parameters.Add("@code", MySqlDbType.VarChar).Value = user.recoverycode
End With
reader = com.ExecuteReader(CommandBehavior.CloseConnection)
If reader.Read = True Then
Return True
99

Else
Return False
End If

Catch ex As MySqlException
MessageBox.Show("Error: " & ex.Message, "Recovery Verify Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
Return False
Finally
reader.Close()
closeConnection()
End Try
End Function

Public Function changePassword_byEmail(user As userModel) As Boolean


Try
openConnection()
user.updated_at = Date.Now
Dim que As String = "update user_accounts set userpassword=sha2(@pass, 512), updated_at=@updated
where email=@email"
com = New MySqlCommand(que, condb)
With com
.Parameters.Add("@email", MySqlDbType.VarChar).Value = user.email
.Parameters.Add("@pass", MySqlDbType.VarChar).Value = user.userpassword
.Parameters.Add("@updated", MySqlDbType.DateTime).Value = user.updated_at
End With

_content = "Changed Password."


Dim modelHistory As New historyModel(session_username, "UPDATE", "ACCOUNT", _content,
user.updated_at)
Dim funcHistory As New historyFunction

If com.ExecuteNonQuery = 1 Then
funcHistory.addToHistory(modelHistory)
Return True
Else
Return False
End If
Catch ex As MySqlException
MessageBox.Show("Error: " & ex.Message, "System Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
Return False
Finally
closeConnection()
End Try
End Function

#End Region
100

APPENDIX 7 Database Design

Figure 27 System's Database Design


101

Figure 27 shows the database design of the ViNOOK IMS. The database server

used is MySQL. The database consists of ten tables namely: user_accounts, sys_history,

units, products, products_detail, suppliers, categories, orders, orders_detail and

customers.

The user accounts table is where the user information will be stored, sys history

will store all the system operation that was done in the system. Units table will store the

units available such as pieces. Products and products details will store the product

information and stock information. Suppliers table will store the supplier’s information.

Categories table will store the product categories. Orders and order details table will store

the sales record of the products. Customers table will store the customers information.
102

APPENDIX 8 USER MANUAL

Shortcut Keys Available

Key Description
Esc Closing an active window.
F5 Refresh
CTRL+N Add New
 Can be used in any page that
requires adding data
F10 Save
CTRL+P Print
CTRL+E Select or focus to the search box
Shortcut Key in Adding Order
F2 Add item / product
F3 Remove selected item / product
F4 Advanced item / product search, or
Choose customer when saving the order

How to Start the Application

1. The application can be started either from the desktop shortcut or start menu

shortcut

o Start application from desktop: look for the icon with the title or

caption ViNOOK IMS and double click to start the application.

o Start application from start menu: Press the windows logo and search for

the name ViNOOK IMS in the search bar or scroll the start menu items
103

and look for the folder name ViNOOK Inventory then select the ViNOOK

IMS application to start.

How to Login

2. Enter the username and password in their specific fields in the login form

and press the login button or enter key to login.

How to Reset Password

1. Click the forgot password in the login form, below the login button

2. Enter your email address that you used in your account details and press the send

verification code and wait until confirmation that the email was sent
104

3. After receiving the verification enter the code received in the verification code

field and press the submit button.

4. after submitting the verification code if valid you can now change your password

How to Add New Stock

1. In the inventory page, click the menu button and choose “Add New Stock” or

simply press “CTRL+N” key in your keyboard.

2. Scan or type in the product code, if the fields are not populated with data that

means the stock that you are trying to enter is not yet added to the product list.

a. Click the “Add Product” link to open the page for adding the product

details.

b. Scan or type in the product code and enter all the details required and

press F10 key in your keyboard or click the save button.

3. Scan or type in the product serial number and enter all the details required such as

the cost, supplier, and quantity of the product.


105

4. Click the save button or press the F10 key in your keyboard.

How to Add New Order

1. In the sales page press CTRL+N or New Order button in the menu bar.

2. Enter the invoice number.

3. Scan the product serial number and choose the quantity of the product.

a. Check the warranty if warranty is available and choose how many months

the warranty will be valid.

4. Press F2 key or Add Item button to add the item or product in the order list.

5. Press F10 or Save Order button to save the current order transaction.

a. Enter the amount received from the customer and choose the payment type

whether it is cash or cheque.

i. If cheque it is required to enter the cheque number before saving

the transaction.

b. Press F4 or Choose Customer button to add the customer details.

i. If the customer is not listed in the existing customer list, add the

new customer details by pressing CTRL+N or New Customer

button.

c. Press F10 or Save Order button to completely save the order transaction.

How to Add New Customer

1. In the customer page, press add new customer button or press the shortcut key

CTRL+N.

2. Enter all the details required and save.


106

How to Add New Supplier

1. In the supplier page, press add new supplier button or press the shortcut key

CTRL+N.

2. Enter all the details required and save.

How to Add New Product Category

1. In the product categories page, press add new category button or press the

shortcut key CTRL+N.

2. Enter the category name and save.

How to Edit Account Details

1. In the account page, click the edit account details button.

2. Change the details you want to edit and save.

How to Change Password

1. In the account page, click the change password button.

2. Enter the old password, and enter the new password and type in again the new

password to confirm and click update button or F10 key to commit the change.

How to Edit Details

1. In the user interface of the selected module click the edit button in the action

column of selected row you want to edit.

2. Change the details you want to edit and save.

3. This applies to every page that has editing available.


107

How to Print

 Press the print button in the menu bar or press the shortcut key to print the data in

the selected module. This applies to every page that has printing available.
108

APPENDIX 9 Questionnaire

College of Information Communications Technology

Dear Respondent,

The researchers are currently working on their capstone entitled

“Implementation of ViNOOK Inventory Management System” which is a part of our

data collection. With your participation the researchers will be able to know the

Functionality and Usability of their capstone. We will ensure that all information

gathered is treated with confidentiality.

Please answer the questions as follows:

Name: ___________________________________

Address: _________________________________

Instructions: Please indicate your evaluation of the ViNOOK IMS’s functionality and

usability by CHECKING the appropriate measure in the column provided.

Very
Unsatisfactory
FUNCTIONALITY Excellent (5) Very Satisfactory (4) Satisfactory (3) Unsatisfactory
(2)
(1)
The system has the
suitable set of
functions in
accordance with its
objectives
The system has
secure access
through the use of
password.
The system interacts
with the specified
modules as intended
109

The system displays


precise results
The system’s ability
to reset password on
user request through
verification code
using the email
address provided in
their account
Very
Unsatisfactory
USABILITY Excellent (5) Very Satisfactory (4) Satisfactory (3) Unsatisfactory
(2)
(1)
The system has a
user-friendly
interface
The system occupied
memory is within the
given requirement
The system is
responsive on user
request
The system provides
a message dialog
when performing
operations
110

APPENDIX 10 PICTURES SHOWING THE DATA GATHERING AND

DEVELOPMENT
111
112

APPENDIX 11 TEAM MEMBERS CURRICULUM VITAE

PERSONAL INFORMATION

Name: Joshua R. Villafuerte

Sex: Male

Birthday: May 9, 2001

Age: 21

Place of Birth: Quezon City

Address: Purok 7 Salvacion St., Cavinitan, Virac, Catanduanes

Religion: Roman Catholic

Civil Status: Single

EDUCATIONAL BACKGROUND

Tertiary: Catanduanes State University

Program: Bachelor of Science in Information Technology

Secondary: Catanduanes National High School

Elementary: Virac Pilot Elementary School


113

PERSONAL INFORMATION

Name: Dyn Ryk A. Vargas

Sex: Male

Birthday: September 21, 1999

Age: 23

Place of Birth: Virac, Catanduanes

Address: Gogon Centro, Virac, Catanduanes

Religion: Roman Catholic

Civil Status: Single

EDUCATIONAL BACKGROUND

Tertiary: Catanduanes State University

Program: Bachelor of Science in Information Technology

Secondary: Catanduanes National High School

Elementary: Virac Pilot Elementary School


114

PERSONAL INFORMATION

Name: Hannah Isobelle J. Albao

Sex: Female

Birthday: August 22, 2000

Age: 22

Place of Birth: Virac, Catanduanes

Address: Gogon Centro, Virac, Catanduanes

Religion: Roman Catholic

Civil Status: Single

EDUCATIONAL BACKGROUND

Tertiary: Catanduanes State University

Program: Bachelor of Science in Information Technology

Secondary: Catanduanes State University Laboratory Schools

Elementary: Virac Pilot Elementary School

You might also like