Petrol Pump Management System Project Report

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

Petrol Pump Management System

Chapter 1
Preliminary Investigation

1
Petrol Pump Management System

Organizational Overview

Organizational Chart

PETROL
PUMP
MANAGEMENT
SYSTEM

Employee

Petrol Pump Customer

2
Petrol Pump Management System

Description of System

In Petrol pump management System use to maintain their sales detail,

employee detail in files and folders. They use to keep the record of petrol and

diesel sold, inventry, Customers, etc in a register. A daily register is maintained

to keep track of sales.

Preparing report is very time consuming and tedious task. For searching of

single record, whole register is to be searched which is very time consuming task.

3
Petrol Pump Management System

Limitations Of Present System

 As mentioned above most of details are maintained manually. Due to this the
data retrieved is time consuming. Due to human calculation errors occur.

 Even when the data is maintained on spreadsheet inconsistency occurs as an


order might be missed or wrongly entered or twice.

 Data are stride an excel sheet which takes lot of time and data may be
corrupted.

 As storage and exchange of data is achieved only by use of excel sheets which
lack validation capabilities, there is always risk of invalid, inaccurate or
incomplete data being fed in computer.

 Difficulty in managing multiple forms.

 Lack of security.

4
Petrol Pump Management System

Proposed System

The proposed system is computerized and has been developed using


advance language therefore it gives more facilities than present system. It
provides quick access to any data. In this system user have to enter the data only
once and then it get linked with all files. This reduces the workload of user and it
is also a time saving process.

The information about any Subscriber can be easily retrieved. The


system maintains all records easy.

5
Petrol Pump Management System

Advantages of Proposed System:

 All the information about sale, purchase, stock will be maintain properly in
this system.

 All manual calculation of sale or all the money management will be


performed by the computer automatically.

 This system will provide timely report information.

 It will produce report for sale, bill and stock information.

 The computer can hold amount of data in its storage device.

 The operation and speed of the computer is very high.

 We can calculate result and print any report within a seconds.

 Any difficulties we can solve easily.

 A database application can be stored in computer effectively.

 It is very user friendly and easy to handle.

So the computerized system is more suitable than the manual system.

6
Petrol Pump Management System

Feasibility Of Study

1. Software Specification:-

Software requirements for this system are as listed follows:

 FRONTEND : Microsoft Visual Basic 8.0

 BACKEND : Microsoft SQL Server-2000

 OPERATING SYSTEM : Windows XP

2. Hardware Specifications
Minimum hardware requirements for this System are listed below:

 Processor : Pentium-4

 RAM : 256MB.

 HARD DISK : 80GB.

 NETWORK : LAN.

7
Petrol Pump Management System

FRONTEND :- MICROSOFT VISUAL STUDIO 2008


1. First of all, VB.NET provides managed code execution that runs under the
Common Language Runtime (CLR), resulting in robust, stable and secure
applications. All features of the .NET framework are readily available in
VB.NET.
2. VB.NET is totally object oriented. This is a major addition that VB6 and other
earlier releases didn't have.
3. The .NET framework comes with ADO.NET, which follows the disconnected
paradigm, i.e. once the required records are fetched the connection no longer
exists. It also retrieves the records that are expected to be accessed in the
immediate future. This enhances Scalability of the application to a great
extent.
4. VB.NET uses XML to transfer data between the various layers in the DNA
Architecture i.e. data are passed as simple text strings.
5. Error handling has changed in VB.NET. A new Try-Catch-Finally block has
been introduced to handle errors and exceptions as a unit, allowing
appropriate action to be taken at the place the error occurred thus discouraging
the use of ON ERROR GOTO statement. This again credits to the
maintainability of the code.
6. Another great feature added to VB.NET is free threading against the VB
single-threaded apartment feature. In many situations developers need
spawning of a new thread to run as a background process and increase the
usability of the application. VB.NET allows developers to spawn threads
wherever they feel like, hence giving freedom and better control on the
application.
7. Security has become more robust in VB.NET. In addition to the role-based
security in VB6, VB.NET comes with a new security model, Code Access
security. This security controls on what the code can access. For example you
can set the security to a component such that the component cannot access the
database. This type of security is important because it allows building
components that can be trusted to various degrees.
8. The CLR takes care of garbage collection i.e. the CLR releases resources as
soon as an object is no more in use. This relieves the developer from thinking
of ways to manage memory. CLR does this for them.

8
Petrol Pump Management System

BACKEND: SQL SERVER 2000


IBM developed the original version of SQL, originally called Sequel, as part
of the System R Project in the early 1970s. The Sequel language has evolved since
then, and its name has changed to SQL (Structured Query Language).Many
products now support the SQL language. SQL has clearly established itself as the
standard relational database language.
In 1986,the American Standards Institute (ANSI) and the International
Organization for Standardization (ISO) published an SQL standard, called SQL-
86.ANSI published an extended standard for SQL,SQL-89,in 1989.The next
version of the standard was SQL-92 standard followed by SQL:1999;the most
recent versions are SQL:2003 and then SQL:2005.

The SQL language has several parts:


 Data-definition language (DDL): The SQL DDL provides
commands for defining relation schemas, deleting relations, and modifying relation
schemas.

 Interactive data-manipulation language (DML):The SQL DML includes


a query language based on both the relational algebra (2) and the tuple
relational calculus (5).It includes also commands for specifying integrity
constraints that the data stored in the database must satisfy. Updates that violate
integrity constraints are disallowed.

 View definition: The SQL DDL includes commands for defining views.

 Transaction control: SQL includes commands for specifying the


beginning and ending of transactions.

 Embedded SQL and Dynamic SQL: Embedded and dynamic SQL


define how SQL statements can be embedded within general-purpose
programming languages, such as C, C++.Java, PL/I, COBOL, Pascal, and
FORTRAN.

 Authorization: The SQL DDL includes commands for specifying access


rights to relations and views.

9
Petrol Pump Management System

Stakeholders

Stakeholders are anyone who has an interest in the project. Project


stakeholders are individuals and organizations that are actively involved in the
project, or whose interests may be affected as a result of project execution or
project completion. They may also exert influence over the project’s objectives
and outcomes. The project management team must identify the stakeholders,
determine their requirements and expectations, and, to the extent possible,
manage their influence in relation to the requirements to ensure a successful
project.

The following are examples of project stakeholders:

1. Project Developers
Project Developers is one who develops software for customer. In my
project I am the first stakeholder i.e. Project Developer.
2. Project customer
Project Customer is one who pays for the developed software. In my
project the Chairman of Technovision Automation Pvt. Ltd. is the second
stakeholder i.e. Project Customer.
3. Project user Group

Project User group are those people who use the software on daily basis
for the Project Customer. In my project employee’s of Technovision
Automation Pvt. Ltd. are the third stakeholders i.e. Project User Group

4. Project Testers

Project Testers are those who test the software. In my project myself,
my project guide and Technical Department of TAPL are the fourth
stakeholders i.e. Project Testers.

10
Petrol Pump Management System

Gantt chart

Phase Start date Completio


n date

Preliminary 8/06/2010 28/06/2010


investigation

Project 8/06/2010 14/06/2010


Finalization
Investigation of 14/06/2010 28/06/2010
system
requirement

System Analysis 1/07/2010 12/08/2010

System Design 13/08/2010 25/09/2010

Coding 18/09/2010 20/11/2010

Interface 18/09/2010 16/10/2010


Coding
Database 16/10/2010 31/10/2010
Connectivity

Validation 31/10/2010 13/11/2010


Coding

Report Coding 13/11/2010 21/11/2010

Implementation 22/11/2010 31/12/2010

Developer 22/11/2010 24/11/2010


Testing

Client Testing 24/11/2010 26/12/2010

User Testing 26/12/2010 31/12/2010

Project Delivery 31/12/2010 14/01/2011

Project Report
Submission

Project Report
Hard Copy
Checking
Project 16/01/2011
Submission

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
WEEK

11
Petrol Pump Management System

Chapter 2
System Analysis

12
Petrol Pump Management System

Fact Findings

Introduction

The Current System is the manual one, hence is not speedy, accurate,
efficient as well as time consuming. An essential part of the system analysis,
which enables the developer to understand & the system correctly. It is
undertaken to obtain details of the system. To understand the physical flow of
the information through the current system. Collect various information through
various fact finding techniques. Identify the procedural difficulties experienced
by the user. Study the bottlenecks find out the redundant work being performed
in the system.

Fact Finding Techniques Employed

1. Interviews
Information was obtained from the employees at the organization by
interviewing them at the location and time convention both.

2. Document Searching
An extensive study of existing document an official correspondence was
done to understand the present working status of organization.

13
Petrol Pump Management System

EVENT TABLE

EVENT TRIGGER SOURCE ACTIVITY RESPONCE DESTINTI


Customer Check customer Customer Entering customer Customer ON
Employee
registration detail detail Registered

Supply petrol Check petrol Employee Supplying petrol Petrol or/and Customer
or/and diesel or/and diesel or /and diesel Diesel supplied
availability Or not

Bill Enter Employee Generating bill Bill generated Customer


generation petrol or /and
diesel amount
supplied

Management Check sales Management Looking up Detail of total Management


wants to detail corresponding sales
check sales sales
detail
Management Product price Management Making changes in Price adjustment Management
wants to adjustment price notification
adjust
product price
Management Check stock Management Updating the stock in Pump’s stock is Management
wants to detail pump updated
update stock
in pump
Management Check staff list Management Looking into sales Staff detail Management
wants check detail
staff detail

Produce staff Check no. of Management Producing staff Salary report Management
salary report day employee salary generated
was present

Produce Check all detail Management Producing report Report generated Owner
pump’s
summary
report

14
Petrol Pump Management System

Use Case Diagram

Registration

Bill payment

Customer

Registration

Supply petrol or/and diesel

Bill generation

Employee

Employee management

Maintaining record

Maintaining Petrol pump

Final report generation

Manager

Make salary of employees

Payment to supplier

Owner
15
Petrol Pump Management System

ENTITY-RELATIONSHIP DIAGRAM

BILL
EMPLOYEE

CUSTOMER OWNER

MANAGER

16
Petrol Pump Management System

ACTIVITY DIAGRAM

Idle

Customer visit

Register customer

Check Petrol stock

No
Petrol Not Available

Yes

Supply Petrol

Collect money

Bill generation

17
Petrol Pump Management System

Class Diagram

Bill Employee
B_id * 1 emp_id
Amount emp_name
C_id emp_address
Generate
Supply petrol
Insert Bill generation
Update Manage petrol
Delete mump
1

*
1

Pays
1
Customer Owner
*
C_id O_name
vehicle no O_address
name Handle
contact no. Get detail
Registration
Make payment

Work under 1

Manager
m_id
m_name
m_address
Manage
employee 1
Generate Report
Give report

18
Petrol Pump Management System

Object Diagram

Bill Employee
1 1 1
*
125.3 Rupesh Gharat
1 New Panvel
Generate
Ranjeet Rarput
1

1
*

1 Pays

Customer Owner
1 Alam Siddique
MH-43-J-7258 * Uran
Ranjeet Rajput
9856432178 Handle

Work under
1
Give report 1
Manager
4
Roshan Shelar
Roha Alibag

19
Petrol Pump Management System

SEQUENCE DIAGRAM

1)Demand for petrol

2) Check petrol stock

3) Petrol not available

4) Inform

5) Petrol available

6) Supply petrol

7) Generate bill

8) Playbill

9) Check stock detail

10) Update pump

11)check employee detail

12) Make salary

13) Generate report

20
Petrol Pump Management System

21
Petrol Pump Management System

State Diagram

Login

Idle
Entering customer

Customer visit

Entering Detail
Register customer

Demanding petrol/diesel

Check Petrol stock

Checking stock

Stock not available

Petrol Not Available

Stock available

Supply Petrol

Order fulfill

Collect money

Collecting money
Bill generation

Generating money

22
Petrol Pump Management System

Chapter 3
System Design

23
Petrol Pump Management System

Converting ERD to Tables

Entity TABLE PURPOSE


NAME
This table is use to store, retrieve
information about the customer.
Customer cust_reg.sql
The field are cust_id ,cust_name,
cust_vehno, cust_mobno, cust_date

This table is use to store ,retrieve


information about the Bill
Bill cust_bill.sql
The field are bill_id, cust_id cust_name,
cust_vehno,
cust_mobno,petrol,deisel,p_amt,d_amt2,to
talbill,cust_date
This table is use to store, retrieve
information about the Product price and
Product pro_detail.sql
stock.

The field are p_id, p_name , p_stock,


p_price
This table is use store information of sales

Sales sales.sql The field are bill_id, cust_name, petrol,


deisel, p_amt, d_amt2, totalbill, cust_date

This table is use to store information


inventryfile.sql about inventory detail
Inventory
The field in the table i_date , i_petrol,
i_diesel,Invoiceno.,Prodid,Prodname,type,
quantity,mrp,amt,

Total.

24
Petrol Pump Management System

Employee addemployees.sql This table is use store about the employee

The field are e_id ,e_name ,e_add


,e_contact bigint, e_age ,e_gender
,e_doj,e_post ,e_shift ,e_salary
Attendance attendance.sql This table is use to store employee
attendance

Advance Advance.sql This table is store the information about


advance payment

The field are eid eid ,ename ,adate


,advance
Salary Salaryreport.sql This table is store the information about
employee salary

The field are eid eid ,ename ,smonth


,present ,absent ,doff ,monthlys ,netsal

user Login.sql This table is store the information about


User of system and their password

The field are eid Username ,passwrd

user Logtime.sql This table is store the information about


Time when the user login to system

The field are eid Username ,logintime

25
Petrol Pump Management System

Relationship Diagram

26
Petrol Pump Management System

Component Diagram

Cust_reg.vb

Bill .vb

Employee.vb

Emp_salary.vb
Petrol pump management system

Advance.vb

Stock.vb

Price.vb

Attendance .vb

27
Petrol Pump Management System

Package Diagram

Customer

Cust_reg.vb

Bill.vb

Petrol pump management system Empoyee

Employee advance.vb
.vb

Emp_Salary
Attendance .
. vb
vb

Product

stock.vb

Price.vb

28
Petrol Pump Management System

Package Diagram

Cust_reg.vb Bill.vb

Employee
.vb advance.vb
Petrol pump management system

Emp_Salary Attendance
. vb .vb

stock.vb Price.vb

LOCAL AREA NETWORK

HUB

Terminal Printer

29
Petrol Pump Management System

System Flow Chart

Maintain
user details
Login

Maintain
customer
Customer Detail

Maintain Bill report


Bill Detail
Bill

Maintain Sales report


sales details
Sales

Petrol pump
Management Maintain Stock report
stock
System Stock details

Maintain
employee
Employee details

Maintain Salary report


salary
details
Salary

Maintain Inventory report


inventory
details
Inventory

30
Petrol Pump Management System

Structure Chart

Petrol Pump
Management
System

Customer

Report
Put Salary
inform
ation Get
inform
ation

Employee
Bill Inventry
detail

Employee Attendance
detail Detail
Put Get
infor informa
mati tion Sales
on detail

Customer Product
Detail Detail
Salary
Detail

31
Petrol Pump Management System

Chapter 4
System Coding

32
Petrol Pump Management System

Menu Tree

Log

Change
password
File
Exit

Registration
Customer
Bill

Search

Price Add
Product

Stock Search

MDI Form Salary


Employee

customer attendance

Advance
Employee
Report

sales

Salary

Inventory

calculator
Tools
Note pad

33
Petrol Pump Management System

Table List
Sr.N Field Name Datatype Constraints Size Description
o.1 cust_id Integer Primary key Stores the customer id
2 cust_name Varchar 20 Stores the customer
3 cust_vehno Varchar 20 name
Stores the customer
vehicle number
4 Ph_no Bigint Stores the customer
5 cust_date Datetime ph.no. the registration
Stores
1.Table name:- cust_reg date

2.Table name:- cust_bill


Sr. Field Name Datatype Constraints Size Description
No.
1 bill_id Integer Primary key Stores the bill id
2 cust_id integer Foreign key Stores the customer id
3 cust_name Varchar 20 Stores the customer name
4 cust_vehno varchar 20 Stores the customer vehicle
number
5 cust_mobno bigint Stores the customer ph.no.
6 petrol real Stores the amount of petrol
purchased

7 deisel real Stores the amount of diesel


purchased
8 p_amt real Store bill of petrol
9 d_amt2 real Store bill of diesel
10 totalbill real Store total bill
11 cust_date datetime Store date of sale

3.Table name:- pro_detail

34
Petrol Pump Management System

Sr. Field Name Datatype Constraints Size Description


No.
1 p_id Integer Primary key Stores the product id
2 p_stock Real Stores product stock
3 p_price real Stores product price

4. Table name:- inventryfile


Sr. Field Name Datatype Constraints Size Description
No.
1 i_date datetime Stores the inventory
2 i_petrol real date the amount of
Stores
petrol invented
3 i_diesel real Stores the amount of
diesel invented

5.Table name:- sales


Sr.N Field Name Datatype Constraints Size Description
o.1 bill_id Integer Foreign key Stores the bill id
2 cust_name Varchar 15 Stores the
3 petrol real customer
Stores thename
amount
of petrol purchased
4 deisel real Stores the amount
of diesel
5 p_amt real Store bill of petrol
purchased.
d_amt2 real Store bill of diesel
totalbill real Store total bill
cust_date datetime Store date of sale

35
Petrol Pump Management System

6 .Table name:- addemployees


Sr. Field Name Datatype Constraints Size Description
No.
1 e_id Integer Primary key Stores the employee
2 e_name Varchar 15 id
Stores the employee
3 e_add Varchar 15 name
Stores the employee
address
4 e_contact Bigint Stores the employee
5 e_age real ph.no.
Stores the employee
6 e_gender varchar 20 age
Stores the employee
7 e_doj datetime gender
Stores the date of
8 e_post varchar 20 joiningthe post of
Stores
9 e_shift varchar 20 employee
Stores the shift
10 e_salary real employee
Stores the maximum
salary

7 .Table name:- attendance


Sr. Field Name Datatype Constraints Size Description
No.
1 e_id Integer foreign key Stores the employee
2 e_name Varchar 20 id
Stores the employee
3 status Varchar 20 name
Stores the status of
employee
4 adate datetime (present/absent/off)
Stores the date

8 .Table name:- advance


Sr. Field Name Datatype Constraints Size Description
No.
1 e_id Integer foreign key Stores the employee
2 e_name Varchar 20 id
Stores the employee
3 adate datetime name
Stores the date
4 advance real advance
Stores the amount
taken

36
Petrol Pump Management System

9 .Table name:- salaryreport


Sr. Field Name Datatype Constraints Size Description
No.
1 e_id Integer Foreign key Stores the employee
2 e_name Varchar 20 id
Stores the employee
3 smonth Varchar 20 name
Stores the month of
4 present integer salary
Stores the number of
days present
5 absent integer Stores the number of
days absent
6 doff integer Stores the number of
days off
7 monthlys real Store maximum
8 netsal real salary
Store net salary

10. Table name:- login


Sr. Field Name Datatype Constraints Size Description
No.
1 username varchar Primary key 10 Stores the user name
2 passwrd Varchar 10 Stores the password
of user

11. Table name:- logintime


Sr. Field Name Datatype Constraints Size Description
No.
1 username varchar Foreign key 10 Stores the user name
2 logintime Varchar 10 Stores the time of
login

Program List

37
Petrol Pump Management System

NO FORM NAME PURPOSE

1 splash.vb This form display the title of system name

of organization & copyright of the system

2 Login.vb This form is used for security with the help


of password
3 MDI.vb This is the multiple document interface for
the all of the form in the project
4 c_ragistration.vb This form is use for registration of
customer
5 c_billgeneration.vb This form is use to calculate bill and store
bill information
6 c_search.vb This form use to search and delete customer
information
7 price.vb This form is use to set and get product price
8 frmstock.vb This form is use to set and get product
stock
9 addemployee.vb This form is use for to add new employee
with unique id
10 searchemp.vb This form is use to search ,delete ,update
employee information
11 attendance.vb This form use to store attendance of
employee
12 advance.vb This form use to allocate advance payment
to employee
13 salary.vb This form use to calculate salary of
employee
14 account.vb This form use to create new user account
15 chgpass.vb This form use to change password of user
16 printbill.vb This form use to print bill of individual
customer

Report List

38
Petrol Pump Management System

NO. REPORT NAME PURPOSE

1 CrystalReport11.rpt This report is use to print


and show the customer
report

This report is use to print


& show the list of the
2 Crystalemp.rpt
employee

This report is use to print


& display salary report
3 Crystalsalary.rpt

4 Crystalsales.rpt This report is use f to


print and show sales
report
This report is use to print
and show inventory
5 Crystalinventry.rpt
detail

Program Description

39
Petrol Pump Management System

Program Name: Splashscreen


Program Function: This is form is used to Load the system

40
Petrol Pump Management System

Code:-
Public Class splash
Dim per As Integer

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Timer1.Tick

ProgressBar1.PerformStep()
per = per + 1
lbls_per.Text = per

If ProgressBar1.Value = 100 Then


Login.Show()
Timer1.Enabled = False
Me.Hide()
End If

End Sub
End Class

41
Petrol Pump Management System

Program Name: Login


Program Function: This is form is used to Login in the
system

Pseudo code:
Sr.No Button Name Procedure Description
1 Ok Click Login to the system
2 Cancel Click Exit from the system
3 Create account Click Create new user
account

42
Petrol Pump Management System

Code:-
Imports System.Data.SqlClient
Public Class Login
Public cn As New SqlConnection(MDI.con.ConnectionString)
Dim chanceremain As Integer = 3
Dim chanceno As Integer
Public password As String
Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles OK.Click

Dim cmd As New SqlCommand

cmd.Connection = cn
If cn.State = ConnectionState.Open Then
cn.Close()
End If
cn.Open()
cmd.CommandText = "select passwrd from login where username=@username"
cmd.Parameters.Add("@username", SqlDbType.VarChar).Value =
cmbusrename.SelectedItem
Dim reader As SqlDataReader

reader = cmd.ExecuteReader
While reader.Read

password = reader.Item("passwrd")
End While
If txtl_pass.Text = password Then
cmd.Connection = cn
If cn.State = ConnectionState.Open Then
cn.Close()
End If
cn.Open()

Dim cmd2 As New SqlCommand


cmd2.Connection = cn
cmd2.CommandText = "insert into logtime values(@username1,@logintime)"
cmd2.Parameters.Add("@username1", SqlDbType.VarChar).Value =
cmbusrename.Text
cmd2.Parameters.Add("@logintime", SqlDbType.VarChar).Value = Now
cmd2.ExecuteNonQuery()
MDI.Show()
Me.Hide()
Else
chanceremain = chanceremain - 1

43
Petrol Pump Management System

MsgBox("invalid Password " & vbCrLf & chanceremain & " attempt remain",
MsgBoxStyle.Information)
chanceno = chanceno + 1
If chanceno = 3 Then
Me.Close()

End If
End If

End Sub

Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles Cancel.Click
Me.Close()

End Sub

Private Sub Login_FormClosed(ByVal sender As Object, ByVal e As


System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
splash.Close()
End Sub

Private Sub Login_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles MyBase.Load

Dim cmd As New SqlCommand


cmd.Connection = cn
cn.Open()
cmd.CommandText = "select username from login"
Dim reader As SqlDataReader
reader = cmd.ExecuteReader
While reader.Read
cmbusrename.Items.Add(reader.Item("username"))

End While
cn.Close()
cmbusrename.SelectedIndex = 0
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button1.Click
account.Show()
End Sub
End Class

44
Petrol Pump Management System

Program Name: MDIForm


Program Function: This is form contains menus i.e.
path for other forms.

45
Petrol Pump Management System

46
Petrol Pump Management System

Code:-
Imports System.Data.SqlClient

Public Class MDI


Dim petstock As Decimal
Dim desstock As Decimal
Public con As New SqlConnection("Data Source=localhost;Initial
Catalog=alam;Integrated Security=True")

Private Sub ExilToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e


As System.EventArgs) Handles ExilToolStripMenuItem.Click

sure.Show()
End Sub

Private Sub RegistrationToolStripMenuItem_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles RegistrationToolStripMenuItem.Click
con.Open()
Dim cmd4 As New SqlCommand
cmd4.Connection = con
cmd4.CommandText = "select * from pro_detail where p_id=1"
Dim reader1 As SqlDataReader
reader1 = cmd4.ExecuteReader
While reader1.Read
petstock = reader1.Item("p_stock")
End While
If con.State = ConnectionState.Open Then
con.Close()
End If
con.Open()
Dim cmd5 As New SqlCommand
cmd5.Connection = con
cmd5.CommandText = "select * from pro_detail where p_id=2"
Dim reader2 As SqlDataReader
reader2 = cmd5.ExecuteReader
While reader2.Read
desstock = reader2.Item("p_stock")
End While
If con.State = ConnectionState.Open Then
con.Close()
End If
If petstock > 0 And petstock < 10 Or desstock > 0 And desstock < 10 Then
dbregistration.Show()

ElseIf petstock = 0 Or desstock = 0 Then


dbregistration.Show()

ElseIf petstock = 0 And desstock = 0 Then

47
Petrol Pump Management System

MsgBox("total stock finished can't make registration")


Else
c_ragistration.Show()
End If
End Sub
Private Sub BillGenerationToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
BillGenerationToolStripMenuItem.Click
Dim cmd1 As New SqlCommand
Dim cmd2 As New SqlCommand
Dim i As Integer
Dim j As Integer
cmd1.Connection = con
cmd2.Connection = con
con.Open()
cmd1.CommandText = "select count(*) from cust_reg"
cmd2.CommandText = "select count(*) from cust_bill"
i = cmd1.ExecuteScalar
j = cmd2.ExecuteScalar
If i = j Then
direg.Show()
Else
c_billgeneration.Show()
End If
If con.State = ConnectionState.Open Then
con.Close()
End If
End Sub

Private Sub SearchToolStripMenuItem_Click(ByVal sender As System.Object, ByVal


e As System.EventArgs) Handles SearchToolStripMenuItem.Click
c_search.Show()
End Sub

Private Sub CustomerToolStripMenuItem_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles CustomerToolStripMenuItem.Click
End Sub

Private Sub CustomerToolStripMenuItem1_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles CustomerToolStripMenuItem1.Click
billreport1.Show()
End Sub

Private Sub MDI_FormClosed(ByVal sender As Object, ByVal e As


System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
Login.Close()
End Sub

Private Sub MDI_FormClosing(ByVal sender As Object, ByVal e As


System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing

48
Petrol Pump Management System

End Sub

Private Sub MDI_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
End Sub

Private Sub priceToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e


As System.EventArgs) Handles priceToolStripMenuItem.Click
price.Show()
End Sub

Private Sub PetrolToolStripMenuItem_Click(ByVal sender As System.Object, ByVal


e As System.EventArgs) Handles PetrolToolStripMenuItem.Click
frmstock.Show()

End Sub

Private Sub InventryReportToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
InventryReportToolStripMenuItem.Click
inventryreport1.Show()

End Sub

Private Sub AddNewToolStripMenuItem_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles AddNewToolStripMenuItem.Click
addemployee.Show()

End Sub

Private Sub CalculateSalaryToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
CalculateSalaryToolStripMenuItem.Click
searchemp.Show()

End Sub

Private Sub SalesReportToolStripMenuItem_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles SalesReportToolStripMenuItem.Click
sales.Show()
End Sub

Private Sub AttendaceToolStripMenuItem_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles AttendaceToolStripMenuItem.Click
attendance.Show()

End Sub

49
Petrol Pump Management System

Private Sub SalaryCalculationToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
SalaryCalculationToolStripMenuItem.Click
salary.Show()

End Sub

Private Sub AdvancePaymentToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
AdvancePaymentToolStripMenuItem.Click
advance.Show()
End Sub

Private Sub EmployeeToolStripMenuItem1_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles EmployeeToolStripMenuItem1.Click
emprecord.Show()

End Sub
Private Sub SalaryToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles SalaryToolStripMenuItem.Click
Salaryreport.Show()
End Sub
Private Sub LogToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles LogToolStripMenuItem.Click
logreport.Show()
End Sub
Private Sub CalculatorToolStripMenuItem_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles CalculatorToolStripMenuItem.Click
Process.Start("C:\WINDOWS\system32\calc.exe")
End Sub

Private Sub NotepadToolStripMenuItem_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles NotepadToolStripMenuItem.Click
Process.Start("C:\WINDOWS\system32\notepad.exe")
End Sub

Private Sub ChangePasswordToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
ChangePasswordToolStripMenuItem.Click
chgpass.Show()
End Sub

End Class

50
Petrol Pump Management System

Program Name: Cust_reg


Program Function: This is form is used to register
customer and its details
Data entry form:

Pseudo Code:

Sr. No. ButtonName Procedure Description


1 SUBMIT Click Register the customer
2 next Click Allows next unique id to customer

51
Petrol Pump Management System

Code:-

Imports System.Data.SqlClient

Public Class c_ragistration


Public cn As New SqlConnection(MDI.con.ConnectionString)
Dim petstock As Decimal
Dim desstock As Decimal
Dim DA As New SqlDataAdapter("select * from cust_reg;", cn)
Dim odv As DataView
Dim ode As New DataSet
Dim objcur As CurrencyManager
Public Sub filldatasetandview()
ode.Tables.Clear()
DA.Fill(ode, "cust_reg")
odv = New DataView(ode.Tables("cust_reg"))
objcur = CType(Me.BindingContext(odv), CurrencyManager)

End Sub
Public Sub bindfields()
txtc_r_ID.DataBindings.Clear()
txtc_r_ID.DataBindings.Add("text", odv, "cust_id")
End Sub

Private Sub btnc_r_new_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnc_r_new.Click
txtc_r_contno.Text = ""
txtc_r_name.Text = ""
txtc_r_vehno.Text = ""
cn.Open()
Dim cmd4 As New SqlCommand
cmd4.Connection = cn
cmd4.CommandText = "select * from pro_detail where p_id=1"
Dim reader1 As SqlDataReader
reader1 = cmd4.ExecuteReader
While reader1.Read
petstock = reader1.Item("p_stock")
End While
If cn.State = ConnectionState.Open Then
cn.Close()
End If
cn.Open()
Dim cmd5 As New SqlCommand
cmd5.Connection = cn
cmd5.CommandText = "select * from pro_detail where p_id=2"

52
Petrol Pump Management System

Dim reader2 As SqlDataReader


reader2 = cmd5.ExecuteReader
While reader2.Read
desstock = reader2.Item("p_stock")
End While
If cn.State = ConnectionState.Open Then
cn.Close()
End If
If petstock > 0 And petstock < 10 Or desstock > 0 And desstock < 10 Then
MsgBox("petrol stock is" & petstock & "ltr. & diesel stock is" & desstock & "ltr.")

ElseIf petstock = 0 Or desstock = 0 Then


MsgBox("petrol stock is " & petstock & " ltr. & diesel stock is " & desstock & "
ltr.")

ElseIf petstock = 0 And desstock = 0 Then


MsgBox("total stock finished can't make registration")
Me.Close()

End If
filldatasetandview()
bindfields()
objcur.Position = objcur.Count - 1
txtc_r_ID.Text = Val(txtc_r_ID.Text) + 1

If cn.State = ConnectionState.Open Then


cn.Close()

End If

End Sub

Private Sub btnc_r_submit_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnc_r_submit.Click

Dim cmd As New SqlCommand


cmd.Connection = cn
cn.Open()

53
Petrol Pump Management System

cmd.CommandText = "insert into cust_reg


values(@cust_id,@cust_name,@cust_vehno,@cust_mobno,@cust_date)"
cmd.Parameters.Add("@cust_id", SqlDbType.Int).Value = Val(txtc_r_ID.Text)
cmd.Parameters.Add("@cust_name", SqlDbType.VarChar).Value = txtc_r_name.Text
cmd.Parameters.Add("@cust_vehno", SqlDbType.VarChar).Value =
txtc_r_vehno.Text
cmd.Parameters.Add("@cust_mobno", SqlDbType.BigInt).Value =
Val(txtc_r_contno.Text)
cmd.Parameters.Add("@cust_date", SqlDbType.VarChar).Value = (txtc_r_date.Text)
If cmd.ExecuteNonQuery = 1 Then
MsgBox("customer Registered succesfully")
Else
MsgBox("not")
End If
If cn.State = ConnectionState.Open Then
cn.Close()

End If
End Sub

Private Sub c_ragistration_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load

txtc_r_date.Text = Now.ToString("d")
filldatasetandview()
bindfields()
objcur.Position = objcur.Count - 1
txtc_r_ID.Text = Val(txtc_r_ID.Text) + 1

End Sub

Private Sub Panel2_Paint(ByVal sender As System.Object, ByVal e As


System.Windows.Forms.PaintEventArgs) Handles Panel2.Paint

End Sub

Private Sub txtc_r_contno_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles txtc_r_contno.KeyPress
Dim c As Char
c = e.KeyChar
If Not (Char.IsDigit(c) Or Char.IsControl(c)) Then
e.Handled = True
MsgBox("enter only digit")
End If
If txtc_r_contno.TextLength > 11 Then
e.Handled = True
MsgBox("Maximum 12 Digit are allowded")
End If

54
Petrol Pump Management System

End Sub

Private Sub txtc_r_name_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles txtc_r_name.KeyPress
Dim c As Char
c = e.KeyChar
If (Char.IsDigit(c)) Then
e.Handled = True
MsgBox("Number are not alloweded")
End If
End Sub

Private Sub txtc_r_contno_TextChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles txtc_r_contno.TextChanged
If txtc_r_contno.TextLength = 12 Then

MsgBox("Maximum 12 Digit are allowded")


End If
End Sub
End Class

55
Petrol Pump Management System

Test Result:

56
Petrol Pump Management System

Program Name:Cust_bill
Program Function: This is form is use to calculate bill and
save bill detail
Data entry form:

Sr. No. Button Procedure Description


Name
1 Calculate bill Click Calculate bill
save Click Save bill detail
2 next Click Generate next bill id

Code:-

57
Petrol Pump Management System

Imports System.Data.SqlClient

Public Class c_billgeneration


Dim petstock As Decimal
Dim desstock As Decimal
Public con As New SqlConnection(MDI.con.ConnectionString)
Dim DA As New SqlDataAdapter("select * from cust_bill;", con)
Dim odv As DataView
Dim ode As New DataSet
Dim objcur As CurrencyManager
Dim DA1 As New SqlDataAdapter("select * from cust_reg;", con)
Dim odv1 As DataView
Dim ode1 As New DataSet
Dim objcur1 As CurrencyManager
Public Sub filldatasetandview()
ode.Tables.Clear()
DA.Fill(ode, "cust_bill")
odv = New DataView(ode.Tables("cust_bill"))
objcur = CType(Me.BindingContext(odv), CurrencyManager)

End Sub
Public Sub bindfields()
txtc_b_bid.DataBindings.Clear()
txtc_b_bid.DataBindings.Add("text", odv, "cust_id")
End Sub
Public Sub filldatasetandview1()
ode1.Tables.Clear()
DA1.Fill(ode1, "cust_reg")
odv1 = New DataView(ode1.Tables("cust_reg"))
objcur1 = CType(Me.BindingContext(odv1), CurrencyManager)

End Sub
Public Sub bindfields1()
txtc_b_cid.DataBindings.Clear()
txtc_b_cid.DataBindings.Add("text", odv1, "cust_id")
End Sub
Private Sub chbc_b_petrol_CheckedChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles chbc_b_petrol.CheckedChanged
If chbc_b_petrol.Checked Then
txtc_b_petrol1.ReadOnly = False
txtc_b_petrol1.BackColor = Color.White
Else
txtc_b_petrol1.Text = ""
txtC_b_totalbill.Text = ""
txtc_b_petrol1.ReadOnly = True
txtc_b_petrol1.BackColor = Color.WhiteSmoke
End If
End Sub

58
Petrol Pump Management System

Private Sub chbc_b_deisel_CheckedChanged(ByVal sender As System.Object, ByVal e


As System.EventArgs) Handles chbc_b_deisel.CheckedChanged
If chbc_b_deisel.Checked Then
txtc_b_deisel1.ReadOnly = False
txtc_b_deisel1.BackColor = Color.White

Else
txtc_b_deisel1.Text = ""
txtC_b_totalbill.Text = ""
txtc_b_deisel1.ReadOnly = True
txtc_b_deisel1.BackColor = Color.WhiteSmoke
End If
End Sub

Private Sub btnc_b_refresh_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnc_b_refresh.Click
If con.State = ConnectionState.Open Then
con.Close()
End If
con.Open()
filldatasetandview()
bindfields()
objcur.Position = objcur.Count - 1

filldatasetandview1()
bindfields1()
objcur1.Position = objcur1.Count - 1

If txtc_b_bid.Text = txtc_b_cid.Text Then


direg.Show()
Else
txtc_b_bid.Text = Val(txtc_b_bid.Text) + 1

Dim cmd3 As New SqlCommand


cmd3.Connection = con
cmd3.CommandText = "select * from cust_reg where cust_id=@cust_id"
cmd3.Parameters.Add("@cust_id", SqlDbType.Int)
cmd3.Parameters("@cust_id").Value = Val(txtc_b_bid.Text)
Dim reader As SqlDataReader
reader = cmd3.ExecuteReader
While reader.Read
txtc_b_cid.Text = reader.Item("cust_id")
txtc_b_name.Text = reader.Item("cust_name")
txtc_b_vehno.Text = reader.Item("cust_vehno")
txtc_b_contno.Text = reader.Item("cust_mobno")
End While
End If
chbc_b_petrol.Checked = False

59
Petrol Pump Management System

chbc_b_deisel.Checked = False
txtc_petrolbill.Text = ""
txtc_deiselbill.Text = ""
txtC_b_totalbill.Text = ""
If con.State = ConnectionState.Open Then
con.Close()
End If
End Sub
Private Sub c_billgeneration_Enter(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Enter

End Sub

Private Sub c_billgeneration_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load

Txtc_b_date.Text = Now.ToString("d")

If con.State = ConnectionState.Open Then


con.Close()
End If
con.Open()

filldatasetandview()
bindfields()
objcur.Position = objcur.Count - 1
txtc_b_bid.DataBindings.Clear()
txtc_b_bid.Text = Val(txtc_b_bid.Text) + 1
Dim cmd3 As New SqlCommand
cmd3.Connection = con
cmd3.CommandText = "select * from cust_reg where cust_id=@cust_id"
cmd3.Parameters.Add("@cust_id", SqlDbType.Int)
cmd3.Parameters("@cust_id").Value = Val(txtc_b_bid.Text)
Dim reader As SqlDataReader
reader = cmd3.ExecuteReader
While reader.Read
txtc_b_cid.Text = reader.Item("cust_id")
txtc_b_name.Text = reader.Item("cust_name")
txtc_b_vehno.Text = reader.Item("cust_vehno")
txtc_b_contno.Text = reader.Item("cust_mobno")
End While
If con.State = ConnectionState.Open Then
con.Close()
End If
con.Open()
Dim cmd4 As New SqlCommand
cmd4.Connection = con
cmd4.CommandText = "select * from pro_detail where p_id=1"
Dim reader1 As SqlDataReader

60
Petrol Pump Management System

reader1 = cmd4.ExecuteReader
While reader1.Read
txtc_petprice.Text = reader1.Item("p_price")
petstock = reader1.Item("p_stock")
End While
If con.State = ConnectionState.Open Then
con.Close()

End If
con.Open()

Dim cmd5 As New SqlCommand


cmd5.Connection = con
cmd5.CommandText = "select * from pro_detail where p_id=2"
Dim reader2 As SqlDataReader
reader2 = cmd5.ExecuteReader
While reader2.Read
txtc_deisprice.Text = reader2.Item("p_price")
desstock = reader2.Item("p_stock")
End While
If con.State = ConnectionState.Open Then
con.Close()
End If

End Sub
Private Sub btnc_b_finalbill_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnc_b_finalbill.Click
If Val(txtc_b_petrol1.Text) > 0 Or Val(txtc_b_deisel1.Text) > 0 Then

Dim petprice As Decimal


Dim desprice As Decimal
Dim petquantity As Decimal
Dim desquantity As Decimal
Dim amt1 As Decimal
Dim amt2 As Decimal
Dim finalbill As Decimal
petprice = Val(txtc_petprice.Text)

desprice = Val(txtc_deisprice.Text)
petquantity = Val(txtc_b_petrol1.Text)
desquantity = Val(txtc_b_deisel1.Text)
If petstock - petquantity < 0 And desstock - desquantity >= 0 Then
MsgBox(" petrol stock is only " & petstock & " ltr")
chbc_b_petrol.Checked = False
txtC_b_totalbill.Text = ""
ElseIf petstock - petquantity >= 0 And desstock - desquantity < 0 Then
MsgBox("Diesel stock is only " & petstock & " ltr")
chbc_b_deisel.Checked = False
txtC_b_totalbill.Text = ""

61
Petrol Pump Management System

ElseIf petstock - petquantity < 0 And desstock - desquantity < 0 Then


MsgBox("Petrol stock is only " & petstock & " ltr. & Diesel stock is " &
desstock & " ltr.")
chbc_b_petrol.Checked = False
chbc_b_deisel.Checked = False
txtC_b_totalbill.Text = ""
Else
amt1 = petprice * petquantity
amt2 = desprice * desquantity
finalbill = amt1 + amt2
txtc_petrolbill.Text = amt1
txtc_deiselbill.Text = amt2
txtC_b_totalbill.Text = finalbill

End If
Else
MsgBox("nothing purchest to make bill")

End If

End Sub

Private Sub Btnc_b_save_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Btnc_b_save.Click
Dim cmd6 As New SqlCommand
con.Open()
cmd6.Connection = con
cmd6.CommandText = "insert into cust_bill
values(@bill_id,@cust_id,@cust_name,@cust_vehno,@cust_mobno,@petrol,@deisel,@
p_amt,@d_amt2,@totalbill,@cust_date)"
cmd6.Parameters.Add("@cust_id", SqlDbType.Int)
cmd6.Parameters.Add("@cust_name", SqlDbType.VarChar)
cmd6.Parameters.Add("@cust_vehno", SqlDbType.VarChar)
cmd6.Parameters.Add("@cust_mobno", SqlDbType.BigInt)
cmd6.Parameters.Add("@cust_date", SqlDbType.VarChar)
cmd6.Parameters("@cust_id").Value = Val(txtc_b_cid.Text)
cmd6.Parameters("@cust_name").Value = txtc_b_name.Text
cmd6.Parameters("@cust_vehno").Value = txtc_b_vehno.Text
cmd6.Parameters("@cust_mobno").Value = Val(txtc_b_contno.Text)
cmd6.Parameters("@cust_date").Value = (Txtc_b_date.Text)
cmd6.Parameters.Add("@bill_id", SqlDbType.Int)
cmd6.Parameters.Add("@petrol", SqlDbType.Real)
cmd6.Parameters.Add("@deisel", SqlDbType.Real)
cmd6.Parameters.Add("@p_amt", SqlDbType.Real)
cmd6.Parameters.Add("@d_amt2", SqlDbType.Real)
cmd6.Parameters.Add("@totalbill", SqlDbType.Real)
cmd6.Parameters("@bill_id").Value = Val(txtc_b_bid.Text)
cmd6.Parameters("@petrol").Value = Val(txtc_b_petrol1.Text)
cmd6.Parameters("@deisel").Value = Val(txtc_b_deisel1.Text)
cmd6.Parameters("@p_amt").Value = Val(txtc_petrolbill.Text)

62
Petrol Pump Management System

cmd6.Parameters("@d_amt2").Value = Val(txtc_deiselbill.Text)
cmd6.Parameters("@totalbill").Value = Val(txtC_b_totalbill.Text)
If cmd6.ExecuteNonQuery = 1 Then
MsgBox(" bill successfully generated")
printbill.Show()
Else
MsgBox("not")
End If
If con.State = ConnectionState.Open Then
con.Close()
End If
Dim cmd7 As New SqlCommand
cmd7.Connection = con
con.Open()
cmd7.CommandText = "update pro_detail set p_stock=@p_stock where p_id=1"
cmd7.Parameters.Add("@p_stock", SqlDbType.Real)
cmd7.Parameters("@p_stock").Value = petstock - Val(txtc_b_petrol1.Text)
cmd7.ExecuteNonQuery()
If con.State = ConnectionState.Open Then
con.Close()
End If
petstock = petstock - Val(txtc_b_petrol1.Text)
Dim cmd8 As New SqlCommand
cmd8.Connection = con
con.Open()
cmd8.CommandText = "update pro_detail set p_stock=@p_stock where p_id=2"
cmd8.Parameters.Add("@p_stock", SqlDbType.Real)
cmd8.Parameters("@p_stock").Value = desstock - Val(txtc_b_deisel1.Text)
cmd8.ExecuteNonQuery()
If con.State = ConnectionState.Open Then
con.Close()
End If
desstock = desstock - Val(txtc_b_deisel1.Text)
End Sub
Private Sub txtC_b_totalbill_TextChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles txtC_b_totalbill.TextChanged
If Val(txtC_b_totalbill.Text) > 0 Then
Btnc_b_save.Enabled = True

ElseIf Val(txtC_b_totalbill.Text) = 0 Then


Btnc_b_save.Enabled = False
End If
End Sub
Private Sub txtc_b_petrol1_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles txtc_b_petrol1.KeyPress
Dim c As Char
c = e.KeyChar
If Not (Char.IsDigit(c) Or Char.IsControl(c)) Then
e.Handled = True
MsgBox("enter only digit")

63
Petrol Pump Management System

End If
End Sub
Private Sub txtc_b_deisel1_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles txtc_b_deisel1.KeyPress
Dim c As Char
c = e.KeyChar
If Not (Char.IsDigit(c) Or Char.IsControl(c)) Then
e.Handled = True
MsgBox("enter only digit")
End If
End Sub
Private Sub Panel1_Paint(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles Panel1.Paint

End Sub
End Class

Test Result:

64
Petrol Pump Management System

65
Petrol Pump Management System

Program Name : printbill


Program Function: This is form is use to calculate bill
and save bill detail
Data entry form:

Pseudo Code:

Sr. No. Button Procedure Description


Name
1 Print Click Print bill

66
Petrol Pump Management System

Code:-

Public Class printbill


Dim b As c_billgeneration
Private Sub printbill_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
lblname.Text = c_billgeneration.txtc_b_name.Text
lblvehicle.Text = c_billgeneration.txtc_b_vehno.Text
lblbill.Text = c_billgeneration.txtc_b_bid.Text
lblqpetrol.Text = Val(c_billgeneration.txtc_b_petrol1.Text) & " ltr."
lblqdiesel.Text = Val(c_billgeneration.txtc_b_deisel1.Text) & " ltr."
lblpetprice.Text = c_billgeneration.txtc_petprice.Text
lbldieselprice.Text = c_billgeneration.txtc_deisprice.Text
lblpetamt.Text = Val(c_billgeneration.txtc_petrolbill.Text)
lbldieselamt.Text = Val(c_billgeneration.txtc_deiselbill.Text)
lbltotal.Text = Val(c_billgeneration.txtC_b_totalbill.Text)
lbldate.Text = c_billgeneration.Txtc_b_date.Text
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button1.Click
Button1.Visible = False
PrintForm1.Print(Me,
PowerPacks.Printing.PrintForm.PrintOption.CompatibleModeClientAreaOnly)
Button1.Visible = True
End Sub

End Class

67
Petrol Pump Management System

Program Name:c_search
Program Function: This is form is use to search and
delete Customer with bill detail
Data entry form:

Pseudo Code:
Sr. No. ButtonNa Procedur Description
1 Delete Click Deletes the current Record.
2 First Click Display First Record.
3 Previous Click Display Previous Record.
4 Next Click Display Next record.
5 Last Click Display Last Record.
6 Search Click To Search Record.

68
Petrol Pump Management System

Code:-
Imports System.Data.SqlClient
Public Class c_search
Public cn As New SqlConnection(MDI.con.ConnectionString)
Dim DA As New SqlDataAdapter("select * from cust_bill;", cn)
Dim odv As DataView
Dim ode As New DataSet
Dim objcur As CurrencyManager
Private Sub c_search_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
filldatasetandview()
bindfields()
End Sub
Public Sub filldatasetandview()
ode.Tables.Clear()
DA.Fill(ode, "cust_bill")
odv = New DataView(ode.Tables("cust_bill"))
objcur = CType(Me.BindingContext(odv), CurrencyManager)
End Sub
Public Sub bindfields()
txtc_s_cid.DataBindings.Clear()
txtc_s_bid.DataBindings.Clear()
txtc_s_name.DataBindings.Clear()
txtc_s_vehno.DataBindings.Clear()
txtc_s_contno.DataBindings.Clear()
txtc_petrolbill.DataBindings.Clear()
txtc_deiselbill.DataBindings.Clear()
txtc_s_deisel1.DataBindings.Clear()
txtc_s_petrol1.DataBindings.Clear()
txtc_s_date.DataBindings.Clear()
txtc_s_totalbill.DataBindings.Clear()
txtc_s_cid.DataBindings.Add("text", odv, "cust_id")
txtc_s_bid.DataBindings.Add("text", odv, "bill_id")
txtc_s_name.DataBindings.Add("text", odv, "cust_name")
txtc_s_vehno.DataBindings.Add("text", odv, "cust_vehno")
txtc_s_contno.DataBindings.Add("text", odv, "cust_mobno")
txtc_petrolbill.DataBindings.Add("text", odv, "p_amt")
txtc_deiselbill.DataBindings.Add("text", odv, "d_amt2")
txtc_s_deisel1.DataBindings.Add("text", odv, "deisel")
txtc_s_petrol1.DataBindings.Add("text", odv, "petrol")
txtc_s_date.DataBindings.Add("text", odv, "cust_date")
txtc_s_totalbill.DataBindings.Add("text", odv, "totalbill")
End Sub
Private Sub btnc_s_1st_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnc_s_1st.Click
objcur.Position = 0

69
Petrol Pump Management System

End Sub
Private Sub btnc_s_next_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnc_s_next.Click
objcur.Position = objcur.Position + 1
End Sub
Private Sub btnc_s_pre_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnc_s_pre.Click
objcur.Position = objcur.Position - 1
End Sub
Private Sub btnc_s_last_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnc_s_last.Click
objcur.Position = objcur.Count - 1
End Sub

Private Sub ToolStripButton3_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs)
objcur.Position = objcur.Position + 1
End Sub
Private Sub ToolBTNsearch_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles ToolBTNsearch.Click
odv.Sort = "cust_id"
Dim intposition As Integer
intposition = odv.Find(Val(ToolStripTxtsearch.Text))
If intposition = -1 Then
MsgBox("no record found")
Else
objcur.Position = intposition
End If
End Sub
Private Sub btndelete_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btndelete.Click
If cn.State = ConnectionState.Open Then
cn.Close()
End If
cn.Open()
Dim intpossition As Integer
Dim cmd As New SqlCommand
Dim cmd1 As New SqlCommand
intpossition = Me.BindingContext(odv).Position - 1
If intpossition < 0 Then
intpossition = 1 End If
cmd.Connection = cn
cmd.CommandText = "delete from cust_bill where bill_id=@bill_id"
cmd.Parameters.Add("@bill_id", SqlDbType.Int)
cmd.Parameters("@bill_id").Value = Val(txtc_s_bid.Text)
cmd.ExecuteNonQuery()
cmd1.Connection = cn
cmd1.CommandText = "delete from cust_reg where cust_id=@cust_id"
cmd1.Parameters.Add("@cust_id", SqlDbType.Int)
cmd1.Parameters("@cust_id").Value = Val(txtc_s_cid.Text)

70
Petrol Pump Management System

cmd1.ExecuteNonQuery()
filldatasetandview()
bindfields()
cn.Close()
Me.BindingContext(odv).Position = intpossition
MessageBox.Show("Record deleted successfully")
End Sub
End Class

71
Petrol Pump Management System

Test Result:

72
Petrol Pump Management System

Program Name: addempolyee


Program Function: This is form is use to add new
empolyee
Data entry form:

Pseudo Code:
Sr. No. Button Procedure Description
Name
1 SUBMIT Click Adds the new employee
2 browse Click Select the photo of employee

73
Petrol Pump Management System

Code:-
Imports System.Data.SqlClient
Public Class addemployee
Public cn As New SqlConnection(MDI.con.ConnectionString)
Dim DA As New SqlDataAdapter("select * from addemployees;", cn)
Dim odv As DataView
Dim ode As New DataSet
Dim objcur As CurrencyManager
Dim gender As String
Dim vrimg As String
Private Sub btnimg_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnimg.Click
If imgopdilog.ShowDialog = Windows.Forms.DialogResult.OK Then
empimage.ImageLocation = imgopdilog.FileName
End If
End Sub
Private Sub addemployee_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
txtdoj.Text = Now.ToString("d")
comboshift.SelectedIndex = 0
filldatasetandview()
bindfields()
objcur.Position = objcur.Count - 1
txteid.DataBindings.Clear()
txteid.Text = Val(txteid.Text) + 1
End Sub
Public Sub filldatasetandview()
Try
ode.Tables.Clear()
DA.Fill(ode, "addemployees")
odv = New DataView(ode.Tables("addemployees"))
objcur = CType(Me.BindingContext(odv), CurrencyManager)
Catch ex As Exception
MsgBox("unable to open")
End Try
End Sub
Public Sub bindfields()
txteid.DataBindings.Clear()
txteid.DataBindings.Add("text", odv, "e_id")
End Sub
Private Sub btnsubmit_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnsubmit.Click
Dim cmd As New SqlCommand
cmd.Connection = cn
cn.Open()
cmd.CommandText = "insert into addemployees
values(@e_id,@e_name,@e_add,@e_contact,@e_age,@e_gender,@e_doj,@e_post,@e_sh
ift,@e_salary,@e_img)"
cmd.Parameters.Add("@e_id", SqlDbType.Int).Value = Val(txteid.Text)

74
Petrol Pump Management System

cmd.Parameters.Add("@e_name", SqlDbType.VarChar).Value = (txtname.Text)


cmd.Parameters.Add("@e_add", SqlDbType.VarChar).Value = txtadd.Text
cmd.Parameters.Add("@e_contact", SqlDbType.BigInt).Value = Val(txtcotact.Text)
cmd.Parameters.Add("@e_age", SqlDbType.Real).Value = Val(txtage.Text)
cmd.Parameters.Add("@e_gender", SqlDbType.VarChar)
If Rmale.Checked Then
cmd.Parameters("@e_gender").Value = Rmale.Text
Else
cmd.Parameters("@e_gender").Value = Rfemale.Text
End If
cmd.Parameters.Add("@e_img", SqlDbType.VarChar).Value =
empimage.ImageLocation
cmd.Parameters.Add("@e_doj", SqlDbType.VarChar).Value = txtdoj.Text
cmd.Parameters.Add("@e_post", SqlDbType.VarChar).Value = txtpost.Text
cmd.Parameters.Add("@e_shift", SqlDbType.VarChar).Value =
comboshift.SelectedItem
cmd.Parameters.Add("@e_salary", SqlDbType.Int).Value = Val(txtmsalary.Text)
If cmd.ExecuteNonQuery > 0 Then
MsgBox("Employee Added")
filldatasetandview()
bindfields()
objcur.Position = objcur.Count - 1
txteid.DataBindings.Clear()
txteid.Text = Val(txteid.Text) + 1
empimage.ImageLocation = "C:\petrol pump\My Pictures\photo.bmp"
Rmale.Checked = True
txtadd.Clear()
txtcotact.Clear()
txtname.Clear()
txtage.Clear()
txtpost.Clear()
txtmsalary.Clear()
End If
cn.Close()
End Sub
Private Sub txtcotact_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles txtcotact.KeyPress
Dim c As Char
c = e.KeyChar
If Not (Char.IsDigit(c) Or Char.IsControl(c)) Then
e.Handled = True
MsgBox("enter only digit")
End If
If txtcotact.TextLength > 12 Then
e.Handled = True
MsgBox("Maximum 12 Digit are allowded")
End If
End Sub
Private Sub txtname_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles txtname.KeyPress

75
Petrol Pump Management System

Dim c As Char
c = e.KeyChar
If (Char.IsDigit(c)) Then
e.Handled = True
MsgBox("Number are not alloweded")
End If
End Sub
Private Sub txtage_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles txtage.KeyPress
Dim c As Char
c = e.KeyChar
If Not (Char.IsDigit(c) Or Char.IsControl(c)) Then
e.Handled = True
MsgBox("enter only digit")
End If
End Sub
Private Sub txteid_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles txteid.KeyPress
Dim c As Char
c = e.KeyChar
If Not (Char.IsDigit(c) Or Char.IsControl(c)) Then
e.Handled = True
MsgBox("enter only digit")
End If
End Sub
Private Sub txtpost_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles txtpost.KeyPress
Dim c As Char
c = e.KeyChar
If (Char.IsDigit(c)) Then
e.Handled = True
MsgBox("Number are not alloweded")
End If
End Sub
Private Sub txtmsalary_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles txtmsalary.KeyPress
Dim c As Char
c = e.KeyChar
If Not (Char.IsDigit(c) Or Char.IsControl(c)) Then
e.Handled = True
MsgBox("enter only digit")
End If
End Sub
Private Sub txteid_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles txteid.TextChanged
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
End Sub

76
Petrol Pump Management System

Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Label1.Click
End Sub
End Class

77
Petrol Pump Management System

Test Result:

78
Petrol Pump Management System

Program Name: searchemp


Program Function: This is form is use to search, update,
delete
Employee detail
Data entry form:

Pseudo Code:
Sr. No. ButtonName Procedure Description
1 Delete Click Deletes the current Record.
2 First Click Display First Record.
3 Previous Click Display Previous Record.
4 Next Click Display Next record.
5 Last Click Display Last Record.
6 Search Click To Search Record.
7 update Click Update the record

79
Petrol Pump Management System

Code:-
Imports System.Data.SqlClient
Public Class searchemp
Public cn As New SqlConnection(MDI.con.ConnectionString)
Dim DA As New SqlDataAdapter("select * from addemployees;", cn)
Dim odv As DataView
Dim ode As New DataSet
Dim objcur As CurrencyManager
Dim gender As String
Dim vrimg As String
Private Sub searchemp_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Try
filldatasetandview()
bindfields()
gendertest()
vrimg = txtimg.Text
Catch ex As Exception
MsgBox("unable to open")
Me.Close()
End Try
End Sub
Public Sub filldatasetandview()
Try
ode.Tables.Clear()
DA.Fill(ode, "addemployees")
odv = New DataView(ode.Tables("addemployees"))
objcur = CType(Me.BindingContext(odv), CurrencyManager)
Catch ex As Exception
MsgBox("unable to open")
End Try
End Sub
Public Sub bindfields()
txteid.DataBindings.Clear()
txtadd.DataBindings.Clear()
txtcotact.DataBindings.Clear()
txtname.DataBindings.Clear()
txtage.DataBindings.Clear()
txtdoj.DataBindings.Clear()
txtpost.DataBindings.Clear()
comboshift.DataBindings.Clear()
txtmsalary.DataBindings.Clear()
txtimg.DataBindings.Clear()
txtgender.DataBindings.Clear()
txteid.DataBindings.Add("text", odv, "e_id")
txtname.DataBindings.Add("text", odv, "e_name")

80
Petrol Pump Management System

txtadd.DataBindings.Add("text", odv, "e_add")


txtage.DataBindings.Add("text", odv, "e_age")
txtdoj.DataBindings.Add("text", odv, "e_doj")
txtpost.DataBindings.Add("text", odv, "e_post")
txtmsalary.DataBindings.Add("text", odv, "e_salary")
comboshift.DataBindings.Add("text", odv, "e_shift")
txtcotact.DataBindings.Add("text", odv, "e_contact")
txtimg.DataBindings.Add("text", odv, "e_img")
txtgender.DataBindings.Add("text", odv, "e_gender")
gendertest()
End Sub
Public Sub gendertest()
Try
If txtgender.Text = Rfemale.Text.Trim Then
Rfemale.Checked = True
Else
Rmale.Checked = True
End If
empimage.BackgroundImage = Image.FromFile(txtimg.Text)
txtimg.Visible = False
txtgender.Visible = False
Catch ex As Exception
MsgBox("unable to open")
End Try
End Sub
Private Sub btnnext_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnnext.Click
Try
objcur.Position = objcur.Position + 1
empimage.BackgroundImage = Image.FromFile(txtimg.Text)
gendertest()

Catch ex As Exception
MsgBox("unable to open")
End Try
End Sub
Private Sub txtpre_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles txtpre.Click
Try
objcur.Position = objcur.Position - 1
empimage.BackgroundImage = Image.FromFile(txtimg.Text)
gendertest()
Catch ex As Exception
MsgBox("unable to open")
End Try
End Sub
Private Sub txtfirst_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles txtfirst.Click
Try
objcur.Position = 0

81
Petrol Pump Management System

empimage.BackgroundImage = Image.FromFile(txtimg.Text)
gendertest()
Catch ex As Exception
MsgBox("unable to open")
End Try
End Sub
Private Sub txtlast_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles txtlast.Click
Try
objcur.Position = objcur.Count - 1
empimage.BackgroundImage = Image.FromFile(txtimg.Text)
gendertest()
Catch ex As Exception
MsgBox("unable to open")
End Try
End Sub
Private Sub btnimg_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnimg.Click
Try
If imgopdilog.ShowDialog = Windows.Forms.DialogResult.OK Then
vrimg = imgopdilog.FileName
empimage.BackgroundImage = Image.FromFile(vrimg)
txtimg.Text = vrimg
End If
Catch ex As Exception
MsgBox("unable to open")
End Try

End Sub

Private Sub btnupdate_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnupdate.Click
Dim curpos As Integer
curpos = objcur.Position
Try
Dim cmd As New SqlCommand
cmd.Connection = cn
cn.Open()
cmd.CommandText = "update addemployees set e_name= @e_name,e_add=
@e_add,e_contact= @e_contact,e_age= @e_age,e_gender= @e_gender,e_doj=
@e_doj,e_post= @e_post,e_shift= @e_shift,e_salary= @e_salary,e_img= @e_img where
e_id= @e_id"
cmd.Parameters.Add("@e_id", SqlDbType.Int).Value = Val(txteid.Text)
cmd.Parameters.Add("@e_name", SqlDbType.VarChar).Value = (txtname.Text)
cmd.Parameters.Add("@e_add", SqlDbType.VarChar).Value = txtadd.Text
cmd.Parameters.Add("@e_contact", SqlDbType.BigInt).Value =
Val(txtcotact.Text)
cmd.Parameters.Add("@e_age", SqlDbType.Real).Value = Val(txtage.Text)
cmd.Parameters.Add("@e_gender", SqlDbType.VarChar)

82
Petrol Pump Management System

If Rmale.Checked Then
cmd.Parameters("@e_gender").Value = Rmale.Text
Else
cmd.Parameters("@e_gender").Value = Rfemale.Text
End If
cmd.Parameters.Add("@e_img", SqlDbType.VarChar).Value = txtimg.Text
cmd.Parameters.Add("@e_doj", SqlDbType.VarChar).Value = txtdoj.Text
cmd.Parameters.Add("@e_post", SqlDbType.VarChar).Value = txtpost.Text
cmd.Parameters.Add("@e_shift", SqlDbType.VarChar).Value =
comboshift.SelectedItem
cmd.Parameters.Add("@e_salary", SqlDbType.Int).Value = Val(txtmsalary.Text)
If cmd.ExecuteNonQuery > 0 Then
MsgBox("Record Upadated")
End If
objcur.Position = objcur.Position
filldatasetandview()
bindfields()
cn.Close()
objcur.Position = curpos
Catch ex As Exception
MsgBox("unable to update")
End Try
empimage.BackgroundImage = Image.FromFile(txtimg.Text)
gendertest()
End Sub
Private Sub ToolStripBtnsearch_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles ToolStripBtnsearch.Click
Try
odv.Sort = "e_id"
Dim intposition As Integer
intposition = odv.Find(Val(ToolStripTxtsearch.Text))
If intposition = -1 Then
MsgBox("no record found")
Else
objcur.Position = intposition
End If
empimage.BackgroundImage = Image.FromFile(txtimg.Text)
gendertest()
Catch ex As Exception
MsgBox("unable to open")
End Try
End Sub
Private Sub txtcotact_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles txtcotact.KeyPress
Dim c As Char
c = e.KeyChar
If Not (Char.IsDigit(c) Or Char.IsControl(c)) Then
e.Handled = True
MsgBox("enter only digit")
End If

83
Petrol Pump Management System

End Sub
Private Sub txtname_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles txtname.KeyPress
Dim c As Char
c = e.KeyChar
If (Char.IsDigit(c)) Then
e.Handled = True
MsgBox("Number are not alloweded")
End If

End Sub

Private Sub txtage_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles txtage.KeyPress
Dim c As Char
c = e.KeyChar
If Not (Char.IsDigit(c) Or Char.IsControl(c)) Then
e.Handled = True
MsgBox("enter only digit")
End If
End Sub

Private Sub txteid_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles txteid.KeyPress
Dim c As Char
c = e.KeyChar
If Not (Char.IsDigit(c) Or Char.IsControl(c)) Then
e.Handled = True
MsgBox("enter only digit")
End If
End Sub
Private Sub txtpost_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles txtpost.KeyPress
Dim c As Char
c = e.KeyChar
If (Char.IsDigit(c)) Then
e.Handled = True
MsgBox("Number are not alloweded")
End If
End Sub

Private Sub txtmsalary_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles txtmsalary.KeyPress
Dim c As Char
c = e.KeyChar
If Not (Char.IsDigit(c) Or Char.IsControl(c)) Then
e.Handled = True
MsgBox("enter only digit")
End If
End Sub

84
Petrol Pump Management System

Private Sub ToolStripTxtsearch_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles ToolStripTxtsearch.KeyPress
Dim c As Char
c = e.KeyChar
If Not (Char.IsDigit(c) Or Char.IsControl(c)) Then
e.Handled = True
MsgBox("enter only digit")
End If
End Sub
Private Sub btndelete_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btndelete.Click
Dim intpossition As Integer
Dim cmd As New SqlCommand
intpossition = Me.BindingContext(odv).Position - 1
If intpossition < 0 Then
intpossition = 1
End If
cmd.Connection = cn
cmd.CommandText = "delete from addemployees where e_id=@e_id2"
cmd.Parameters.Add("@e_id2", SqlDbType.Int)
cmd.Parameters("@e_id2").Value = Val(txteid.Text)
cn.Open()
cmd.ExecuteNonQuery()
filldatasetandview()
bindfields()
cn.Close()
Me.BindingContext(odv).Position = intpossition
MessageBox.Show("Record deleted successfully")
End Sub
Private Sub btndelete_Click_1(ByVal sender As System.Object, ByVal e As
System.EventArgs)
End Sub

Private Sub txtname_TextChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs)

End Sub
End Class

85
Petrol Pump Management System

Test Result:

86
Petrol Pump Management System

Program Name: attendance


Program Function: This is form is use to store employee
‘s attendance
Data entry form

Pseudo Code:
Sr. No. ButtonName Procedure Description
1 submit Click Store attendance
2 update Click Update attendance

87
Petrol Pump Management System

Code:
Imports System.Data.SqlClient

public Class attendance

Public cn As New SqlConnection("Data Source=localhost;Initial Catalog=alam;Integrated


Security=True")

Private Sub attendance_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
txtdate.Text = Now.ToString("d")
Dim cmd As New SqlCommand
cmd.Connection = cn
cn.Open()
cmd.CommandText = "select e_id from addemployees"
Dim reader As SqlDataReader
reader = cmd.ExecuteReader
While reader.Read
ID.Items.Add(reader.Item("e_id"))
End While
cn.Close()
ID.SelectedIndex = 0
End Sub
Private Sub ID_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles ID.SelectedIndexChanged
btnsubmit.Enabled = True
btnupdate.Enabled = False
Dim cmd As New SqlCommand
cmd.Connection = cn
cn.Open()
cmd.CommandText = "select e_name from addemployees where e_id=@e_id"
cmd.Parameters.Add("e_id", SqlDbType.Int).Value = ID.SelectedItem
Dim reader As SqlDataReader
reader = cmd.ExecuteReader
While reader.Read
txtname.Text = reader.Item("e_name")
End While
cn.Close()
cmd.Connection = cn
cn.Open()
cmd.CommandText = "select adate from attendance where eid=@eid"
cmd.Parameters.Add("@eid", SqlDbType.Int).Value = ID.SelectedItem
Dim reader1 As SqlDataReader
reader1 = cmd.ExecuteReader
While reader1.Read
If reader1.Item("adate") = txtdate.Text Then
btnsubmit.Enabled = False
btnupdate.Enabled = True
cn.Close()

88
Petrol Pump Management System

Exit Sub
End If
End While
cn.Close()
End Sub
Private Sub txtname_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles txtname.TextChanged
End Sub
Private Sub btnsubmit_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnsubmit.Click
Dim cmd As New SqlCommand
cmd.Connection = cn
cn.Open()
cmd.CommandText = "insert into attendance values(@eid,@ename,@status,@adate)"
cmd.Parameters.Add("@eid", SqlDbType.Int).Value = Val(ID.SelectedItem)
cmd.Parameters.Add("@ename", SqlDbType.VarChar).Value = txtname.Text
cmd.Parameters.Add("@status", SqlDbType.VarChar)
If rdbpresent.Checked = True Then
cmd.Parameters("@status").Value = rdbpresent.Text
ElseIf rdbabsent.Checked = True Then
cmd.Parameters("@status").Value = rdbabsent.Text
ElseIf Rdboff.Checked Then
cmd.Parameters("@status").Value = Rdboff.Text
End If
cmd.Parameters.Add("@adate", SqlDbType.VarChar).Value = txtdate.Text
If cmd.ExecuteNonQuery > 0 Then
MsgBox("done")
btnsubmit.Enabled = False
btnupdate.Enabled = True
End If
cn.Close()
End Sub
Private Sub btnupdate_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnupdate.Click
Dim cmd As New SqlCommand
cmd.Connection = cn
cn.Open()
cmd.CommandText = "update attendance set status=@status where eid=@eid and
adate=@adate"
cmd.Parameters.Add("@eid", SqlDbType.Int).Value = Val(ID.SelectedItem)
cmd.Parameters.Add("@status", SqlDbType.VarChar)
If rdbpresent.Checked = True Then
cmd.Parameters("@status").Value = rdbpresent.Text
ElseIf rdbabsent.Checked = True Then
cmd.Parameters("@status").Value = rdbabsent.Text
ElseIf Rdboff.Checked Then
cmd.Parameters("@status").Value = Rdboff.Text
End If
cmd.Parameters.Add("@adate", SqlDbType.VarChar).Value = txtdate.Text
If cmd.ExecuteNonQuery > 0 Then

89
Petrol Pump Management System

MsgBox("done")

End If
cn.Close()
End Sub
End Class

90
Petrol Pump Management System

Test result:

91
Petrol Pump Management System

Program Name: salary


Program Function: This is form is use to calculate salary
and to store salary information of employee
Data entry form:

Pseudo Code:
Sr. No. ButtonName Procedure Description
1 submit Click Store salary information

92
Petrol Pump Management System

Code:-
Imports System.Data.SqlClient
Public Class salary
Public cn As New SqlConnection(MDI.con.ConnectionString)

Private Sub salary_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles MyBase.Load

cmbyear.SelectedIndex = 6
Dim cmd As New SqlCommand
cmd.Connection = cn
cn.Open()
cmd.CommandText = "select e_id from addemployees"
Dim reader As SqlDataReader
reader = cmd.ExecuteReader
While reader.Read
comboid.Items.Add(reader.Item("e_id"))

End While
cn.Close()
comboid.SelectedIndex = 0
End Sub

Private Sub comboid_SelectedIndexChanged(ByVal sender As System.Object, ByVal e


As System.EventArgs) Handles comboid.SelectedIndexChanged
combomonth.SelectedIndex = -1
Txtnetsal.Text = ""
txttotal.Text = ""
txtabsent.Text = ""
txtoff.Text = ""
txtpresent.Text = ""
txtadvance.Text = ""
Dim cmd As New SqlCommand
cmd.Connection = cn
cn.Open()
cmd.CommandText = "select e_name,e_salary from addemployees where e_id=@e_id"
cmd.Parameters.Add("e_id", SqlDbType.Int).Value = comboid.SelectedItem
Dim reader As SqlDataReader
reader = cmd.ExecuteReader
While reader.Read
txtname.Text = reader.Item("e_name")
txtsalary.Text = reader.Item("e_salary")
End While
cn.Close()
End Sub
Private Sub combomonth_SelectedIndexChanged(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles combomonth.SelectedIndexChanged
btnsubmit.Enabled = True
Dim nodaypresent As Integer = 0

93
Petrol Pump Management System

Dim nodayabsent As Integer = 0


Dim nodayoff As Integer = 0
txtadvance.Text = "0"
Dim cmd As New SqlCommand
cmd.Connection = cn
cn.Open()
cmd.CommandText = "select status from attendance where eid=@eid and
month(adate)=@adate"
cmd.Parameters.Add("@eid", SqlDbType.Int).Value = Val(comboid.SelectedItem)
cmd.Parameters.Add("@adate", SqlDbType.Int).Value = combomonth.SelectedIndex +
1

Dim reader1 As SqlDataReader


reader1 = cmd.ExecuteReader
While reader1.Read
If reader1.Item("status") = "present" Then
nodaypresent = nodaypresent + 1
ElseIf reader1.Item("status") = "absent" Then
nodayabsent = nodayabsent + 1
ElseIf reader1.Item("status") = "off" Then
nodayoff = nodayoff + 1
End If
End While
cn.Close()
txtpresent.Text = nodaypresent
txtoff.Text = nodayoff
txtabsent.Text = 26 - (Val(txtpresent.Text) + Val(txtoff.Text))
Dim cmd2 As New SqlCommand
cmd.Connection = cn
cn.Open()
cmd.CommandText = "select sum(advance) as 'asum' from advance where eid=@eid1
and month(adate)=@adate1 and year(adate)=@year"
cmd.Parameters.Add("@eid1", SqlDbType.Int).Value = comboid.SelectedItem
cmd.Parameters.Add("@adate1", SqlDbType.Int).Value = combomonth.SelectedIndex +
1
cmd.Parameters.Add("@year", SqlDbType.Int).Value = (cmbyear.SelectedItem)
Dim reader2 As SqlDataReader
reader2 = cmd.ExecuteReader
Try
While reader2.Read
txtadvance.Text = reader2.Item("asum")
End While
Catch ex As Exception
End Try
cn.Close()
Dim advancetaken As Decimal
Dim monthlysalary As Decimal
Dim toatlsalary As Integer
Dim salaryperday As Decimal

94
Petrol Pump Management System

monthlysalary = Val(txtsalary.Text)
advancetaken = Val(txtadvance.Text)
salaryperday = Val(txtsalary.Text) / 26
Dim salarypresent As Decimal
salarypresent = Val(txtpresent.Text) * salaryperday
Dim salaryof As Decimal
salaryof = Val(txtoff.Text) * salaryperday * 0.75
toatlsalary = salarypresent + salaryof - advancetaken
txttotal.Text = toatlsalary
Txtnetsal.Text = toatlsalary + advancetaken

Dim cmd3 As New SqlCommand


cmd3.Connection = cn
cn.Open()
cmd3.CommandText = "select smonth from salaryreport where eid=@eid2"
cmd3.Parameters.Add("@eid2", SqlDbType.Int).Value = comboid.SelectedItem
Dim reader3 As SqlDataReader
reader3 = cmd3.ExecuteReader
While reader3.Read
If reader3.Item("smonth") = combomonth.SelectedItem & " " &
cmbyear.SelectedItem Then
btnsubmit.Enabled = False
Else
btnsubmit.Enabled = True
cn.Close()
Exit Sub
End If
End While
cn.Close()
If combomonth.SelectedIndex = -1 Then
btnsubmit.Enabled = False
End If

End Sub
Private Sub btnsubmit_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnsubmit.Click
Dim cmd As New SqlCommand
cmd.Connection = cn
cn.Open()
cmd.CommandText = "insert into salaryreport
values(@eid,@ename,@smonth,@present,@absent,@doff,@monthlys,@netsal)"
cmd.Parameters.Add("@eid", SqlDbType.Int).Value = Val(comboid.SelectedItem)
cmd.Parameters.Add("@smonth", SqlDbType.VarChar).Value =
combomonth.SelectedItem & " " & cmbyear.SelectedItem
cmd.Parameters.Add("@ename", SqlDbType.VarChar).Value = txtname.Text
cmd.Parameters.Add("@present", SqlDbType.Int).Value = Val(txtpresent.Text)
cmd.Parameters.Add("@absent", SqlDbType.Int).Value = Val(txtabsent.Text)
cmd.Parameters.Add("@doff", SqlDbType.Int).Value = Val(txtoff.Text)
cmd.Parameters.Add("@monthlys", SqlDbType.Real).Value = Val(txtsalary.Text)
cmd.Parameters.Add("@netsal", SqlDbType.Real).Value = Val(Txtnetsal.Text)

95
Petrol Pump Management System

If cmd.ExecuteNonQuery > 0 Then


MsgBox("salary record inserted")
End If
cn.Close()
End Sub
Private Sub cmbyear_SelectedIndexChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles cmbyear.SelectedIndexChanged
combomonth.SelectedIndex = -1
btnsubmit.Enabled = False
Txtnetsal.Text = ""
txttotal.Text = ""
txtabsent.Text = ""
txtoff.Text = ""
txtpresent.Text = ""
txtadvance.Text = ""
End Sub

End Class

96
Petrol Pump Management System

Test result:-

97
Petrol Pump Management System

Program Name:advance
Program Function: This is form is use to allocate advance
payment to employee
Data entry form:

Pseudo Code:

Sr. No. ButtonName Procedure Description


1 submit Click Store advance payment information

98
Petrol Pump Management System

Code:-
Imports System.Data.SqlClient
Public Class advance
Public cn As New SqlConnection(MDI.con.ConnectionString)
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles comboid.SelectedIndexChanged
Dim cmd As New SqlCommand
cmd.Connection = cn
cn.Open()
cmd.CommandText = "select e_name,e_salary from addemployees where e_id=@e_id"
cmd.Parameters.Add("e_id", SqlDbType.Int).Value = comboid.SelectedItem
Dim reader As SqlDataReader
reader = cmd.ExecuteReader
While reader.Read
txtname.Text = reader.Item("e_name")
End While
cn.Close()
End Sub
Private Sub advance_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
txtdate.Text = Now.ToString("d")
Dim cmd As New SqlCommand
cmd.Connection = cn
cn.Open()
cmd.CommandText = "select e_id from addemployees"
Dim reader As SqlDataReader
reader = cmd.ExecuteReader
While reader.Read
comboid.Items.Add(reader.Item("e_id"))
End While
cn.Close()
comboid.SelectedIndex = 0
End Sub
Private Sub btnsubmit_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnsubmit.Click
Dim cmd As New SqlCommand
cmd.Connection = cn
cn.Open()
cmd.CommandText = "insert into advance values(@eid,@ename,@adate,@advance)"
cmd.Parameters.Add("@eid", SqlDbType.Int).Value = Val(comboid.SelectedItem)
cmd.Parameters.Add("@ename", SqlDbType.VarChar).Value = txtname.Text
cmd.Parameters.Add("@adate", SqlDbType.VarChar).Value = txtdate.Text
cmd.Parameters.Add("@advance", SqlDbType.Real).Value = Val(txtadv.Text)
If cmd.ExecuteNonQuery > 0 Then
MsgBox("advace granted sucsesfuly")
End If
End Sub
Private Sub txtadv_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles txtadv.KeyPress

99
Petrol Pump Management System

Dim c As Char
c = e.KeyChar
If Not (Char.IsDigit(c) Or Char.IsControl(c)) Then
e.Handled = True
MsgBox("enter only digit")
End If
End Sub
End Class

100
Petrol Pump Management System

Test result:

101
Petrol Pump Management System

Program Name: frmstock


Program Function: This is form is use to set and get stock
information
Data entry form:

Pseudo Code:
Sr. No. ButtonName Procedure Description
1 ADD Click Adds the specified quantity in stock
2 Save changes Click Save the changes in stock

102
Petrol Pump Management System

Code:-
Imports System.Data.SqlClient
Public Class frmstock
Dim petstock As Decimal
Dim desstock As Decimal
Dim i As Decimal
Dim j As Decimal
Public con As New SqlConnection(MDI.con.ConnectionString)

Private Sub frmstock_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
con.Open()
Dim cmd4 As New SqlCommand
cmd4.Connection = con
cmd4.CommandText = "select * from pro_detail where p_id=1"
Dim reader1 As SqlDataReader
reader1 = cmd4.ExecuteReader
While reader1.Read
txtpet_stock.Text = reader1.Item("p_stock")
petstock = reader1.Item("p_stock")
End While
If con.State = ConnectionState.Open Then
con.Close()
End If
con.Open()
Dim cmd5 As New SqlCommand
cmd5.Connection = con
cmd5.CommandText = "select * from pro_detail where p_id=2"
Dim reader2 As SqlDataReader
reader2 = cmd5.ExecuteReader
While reader2.Read
txtdes_stock.Text = reader2.Item("p_stock")
desstock = reader2.Item("p_stock")
End While
If con.State = ConnectionState.Open Then
con.Close()
End If
End Sub
Private Sub btnp_supdate_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnp_supdate.Click
i = Val(InputBox("Enter petrol amount in ltr.", "stock update"))
If i = 0 Then
ElseIf i < 0 Then
MsgBox("can't enter negative value")
Else
txtpet_stock.Text = petstock + i
End If
End Sub

103
Petrol Pump Management System

Private Sub btnd_supdate_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnd_supdate.Click
j = Val(InputBox("Enter petrol amount in ltr.", "stock update"))
If j = 0 Then
ElseIf j < 0 Then
MsgBox("can't enter negative value")
Else
txtdes_stock.Text = desstock + j
End If
End Sub

Private Sub btnsave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles btnsave.Click
Dim cmd As New SqlCommand
cmd.Connection = con
con.Open()
cmd.CommandText = "update pro_detail set p_stock=@p_stock where p_id=1"
cmd.Parameters.Add("@p_stock", SqlDbType.Real)
cmd.Parameters("@p_stock").Value = Val(txtpet_stock.Text)
cmd.ExecuteNonQuery()
con.Close()
Dim cmd1 As New SqlCommand
con.Open()
cmd1.Connection = con
cmd1.CommandText = "update pro_detail set p_stock=@p_stock where p_id=2"
cmd1.Parameters.Add("@p_stock", SqlDbType.Real)
cmd1.Parameters("@p_stock").Value = Val(txtdes_stock.Text)
cmd1.ExecuteNonQuery()
con.Close()
Dim cmd2 As New SqlCommand
con.Open()
cmd2.Connection = con
cmd2.CommandText = "insert into inventryfile values(@i_date,@i_petrol,@i_diesel)"
cmd2.Parameters.Add("@i_date", SqlDbType.VarChar)
cmd2.Parameters("@i_date").Value = Now().ToString("d")
cmd2.Parameters.Add("@i_petrol", SqlDbType.Real)
cmd2.Parameters("@i_petrol").Value = i
cmd2.Parameters.Add("@i_diesel", SqlDbType.Real)
cmd2.Parameters("@i_diesel").Value = j
If cmd2.ExecuteNonQuery > 0 Then
MsgBox("stock updated")
End If
con.Close()
End Sub
End Class

104
Petrol Pump Management System

Test result:-

105
Petrol Pump Management System

Program Name : price


Program Function: This is form is use to set and get
product price
Data entry form:

Pseudo Code:

Sr. No. ButtonName Procedure Description


1 Update Click Update the price of product

106
Petrol Pump Management System

Code:-
Imports System.Data.SqlClient

Public Class price


Dim petprice As Decimal
Dim desprice As Decimal
Public con As New SqlConnection(MDI.con.ConnectionString)
Private Sub price_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
con.Open()
Dim cmd4 As New SqlCommand
cmd4.Connection = con
cmd4.CommandText = "select * from pro_detail where p_id=1"
Dim reader1 As SqlDataReader
reader1 = cmd4.ExecuteReader
While reader1.Read
txtpet_price.Text = reader1.Item("p_price")
petprice = reader1.Item("p_price")
End While
If con.State = ConnectionState.Open Then
con.Close()
End If
con.Open()
Dim cmd5 As New SqlCommand
cmd5.Connection = con
cmd5.CommandText = "select * from pro_detail where p_id=2"
Dim reader2 As SqlDataReader
reader2 = cmd5.ExecuteReader
While reader2.Read
txtdes_price.Text = reader2.Item("p_price")
desprice = reader2.Item("p_price")
End While
If con.State = ConnectionState.Open Then
con.Close()
End If
End Sub
Private Sub btnp_update_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnp_update.Click
Dim i As Decimal
i = Val(InputBox("Enter new price", "price setup"))
If i = 0 Then
Else
Dim cmd As New SqlCommand
con.Open()
cmd.Connection = con
cmd.CommandText = "update pro_detail set p_price=@p_price where p_id=1"
cmd.Parameters.Add("@p_price", SqlDbType.Real)
cmd.Parameters("@p_price").Value = i
cmd.ExecuteNonQuery()

107
Petrol Pump Management System

txtpet_price.Text = i
If con.State = ConnectionState.Open Then
con.Close()
End If
End If
End Sub
Private Sub btnd_update_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnd_update.Click
Dim j As Decimal
j = Val(InputBox("Enter new price", "price setup"))
If j = 0 Then
Else
Dim cmd As New SqlCommand
con.Open()
cmd.Connection = con
cmd.CommandText = "update pro_detail set p_price=@p_price where p_id=2"
cmd.Parameters.Add("@p_price", SqlDbType.Real)
cmd.Parameters("@p_price").Value = j
cmd.ExecuteNonQuery()

txtdes_price.Text = j
If con.State = ConnectionState.Open Then
con.Close()

End If
End If
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs)

End Sub

End Class

108
Petrol Pump Management System

Test result:-

109
Petrol Pump Management System

Program Name:-chgpass
Program Function: This is form is used to change the
password of the user .
Data entry form:

110
Petrol Pump Management System

Code:-

Imports System.Data.SqlClient
Imports System.Windows.Forms

Public Class chgpass


Public cn As New SqlConnection(MDI.con.ConnectionString)
Private Sub btnok_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnok.Click
If pass.Text = Login.password Then
Dim cmd As New SqlCommand
cmd.Connection = cn
If cn.State = ConnectionState.Open Then
cn.Close()
End If
cn.Open()
If npass.Text = repass.Text Then
cmd.CommandText = "update login set passwrd=@passwrd where
username=@username"
cmd.Parameters.Add("@username", SqlDbType.VarChar).Value =
Login.cmbusrename.Text
cmd.Parameters.Add("@passwrd", SqlDbType.VarChar).Value = npass.Text
If cmd.ExecuteNonQuery > 0 Then
MsgBox("Your Password Has Been Succsesfully Changed",
MsgBoxStyle.Information)
End If
Else
MsgBox("Password mismatch", MsgBoxStyle.Exclamation)
End If
End If
End Sub

Private Sub btncancel_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btncancel.Click
Me.Close()
End Sub

End Class

111
Petrol Pump Management System

Test Result:

112
Petrol Pump Management System

Program Name:-aboutus
Program Function: This is form is used to display details
about system.
Test Result:

113
Petrol Pump Management System

Report Layouts
Report Name:- customer
Report function: - This form displays report of all customers
Test Result:-

114
Petrol Pump Management System

Code:-
Imports CrystalDecisions.CrystalReports.Engine
Public Class billreport1

Private Sub billreport1_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
Me.MdiParent = MDI
Dim crptdoc As New ReportDocument
crptdoc.Load("C:\petrol pump\petrol pump\CrystalReport11.rpt")
CrystalReportViewer1.ReportSource = crptdoc
CrystalReportViewer1.Update()
End Sub
End Class

115
Petrol Pump Management System

Report Name:- sales


Report function: - This form displays all sales report
Test Result:-

116
Petrol Pump Management System

Code:-
Imports CrystalDecisions.CrystalReports.Engine
Public Class sales

Private Sub sales_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles MyBase.Load
Me.MdiParent = MDI
Dim crptdoc As New ReportDocument
crptdoc.Load("C:\petrol pump\petrol pump\Crystalsales.rpt")
CrystalReportViewer1.ReportSource = crptdoc
CrystalReportViewer1.Update()
End Sub
End Class

117
Petrol Pump Management System

Report Name: - emprecord


Report function: - This report is use to print & show the
list of the employee
Test Result:-

118
Petrol Pump Management System

Code:-
Imports CrystalDecisions.CrystalReports.Engine
Public Class emprecord

Private Sub emprecord_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
Me.MdiParent = MDI
Dim crptdoc As New ReportDocument
crptdoc.Load("C:\petrol pump\petrol pump\Crystalemp.rpt")
CrystalReportViewer1.ReportSource = crptdoc
CrystalReportViewer1.Update()
End Sub
End Class

119
Petrol Pump Management System

Report Name: - salaryreport


Report function: - This report is use to print & display
salary report of employee
Test Result:-

120
Petrol Pump Management System

Code:-
Imports CrystalDecisions.CrystalReports.Engine
Public Class Salaryreport

Private Sub Salaryreport_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
Me.MdiParent = MDI
Dim crptdoc As New ReportDocument
crptdoc.Load("C:\petrol pump\petrol pump\Crystalsalary.rpt")
CrystalReportViewer1.ReportSource = crptdoc
CrystalReportViewer1.Update()
End Sub
End Class

121
Petrol Pump Management System

Report Name: - inventoryreport


Report function: This report is use to print and show
inventory detail
Test Result:-

122
Petrol Pump Management System

Code:-
Imports CrystalDecisions.CrystalReports.Engine
Public Class inventryreport1

Private Sub inventryreport1_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
Me.MdiParent = MDI
Dim crptdoc As New ReportDocument
crptdoc.Load("C:\petrol pump\petrol pump\Crystalinventry.rpt")
CrystalReportViewer1.ReportSource = crptdoc
CrystalReportViewer1.Update()
End Sub

End Class

123
Petrol Pump Management System

Validations

Test Cases:- Invalid Phone number.

124
Petrol Pump Management System

Code:-
Private Sub txtc_r_name_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles txtc_r_name.KeyPress
Dim c As Char
c = e.KeyChar
If (Char.IsDigit(c)) Then
e.Handled = True
MsgBox("Number are not alloweded")
End If
End Sub

Private Sub txtc_r_contno_TextChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles txtc_r_contno.TextChanged
If txtc_r_contno.TextLength = 12 Then

MsgBox("Maximum 12 Digit are allowded")


End If
End Sub
End Class

125
Petrol Pump Management System

Test Cases:- Invalid name

126
Petrol Pump Management System

Code:-

Private Sub txtpost_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles txtpost.KeyPress
Dim c As Char
c = e.KeyChar
If (Char.IsDigit(c)) Then
e.Handled = True
MsgBox("Number are not alloweded")
End If
End Sub

127
Petrol Pump Management System

Chapter 5
System Implementation &
Uploading

128
Petrol Pump Management System

System Implementation

1. Install visual studio 2008 and sql server 2005.


2. Attach database to sql server 2005.
3. Copy project files on the machine
4. Execute the project.

129
Petrol Pump Management System

SYSTEM CONTROLS AND STANDARDS

1. Access control:-
System gives access by valid password.

2. Input control:-
System validates every textbox. It allows textual values for fields like customer name.
It also validates some numeric data only for fields like phone no.

3. System Generated control:-


In Order details it automatically calculates total price of the product. Similarly in
Receipt details it automatically deducts the amount from the actual amount.

4. Range control:-
In Order Transaction the system checks whether quantity given by the user is not more
than the available product.

130
Petrol Pump Management System

Chapter 6
Future Enhancement

131
Petrol Pump Management System

Future Enhancement

Being a computer system, the system has good scope to be improved


further.

Future Enhancements are as listed below

 Administrator can be given more rights so that he will be able to change


order details.
 Type 4 driver will be used so that sytem will work faster.
 I will develop the system on LAN to setup the connection between other
petrol pump of same company.

132
Petrol Pump Management System

Conclusion

System helps to store all the data about the customer order in computer
and there is no need to do paper work.

Data is going to be preserved carefully for longer period hence proper


backup is required otherwise there is chance of losing entries or data.

133
Petrol Pump Management System

Chapter 7
References &
Bibliography

134
Petrol Pump Management System

References & Bibliography

Sr.No. Type Description

Book name : Visual Basic 2008


1. Author : Anne Boehm

Publication : Murach
Book name : Mastering Visual Basic 2008
2.
Author : Evangelos Petroutsos

Publication : Wiley-India Edition


Book name : Professional SQL Server 2005
Integration Services
Author : Brian Knight, Allan Mitchell, Darren
3. Green, Mike Murphy

Publication : Kindle Edition

www.google.com
www.wonderranchpublishing.net
4 URL www.hindustanpetroleum.com

135

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy