VB.NET Inventory System Source Code

Inventory Management System Source Code Using VB.NET And MySQL Database

vb.net inventory management system project

in this vb.net project demo we will see how to use our visual basic .net inventory management system with a mysql database.

goals of this project:
- give students / curious persons an example so they can learn from.
helping people create their first project. 
sharing knowledge with others.

tools:
- visual basic .net programming language.
- visual studio express 2013.
- mysql database
- canva.com for images
- flatuicolorpicker.com for colors
- iTextSharp (PDF library)

Watch This Full Project Demo



1 - Login Form

the login form allow the ADMIN and the other USERS to login into the application main form

vb.net inventory system - login form

if the user enter wrong username or password a message will show up

vb.net inventory system - login form error

as you can see there is a checkbox that allow you to show and hide the password

vb.net inventory system - login form show pass

so, if everything is ok when you click on the login button the main/home form will show up and the login form will close it self.


2 - Home Form

if the user type is ADMIN a "user" tab will be visible on the top menu

vb.net inventory system - home form

if the user type is USER the "user" tab will be invisible

vb.net inventory system - user home form


3 - Product Section


when you click on the Product tab, the MANAGE_PRODUCT_FORM will show up



vb.net inventory system - manage products



- on the form load all products will be displayed into a datagridview.

- when you enter a value in the search box and click search button, only the products that contain this value will be shown in the datagridview.



vb.net inventory system - search products



if you click on the "New Product" button the ADD_NEW_PRODUCT_FORM will show up, this form allow to enter the new product data and insert it into mysql database.


vb.net inventory system - add new product

on the top form you can see a combobox categories, this combobox is populated from category table in the mysql database.
if you want to add a new category without leaving the current form you can easly click on the "Add New Category" button and small form will show up and you can add a new category.

vb.net inventory system - add product category

and if you want to update a product just select the product you want to edit from the datagridview and click on the "Update Product" and the UPDATE_PRODUCT_FORM will show up with all the selected product data displayed on the form.

- NOTE: the number "11" you see on the right of  the combobox category is a label with the id of the product you want to edit, you can make this label invisible if you want. 

vb.net inventory system - update selected product

when you want to delete a product just select the product you want to remove and click on the "Remove Product" button.

vb.net inventory system - delete selected product


4 - Category Section


now if you want to manage the categories you have to go to the category tab.

- you can insert a new category by just entering the name on the textbox and clicking insert.

- when you click on the category tab the MANAGE_CATEGORIES_FORM will show up.

- the MANAGE_CATEGORIES_FORM contain a datagridview with all the categories name and id.

- if you select a category from the datagridview : 1) the data of the selected one will be displayed on the textboxes, 2) the products on the selected category will be displayed on a listbox. 

- also a navigation buttons for next and previous + a reset button to clear the textboxes text.



vb.net inventory system - manage categories



if you double click on a datagridview row, a list of products will show up on a new form



vb.net inventory system - show products in a category



5 - Customer Section


in this section you can:

- see all the customers on database displayed in datagridview.

- get the selected customer data from datagridview and set it into tetboxes on datagridview click.

- insert a new customer.

- update the selected customer data.

- delete the selected customer.

- navigate using "Next" & "Previous".

- clear all textboxes text using the "Reset" buttons.

- display the selected customer orders count.

- display the selected customer total orders amount.

- display the selected customer last order date.



vb.net inventory system - manage customers



6 - Order Section


when you click on the order tab MANAGE_ORDERS_FORM will show up, and this form contain:

- 1 datagridview with all customers.

- 1 datagridview for products ( show products depending on combobox category ).

- 1 datagridview to display the products you want to add into the order .



vb.net inventory system - manage orders



on the datagridview for customers, if you select a row the customer id will be set into the textbox id,

and if you double click a form will show up with the selected customer orders, and when you select an order you can see all products on this order in a listbox.



vb.net inventory system - customer orders



if you want to add a new customer click on "Add New Customer" button and enter the customer data



vb.net inventory system - add customer



now if you want to add products to the order follow those steps:

1 - select the category you want from the combobox.

2 - double click on the product you want, the QUANTITY_FORM will show up and you can enter the quantity you want, you can't enter 0 or let the box empty or enter a heigher quantity than the one available on the database.


vb.net inventory system - quantity
quantity form
vb.net inventory system - 0 quantity
quantity = 0
vb.net inventory system - unavailable quantity
unavailable quantity



and if everything is ok, the selected product will be add to the order datagridview with the quantity you want.


add product to order with valid quantity

now lets add more products to the order






- in the datagridview you can see a column "Quantity X Price" where we calculate the total price for this product.

- the checkbox "Select All" allow you to select all the products in the datagridview and if you want to delete them click on the "Delete Selected Products".

- on the bottom you can see the total amount of all products.



if all is good, click the "Insert Order" button to add the new order with the details into the database.



vb.net inventory system - insert order





if you want to show all the orders click on the "Show All Orders" button and ALL_ORDERS_FORM will show up with all the orders displayed on a datagridview.



vb.net inventory system - show all orders



when you click on "Print Selected Order" the selected order will be printed into a pdf file using iTextSharp (PDF library)



vb.net inventory system - printed order


7 - User Section

and the last one is the user tab, so when you click on it the MANAGE_USERS_FORM will show up
with all the users displayed on a datagridview.

vb.net inventory system - manage users

if you select a user from the datagridview all the data will be set into textboxes so you can delete it or edit his informations.

vb.net inventory system - select user

and to add a new user click on the "Create New User" button so the ADD_NEW_USER_FORM will show up, and all you have to do is enter the user informations and click add.

vb.net inventory system - add new user