You are on page 1of 44

FUEL MANAGEMENT SYSTEM

CHAPTER 1

INTRODUCTION

Fuel-management systems are used to maintain, control and monitor fuel consumption and stock in
any type of industry that uses transport, including rail, road, water and air, as a means of business.
Fuel-management systems are designed to effectively measure and manage the use of fuel within the
transportation and construction industries. They are typically used for fleets of vehicles, including
railway vehicles and aircraft, as well as any vehicle that requires fuel to operate. They employ various
methods and technologies to monitor and track fuel inventories, fuel purchases and fuel dispensed.
This information can be then stored in computerized systems and reports generated with data to
inform management practices. Online fuel management is provided through the use of web portals to
provide detailed fueling data, usually the back end of an automated fuel-management system. This
enables consumption control, cost analysis and tax accounting for fuel purchases.

There are several types of fuel-management systems. Card-based fuel-management systems typically
track fuel transactions based on a fueling credit card and the associated driver PIN. Reports can then
be generated based on fuel consumption by driver, and data can be directly downloaded. On-site fuel-
management systems may employ fleet refueling services or bulk fuel tanks at the site. Fuel is tracked
as it is pumped into vehicles, and on-site storage levels can be managed.

Some fuel companies offer total fuel-management systems whereby they provide elements of a card-
based system along with on-site fuel delivery and refueling services. Mobile fuel management refers
to a fleet of fuel trucks or tankers which provide fuel supply to commercial fleets of trucks or
construction equipment. May involve combining RFID technology to identify equipment and
automated fuel management to append the details of each transaction to a unique piece of equipment.
By refueling vehicles in the evening when they are not in use, the company can conserve man-hours
as the operators do not refuel and the vehicles do not require additional fuel to travel to the refueling
station. They may also employ more sophisticated systems that utilize remote data collection to gather
specific technical information about the vehicle usage and performance characteristics such as
mileage, hours of operation and engine idling time.

The increasing use of biofuel has introduced another challenge in fuel management. With greater
water content, there will be a risk of microbial growth – depending on the storage conditions, the fuel
quality will deteriorate over time, leading to clogged filters and loss of productivity.

Tank manufacturers have introduced fuel filtering and cleansing packs which recirculate the tank
contents through a series of filters and ultraviolet treatment to kill bacteria. Data from fuel quality
instrumentation can be streamed to allow remote monitoring over Internet connections.

1
FUEL MANAGEMENT SYSTEM

1.2 PROPOSED SYSTEM:

The aim of the proposed system is to develop a system of improved facilities. The proposed system can
overcome the limitations of the existing system. The system provides proper security and reduces the
manual work.
The system is very simple in design and to implement. The system requires very low system resources
and the system will work in all configurations. It has got following feature:
 Security of data.
 Ensures data accuracy.
 Proper control of the higher officials.
 Reduce the damages of the machine.
 Minimum time is needed for the various processing.
 Greater efficiency.
 Better services.
 User-friendliness and interactive.
 Minimum time required.
 This system, try to automate the entire process keeping in the view of database integration
approach.
 Authentication features is provided for this application only admin can access.

The process includes the admin checking the fuel quantity available at various agencies spread
across the state and the admin will also be able to check the number of agencies present across
the state. Once the admin verification is complete the customer can book the fuel through the
application and can check the prices of the fuel against the current prices.

2
FUEL MANAGEMENT SYSTEM

CHAPTER-2

2. SYSTEM REQUIREMENT SPECIFICATIONS:


2.1. Hardware requirements:
Hardware refers to the item in a PC that can be touched and felt like keyboard, monitor, mouse, and the
system unit. Additional hardware components that can be added to the PC are modem, printer, scanner
etc.
The hardware thus used here are consists of:
Processor -Intel(R) Core(TM) i7-3110M CPU @ 2.40GHz 2.40 GHz
RAM -16.00 GB
Hard Disk -1TB
Graphics -1.50 GHz
Quality - 64 bit Screen
Resolution - 1366 * 768
Mouse - Standard Optical

2.1 Software requiremnets:


There is use of large software in developing this project. Software is the logical program that handles
different components, which cannot be touched or felt and helps to interact with one another in a hassle-
free manner.
The software used her consists of:
Operating system - Windows 10
Developing tool -MS visual Studio 2010
Front End (design) -VB.NET
Back End (design) -MS SQL server 2008

3
FUEL MANAGEMENT SYSTEM

CHAPTER-3
SYSTEM FLOW
3.1 DATA FLOW DIAGRAM
A graphical tool used to describe and analysis the movement of data through a system is called
dataflow diagram. Dataflow diagram is the central basis, from which other components are developed,
the transformation of data from input to output, through process, maybe described logically and
independent of the physical components associated with the system.
The DFD is also known as a dataflow, graph or a bubble chart.
Types of dataflow diagram:
A )Physical DFD
B )Logical DFD
3.1.1. PHYSICAL DFD:
Structure analysis states that current system should first understand correctly. The physical DFD is the
model of current system and is used to ensure that system has been clearly understood. Physical DFD's
shows actual devices, departments etc. involved in the current system.

3.1.2 LOGICAL DFD:

Logical DFD are the model of proposed system. They clearly should show the requirement on which
the new system should be built. Later during the design, activity thus taken has basis for drawing the
system structure charts.
The basic notation used to create DFD's are:
DATA FLOW: data move in a specific direction from an origin to a destination. The physical
component is not identified.

SOURCE: External source or destination of data, which maybe people, organization other entity.

4
FUEL MANAGEMENT SYSTEM

STORAGE: DATA here data are stored or referenced by a processor in the system.

DESIGN: Design is the first step in moving from domain to the solution domain. Design is especially
the bridge between requirement specification and the final solution. the goal of the design process is to
produce a model for representation of a system, which can be used later to build that system. The
produced model is called the "design of the system".
It is the solution for the system. In this level the focus is on dividing the module which is needed for
the system and the specification of these models.

3.2 DATA FLOW DIAGRAM

LEVEL 0:

System
Registration

Data Base

LEVEL 1: ADMIN
&
USER

LOGIN

HOME PAGE

5
FUEL MANAGEMENT SYSTEM

LEVEL 2:

FUEL
MANAGEMENT

ADMINMDI
Main form

ADD STATE

Admin Login
ADD CITY

MAIN Database
USER PAGE ADD
AGENCY

ADD
OFFICER
EXIT AGENCY
/AGENCY
INFO

Price
check
ACCEPT
ORDER
ORDER
FUEL

EXIT

PAYMENT

6
FUEL MANAGEMENT SYSTEM

ER DIAGRAM

ADMIN USER
1:1
1:

11
MAIN PAGE
Log
inin

Admin MDI Log


in
Add State
CHECK
PRICE

Add city
AGENCY
CHECK NAME
AGENCIES

Statistics PRICE Phone no


CHECK

Email
Health Info
FAQ

PAYMENT
News

Logout
Logout

7
FUEL MANAGEMENT SYSTEM

DATA TABLES

AdminLogin:

Name Data Type

Username nvarchar(MAX)
Password nvarchar(MAX)

UserVerfication:

Name Data Type

User nvarchar(MAX)
Price nvarchar(MAX)
Name nvarchar(MAX)
Phone no nvarchar(MAX)
Email nvarchar(MAX)
City nvarchar(MAX)
State nvarchar(MAX)

AddCityTab:

Name Data Type


State name nvarchar(MAX)

City name nvarchar(MAX)


Details nvarchar(MAX)

8
FUEL MANAGEMENT SYSTEM

AddStateTab:

Name Data Type


State name nvarchar(MAX)
Details nvarchar(MAX)

AgencyVerificationTab:
Name Data Type
Agency name nvarchar(MAX)
City name nvarchar(MAX)
State name nvarchar(MAX)

OrderTab:
Name Data Type
Fuel Order Money

PriceTab:
Name Data Type
Fuel Price Money

PaymentTab:
Name Data Type
Order Payment Money

9
FUEL MANAGEMENT SYSTEM

CHAPTER 4
CODING

4.1 SOURCECODE

ADMIN LOGIN FORM


Imports System.Data.SqlClient

Public Class adminlogin

' TODO: Insert code to perform custom authentication using the provided username and password
' (See http://go.microsoft.com/fwlink/?LinkId=35339).
' The custom principal can then be attached to the current thread's principal as follows:
' My.User.CurrentPrincipal = CustomPrincipal
' where CustomPrincipal is the IPrincipal implementation used to perform authentication.
' Subsequently, My.User will return identity information encapsulated in the CustomPrincipal
object
' such as the username, display name, etc.

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


OK.Click
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim cmd0 As New SqlCommand("select * from adminlogin where username='" &
UCase(UsernameTextBox.Text) & "' and password= '" & PasswordTextBox.Text & "'", Conn)
Dim D1 As SqlDataReader = cmd0.ExecuteReader()
If D1.HasRows Then
adminmain.Show()
Me.Hide()
If Conn.State = ConnectionState.Open Then Conn.Close()
Else
MsgBox("Username or password is not corret please Check!!!")
End If
UsernameTextBox.Text = ""
PasswordTextBox.Text = ""
End Sub

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


Cancel.Click
Me.Close()
End Sub

10
FUEL MANAGEMENT SYSTEM

End Class

ADMIN MAIN FORM


Public Class adminmain

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


System.EventArgs) Handles LogoutToolStripMenuItem.Click
If MessageBox.Show("Are You Sure You Want To Logout?", "Logout",
MessageBoxButtons.YesNo, MessageBoxIcon.Question) = Windows.Forms.DialogResult.Yes Then
main.Show()
Me.Hide()
Else
Me.Show()
End If
End Sub

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


Handles PictureBox1.Click
Me.Show()
End Sub

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


System.EventArgs) Handles PriceDetailsToolStripMenuItem.Click
Me.Hide()
pricedetails.Show()
End Sub

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


System.EventArgs) Handles StatesDetailsToolStripMenuItem.Click
Me.Hide()
statedetails.Show()
End Sub

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


System.EventArgs) Handles CitiesDetailsToolStripMenuItem.Click
Me.Hide()
citydetails.Show()
End Sub

Private Sub CityWiseAdministrativeOfficersToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
CityWiseAdministrativeOfficersToolStripMenuItem.Click
Me.Hide()
officerdetails.Show()
End Sub

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


System.EventArgs) Handles GeneralFAQToolStripMenuItem.Click
Me.Hide()
faqdetails.Show()
End Sub
11
FUEL MANAGEMENT SYSTEM

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


System.EventArgs) Handles StatesListToolStripMenuItem.Click
Dim box = New statelist()
box.Show()
End Sub

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


System.EventArgs) Handles CitiesListToolStripMenuItem.Click
Dim box = New citylist()
box.Show()
End Sub

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


System.EventArgs) Handles OfficersListToolStripMenuItem.Click
Dim box = New officerlist()
box.Show()
End Sub

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


System.EventArgs) Handles GeneralFAQListToolStripMenuItem.Click
Dim box = New faqlist()
box.Show()
End Sub

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


e As System.EventArgs) Handles PetrolBunkApprovalToolStripMenuItem.Click
Me.Hide()
agencyapproval.Show()
End Sub

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


System.EventArgs) Handles PetrolBunkListToolStripMenuItem.Click
Dim box = New agencyapproved()
box.Show()
End Sub

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


System.EventArgs) Handles OrderListToolStripMenuItem.Click
Dim box = New aorderlist()
box.Show()
End Sub

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


System.EventArgs) Handles PaymentListToolStripMenuItem.Click
Dim box = New paymentlist()
box.Show()
End Sub

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


System.EventArgs) Handles PriceListToolStripMenuItem.Click
Dim box = New pricelist()
box.Show()
End Sub

12
FUEL MANAGEMENT SYSTEM

End Class

AGENCY APPROVAL FORM


Imports System.Data.SqlClient
Imports System.Net.Mail

Public Class agencyapproval


Dim pkvar
Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles PictureBox1.Click
Me.Hide()
adminmain.Show()
End Sub

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


System.EventArgs) Handles PriceDetailsToolStripMenuItem.Click
Me.Hide()
pricedetails.Show()
End Sub

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


System.EventArgs) Handles StatesDetailsToolStripMenuItem.Click
Me.Hide()
statedetails.Show()
End Sub

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


System.EventArgs) Handles CitiesDetailsToolStripMenuItem.Click
Me.Hide()
citydetails.Show()
End Sub

Private Sub CityWiseAdministrativeOfficersToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
CityWiseAdministrativeOfficersToolStripMenuItem.Click
Me.Hide()
officerdetails.Show()
End Sub

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


e As System.EventArgs) Handles PetrolBunkApprovalToolStripMenuItem.Click
Me.Show()
End Sub

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


System.EventArgs) Handles GeneralFAQToolStripMenuItem.Click
Me.Hide()
faqdetails.Show()
End Sub

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


System.EventArgs) Handles LogoutToolStripMenuItem.Click

13
FUEL MANAGEMENT SYSTEM

If MessageBox.Show("Are You Sure You Want To Logout?", "Logout",


MessageBoxButtons.YesNo, MessageBoxIcon.Question) = Windows.Forms.DialogResult.Yes Then
main.Show()
Me.Hide()
Else
Me.Show()
End If
End Sub

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


System.EventArgs) Handles StatesListToolStripMenuItem.Click
Dim box = New statelist()
box.Show()
End Sub

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


System.EventArgs) Handles CitiesListToolStripMenuItem.Click
Dim box = New citylist()
box.Show()
End Sub

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


System.EventArgs) Handles OfficersListToolStripMenuItem.Click
Dim box = New officerlist()
box.Show()
End Sub

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


System.EventArgs) Handles GeneralFAQListToolStripMenuItem.Click
Dim box = New faqlist()
box.Show()
End Sub

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


System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
pkvar = DataGridView1.CurrentRow.Cells(0).Value
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim Cmd0 As New SqlCommand("Select * from agencyreg where PumpRegNo='" & pkvar & "'",
Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
If D1.HasRows Then
D1.Read()
'TextBox1.Text = D1(0).ToString
'TextBox2.Text = D1(1).ToString
Else
'TextBox1.Text = ""
'TextBox2.Text = ""
End If
End Sub
Sub disRecords()
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim DS1 As New DataSet
Dim adp As New SqlDataAdapter("select
PumpRegNo,Password,AgencyName,Address,City,State,OwnerName,PhoneNumber,EmailId From agencyreg
order by PumpRegNo", Conn)

14
FUEL MANAGEMENT SYSTEM

adp.Fill(DS1)
DataGridView1.DataSource = DS1.Tables(0)
If Conn.State = ConnectionState.Open Then Conn.Close()
End Sub

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


Handles MyBase.Load
disRecords()
End Sub

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


System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles DataGridView1.CellMouseClick
On Error Resume Next
TextBox1.Text = DataGridView1.Rows(e.RowIndex).Cells(0).Value
TextBox2.Text = DataGridView1.Rows(e.RowIndex).Cells(1).Value
TextBox3.Text = DataGridView1.Rows(e.RowIndex).Cells(2).Value
TextBox4.Text = DataGridView1.Rows(e.RowIndex).Cells(3).Value
TextBox5.Text = DataGridView1.Rows(e.RowIndex).Cells(7).Value
TextBox6.Text = DataGridView1.Rows(e.RowIndex).Cells(8).Value
TextBox8.Text = DataGridView1.Rows(e.RowIndex).Cells(6).Value
End Sub

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


Handles Button1.Click
Dim q1var, q2var
If TextBox1.Text = "" Then
MsgBox("Please Enter The Necessary Details")
Exit Sub
End If
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim cmd0 As New SqlCommand("Select PumpRegNo from approvedtab where PumpRegNo='" &
(TextBox1.Text) & "'", Conn)
Dim D1 As SqlDataReader = cmd0.ExecuteReader()
If D1.HasRows Then
MsgBox("This Agent Is Already Been Approved")
If Conn.State = ConnectionState.Open Then Conn.Close()
Exit Sub
End If
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
q1var = "Insert into approvedtab("
q2var = "Values("
q1var = q1var & "PumpRegNo" & " , "
q2var = q2var & "'" & (TextBox1.Text) & " ', "
q1var = q1var & "Password" & " , "
q2var = q2var & "'" & (TextBox2.Text) & " ', "
q1var = q1var & "AgencyName" & " , "
q2var = q2var & "'" & (TextBox3.Text) & " ', "
q1var = q1var & "Address" & " , "
q2var = q2var & "'" & (TextBox4.Text) & " ', "
q1var = q1var & "OwnerName" & " , "
q2var = q2var & "'" & (TextBox8.Text) & " ', "
q1var = q1var & "PhoneNumber" & " , "
q2var = q2var & "'" & (TextBox5.Text) & " ', "
q1var = q1var & "EmailId" & ")"
q2var = q2var & "'" & (TextBox6.Text) & " ') "

15
FUEL MANAGEMENT SYSTEM

Dim cmd1 As New SqlCommand(q1var & q2var, Conn)


cmd1.ExecuteNonQuery()
If Conn.State = ConnectionState.Open Then Conn.Close()
'disRecords()

TextBox7.AppendText("Fuel Management System" + vbNewLine)


TextBox7.AppendText("----------------------------------------------------------" +
vbNewLine)
TextBox7.AppendText("Welcome To Fuel Management System" + vbNewLine)
TextBox7.AppendText("----------------------------------------------------------" +
vbNewLine)
TextBox7.AppendText("User Id : " + TextBox1.Text + vbNewLine)
TextBox7.AppendText("Password : " + TextBox2.Text + vbNewLine)
TextBox7.AppendText("----------------------------------------------------------" +
vbNewLine)
TextBox7.AppendText("Please Login With These Credentials" + vbNewLine)
TextBox7.AppendText("----------------------------------------------------------" +
vbNewLine)

Dim Mail As New MailMessage


Mail.Subject = "Your Request For Petrol Bunk Has Been Approved!!!"
If TextBox6.Text = "" Then
MsgBox("Please Enter The E-Mail Address", MsgBoxStyle.Information +
MsgBoxStyle.OkOnly, "Error!")
End If
Mail.To.Add(TextBox6.Text)
Mail.From = New MailAddress("fuelmanagement360@gmail.com")
Mail.Body = TextBox7.Text

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


SMTP.EnableSsl = True
SMTP.Credentials = New System.Net.NetworkCredential("fuelmanagement360@gmail.com",
"Fuel@360")
SMTP.Port = "587"

SMTP.Send(Mail)
MsgBox("Approved Successfully")

TextBox1.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox2.Text = ""
TextBox5.Text = ""
TextBox6.Text = ""
TextBox7.Text = ""
TextBox8.Text = ""

End Sub

16
FUEL MANAGEMENT SYSTEM

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


System.EventArgs) Handles PetrolBunkListToolStripMenuItem.Click
Dim box = New agencyapproved()
box.Show()
End Sub

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


System.EventArgs) Handles OrderListToolStripMenuItem.Click
Dim box = New aorderlist()
box.Show()
End Sub

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


System.EventArgs) Handles PaymentListToolStripMenuItem.Click
Dim box = New paymentlist()
box.Show()
End Sub

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


System.EventArgs) Handles PriceListToolStripMenuItem.Click
Dim box = New pricelist()
box.Show()
End Sub

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


Handles TextBox1.TextChanged

End Sub
End Class

AGENCY LOGIN FORM


Imports System.Data.SqlClient

Public Class agencyloginvb

' TODO: Insert code to perform custom authentication using the provided username and password
' (See http://go.microsoft.com/fwlink/?LinkId=35339).
' The custom principal can then be attached to the current thread's principal as follows:
' My.User.CurrentPrincipal = CustomPrincipal
' where CustomPrincipal is the IPrincipal implementation used to perform authentication.
' Subsequently, My.User will return identity information encapsulated in the CustomPrincipal
object
' such as the username, display name, etc.

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


OK.Click
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim cmd0 As New SqlCommand("select * from approvedtab where PumpRegNo='" &
UCase(UsernameTextBox.Text) & "' and Password= '" & PasswordTextBox.Text & "'", Conn)
Dim D1 As SqlDataReader = cmd0.ExecuteReader()
If D1.HasRows Then
agencymain.Show()
Me.Hide()
17
FUEL MANAGEMENT SYSTEM

If Conn.State = ConnectionState.Open Then Conn.Close()


Else
MsgBox("Username or password is not corret please Check!!!")
End If
UsernameTextBox.Text = ""
PasswordTextBox.Text = ""
End Sub

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


Cancel.Click
Me.Close()
End Sub

End Class
AGENCY REG FORM
Imports System.Data.SqlClient
Imports System.Net.Mail
Imports System.Text.RegularExpressions

Public Class agencyreg


Dim RandGen As New Random
Dim Emailvalid As Boolean
Dim Namevalid As Boolean

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


Handles PictureBox1.Click
Me.Hide()
main.Show()
End Sub

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


Handles MyBase.Load
TextBox1.Text = "PUMP" + RandGen.Next(1000, 10000).ToString
TextBox2.Text = "PASS" + RandGen.Next(100, 999).ToString

If Conn.State = ConnectionState.Open Then Conn.Close()


Conn.Open()
Dim command As New SqlCommand("select * from statetab", Conn)
Dim adapter As New SqlDataAdapter(command)
Dim table As New DataTable()
adapter.Fill(table)
ComboBox1.DataSource = table
ComboBox1.DisplayMember = "Statename"
ComboBox1.ValueMember = "Statename"

End Sub

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


Handles Button1.Click
Dim q1var, q2var
If TextBox1.Text = "" Then
MsgBox("Please Enter The Necessary Details")
Exit Sub
End If

18
FUEL MANAGEMENT SYSTEM

If Conn.State = ConnectionState.Open Then Conn.Close()


Conn.Open()
Dim cmd0 As New SqlCommand("Select PumpRegNo from agencyreg where PumpRegNo='" &
(TextBox1.Text) & "'", Conn)
Dim D1 As SqlDataReader = cmd0.ExecuteReader()
If D1.HasRows Then
MsgBox("You Have Already Applied")
If Conn.State = ConnectionState.Open Then Conn.Close()
Exit Sub
End If
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
q1var = "Insert into agencyreg("
q2var = "Values("
q1var = q1var & "PumpRegNo" & " , "
q2var = q2var & "'" & (TextBox1.Text) & " ', "
q1var = q1var & "Password" & " , "
q2var = q2var & "'" & (TextBox2.Text) & " ', "
q1var = q1var & "AgencyName" & " , "
q2var = q2var & "'" & (TextBox3.Text) & " ', "
q1var = q1var & "Address" & " , "
q2var = q2var & "'" & (TextBox4.Text) & " ', "
q1var = q1var & "City" & " , "
q2var = q2var & "'" & (ComboBox1.Text) & " ', "
q1var = q1var & "State" & " , "
q2var = q2var & "'" & (ComboBox2.Text) & " ', "
q1var = q1var & "OwnerName" & " , "
q2var = q2var & "'" & (TextBox8.Text) & " ', "
q1var = q1var & "PhoneNumber" & " , "
q2var = q2var & "'" & (TextBox5.Text) & " ', "
q1var = q1var & "EmailId" & ")"
q2var = q2var & "'" & (TextBox6.Text) & " ') "

Dim cmd1 As New SqlCommand(q1var & q2var, Conn)


cmd1.ExecuteNonQuery()
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
'disrecords

MsgBox("Your Request For The Agency Is Successfull. Please Wait For The Approval!!")
TextBox1.Text = "PUMP" + RandGen.Next(1000, 10000).ToString
TextBox2.Text = "PASS" + RandGen.Next(100, 999).ToString
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox6.Text = ""
TextBox8.Text = ""
ComboBox1.Text = "Select"
ComboBox2.Text = "Select"

Me.Hide()
main.Show()
End Sub

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


System.Windows.Forms.MouseEventArgs) Handles ComboBox2.MouseClick

19
FUEL MANAGEMENT SYSTEM

End Sub

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


ComboBox1.Leave
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim command1 As New SqlCommand("select * from citytab where Statename = '" &
ComboBox1.Text & "' ", Conn)
Dim adapter1 As New SqlDataAdapter(command1)
Dim table1 As New DataTable()
adapter1.Fill(table1)
ComboBox2.DataSource = table1
ComboBox2.DisplayMember = "Cityname"
ComboBox2.ValueMember = "Cityname"
End Sub

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


System.EventArgs) Handles ComboBox1.SelectedIndexChanged

End Sub

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


TextBox6.LostFocus
Dim reEmail As Regex = New Regex("^[a-z][a-z|0-9|]*([_][a-z|0-9]+)*([.][a-z|0-
9]+([_][a-z|0-9]+)*)?@[a-z][a-z|0-9|]*\.([a-z][a-z|0-9]*(\.[a-z][a-z|0-9]*)?)$", _
RegexOptions.IgnoreCase _
Or RegexOptions.CultureInvariant _
Or RegexOptions.IgnorePatternWhitespace _
Or RegexOptions.Compiled _
)

Dim blnPossibleMatch As Boolean = reEmail.IsMatch(TextBox6.Text)


If blnPossibleMatch Then
If Not TextBox6.Text.Equals(reEmail.Match(TextBox6.Text).ToString) Then
MsgBox("Invalid Email Address")
Else
Emailvalid = True
End If
Else
Emailvalid = False
MsgBox("Invalid Email Id")
TextBox6.Clear()
TextBox6.Focus()
End If

End Sub

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


TextBox5.LostFocus
If Not Regex.Match(TextBox5.Text, "^[0-9]*$", RegexOptions.IgnoreCase).Success Then
MsgBox("Please enter that Numbers only")
TextBox5.Focus()
TextBox5.Clear()
Namevalid = False

20
FUEL MANAGEMENT SYSTEM

Else
Namevalid = True
End If
End Sub

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


TextBox3.LostFocus
If Not Regex.Match(TextBox3.Text, "^[A-z ]*$", RegexOptions.IgnoreCase).Success Then
MsgBox("Please enter that Alphabets only")
TextBox3.Focus()
TextBox3.Clear()
Namevalid = False
Else
Namevalid = True
End If
End Sub

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


TextBox4.LostFocus
If Not Regex.Match(TextBox4.Text, "^[A-z ]*$", RegexOptions.IgnoreCase).Success Then
MsgBox("Please enter that Alphabets only")
TextBox4.Focus()
TextBox4.Clear()
Namevalid = False
Else
Namevalid = True
End If
End Sub

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


TextBox8.LostFocus
If Not Regex.Match(TextBox8.Text, "^[A-z ]*$", RegexOptions.IgnoreCase).Success Then
MsgBox("Please enter that Alphabets only")
TextBox8.Focus()
TextBox8.Clear()
Namevalid = False
Else
Namevalid = True
End If
End Sub
End Class

MAIN FORM
Public Class main

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


Handles PictureBox3.Click
Dim box = New adminlogin()
box.Show()
End Sub

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


Handles PictureBox6.Click

21
FUEL MANAGEMENT SYSTEM

If MessageBox.Show("Are You Sure You Want To Quit?", "Quit", MessageBoxButtons.YesNo,


MessageBoxIcon.Question) = Windows.Forms.DialogResult.Yes Then
End
Else
Me.Show()
End If
End Sub

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


Handles PictureBox5.Click
Me.Hide()
agencyreg.Show()
End Sub

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


Dim box = New agencyloginvb()
box.Show()
End Sub

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


Handles PictureBox4.Click
Dim box = New agencyloginvb()
box.Show()
End Sub
End Class

ORDER ITEMS FORM


Imports System.Data.SqlClient
Imports System.Text.RegularExpressions

Public Class orderitem


Dim pkvar
Dim RandGen As New Random
Dim Namevalid As Boolean

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


System.EventArgs) Handles ToolStripMenuItem1.Click
Dim box = New consumerpricelist()
box.Show()
End Sub

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


Handles PictureBox1.Click
Me.Hide()
agencymain.Show()
End Sub

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


System.EventArgs) Handles LogoutToolStripMenuItem.Click

22
FUEL MANAGEMENT SYSTEM

If MessageBox.Show("Are You Sure You Want To Logout?", "Logout",


MessageBoxButtons.YesNo, MessageBoxIcon.Question) = Windows.Forms.DialogResult.Yes Then
adminmain.Show()
Me.Close()
Else
Me.Show()
End If
End Sub

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


System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellClick
On Error Resume Next
TextBox1.Text = DataGridView1.Rows(e.RowIndex).Cells(0).Value
TextBox2.Text = DataGridView1.Rows(e.RowIndex).Cells(1).Value
TextBox4.Text = DataGridView1.Rows(e.RowIndex).Cells(2).Value
TextBox3.Text = DataGridView1.Rows(e.RowIndex).Cells(3).Value
End Sub
Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick

pkvar = DataGridView1.CurrentRow.Cells(0).Value
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim Cmd0 As New SqlCommand("Select * from cpricetab where Petrol='" & pkvar & "'", Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
If D1.HasRows Then
D1.Read()
'TextBox1.Text = D1(0).ToString
'TextBox2.Text = D1(1).ToString
Else
'TextBox1.Text = ""
'TextBox2.Text = ""
End If
End Sub
Sub disRecords()
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim DS1 As New DataSet
Dim adp As New SqlDataAdapter("select Petrol ,Diesel ,Oil50ml, Oil100ml From cpricetab
order by Petrol", Conn)
adp.Fill(DS1)
DataGridView1.DataSource = DS1.Tables(0)
If Conn.State = ConnectionState.Open Then Conn.Close()
End Sub

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


Handles MyBase.Load
TextBox10.Text = "BOOK" + RandGen.Next(1000, 10000).ToString
disRecords()
End Sub

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


Handles Button1.Click
Dim q1var, q2var
If TextBox10.Text = "" Then
MsgBox("Please Enter The Necessary Details")
Exit Sub

23
FUEL MANAGEMENT SYSTEM

End If
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim cmd0 As New SqlCommand("Select BookingId from ordertab where BookingId='" &
(TextBox10.Text) & "'", Conn)
Dim D1 As SqlDataReader = cmd0.ExecuteReader()
If D1.HasRows Then
MsgBox("Already Ordered With Same Booking Number")
If Conn.State = ConnectionState.Open Then Conn.Close()
Exit Sub
End If
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
q1var = "Insert into ordertab("
q2var = "Values("
q1var = q1var & "BookingId" & " , "
q2var = q2var & "'" & (TextBox10.Text) & " ', "
q1var = q1var & "Petrol" & " , "
q2var = q2var & "'" & (TextBox8.Text) & " ', "
q1var = q1var & "Diesel" & " , "
q2var = q2var & "'" & (TextBox7.Text) & " ', "
q1var = q1var & "Oil50ml" & " , "
q2var = q2var & "'" & (TextBox6.Text) & " ', "
q1var = q1var & "Oil100ml" & " , "
q2var = q2var & "'" & (TextBox5.Text) & " ', "
q1var = q1var & "Amount" & ")"
q2var = q2var & "'" & (TextBox9.Text) & " ') "

Dim cmd1 As New SqlCommand(q1var & q2var, Conn)


cmd1.ExecuteNonQuery()
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
'disrecords

MsgBox("Your Order Request Is Successfull.Please Make The Payment !!")


TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox6.Text = ""
TextBox7.Text = ""
TextBox8.Text = ""
TextBox9.Text = ""
TextBox10.Text = "BOOK" + RandGen.Next(1000, 10000).ToString

End Sub

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


System.Windows.Forms.MouseEventArgs) Handles TextBox9.MouseClick
Dim petrol, diesel, oil50ml, oil100ml, Amount As Integer
petrol = Val(TextBox1.Text) * Val(TextBox8.Text)
diesel = Val(TextBox2.Text) * Val(TextBox7.Text)
oil50ml = Val(TextBox3.Text) * Val(TextBox6.Text)
oil100ml = Val(TextBox4.Text) * Val(TextBox5.Text)
Amount = petrol + diesel + oil50ml + oil100ml

24
FUEL MANAGEMENT SYSTEM

TextBox9.Text = Amount
End Sub

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


Handles Button2.Click
Me.Hide()
payment.Show()
End Sub

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


System.EventArgs) Handles ToolStripMenuItem4.Click
Me.Show()
End Sub

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


System.EventArgs) Handles ToolStripMenuItem6.Click

Dim box = New dofficerlist()


box.Show()
End Sub

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


System.EventArgs) Handles ToolStripMenuItem5.Click
Dim box = New orderlist()
box.Show()
End Sub

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


System.EventArgs) Handles ToolStripMenuItem8.Click
Dim box = New dfaqlist()
box.Show()
End Sub

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


TextBox5.Leave
TextBox9.Text = Val(TextBox3.Text) * Val(TextBox5.Text) + Val(TextBox4.Text) *
Val(TextBox6.Text) + Val(TextBox2.Text) * Val(TextBox7.Text) + Val(TextBox1.Text) *
Val(TextBox8.Text)
End Sub

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


TextBox8.LostFocus
If Not Regex.Match(TextBox8.Text, "^[0-9]*$", RegexOptions.IgnoreCase).Success Then
MsgBox("Please enter that Numbers only")
TextBox8.Focus()
TextBox8.Clear()
Namevalid = False
Else
Namevalid = True
End If
End Sub

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


TextBox7.LostFocus
If Not Regex.Match(TextBox7.Text, "^[0-9]*$", RegexOptions.IgnoreCase).Success Then
MsgBox("Please enter that Numbers only")
TextBox7.Focus()

25
FUEL MANAGEMENT SYSTEM

TextBox7.Clear()
Namevalid = False
Else
Namevalid = True
End If
End Sub

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


TextBox6.LostFocus
If Not Regex.Match(TextBox6.Text, "^[0-9]*$", RegexOptions.IgnoreCase).Success Then
MsgBox("Please enter that Numbers only")
TextBox6.Focus()
TextBox6.Clear()
Namevalid = False
Else
Namevalid = True
End If
End Sub

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


TextBox5.LostFocus
If Not Regex.Match(TextBox5.Text, "^[0-9]*$", RegexOptions.IgnoreCase).Success Then
MsgBox("Please enter that Numbers only")
TextBox5.Focus()
TextBox5.Clear()
Namevalid = False
Else
Namevalid = True
End If
End Sub
End Class

PAYMENT FORM
Imports System.Data.SqlClient
Imports System.Net.Mail
Imports System.Text.RegularExpressions

Public Class payment


Dim pkvar
Dim Emailvalid As Boolean

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


Handles PictureBox1.Click
Me.Hide()
agencymain.Show()
End Sub

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


System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellClick
On Error Resume Next
TextBox10.Text = DataGridView1.Rows(e.RowIndex).Cells(0).Value
TextBox8.Text = DataGridView1.Rows(e.RowIndex).Cells(1).Value
TextBox7.Text = DataGridView1.Rows(e.RowIndex).Cells(2).Value
TextBox6.Text = DataGridView1.Rows(e.RowIndex).Cells(3).Value
26
FUEL MANAGEMENT SYSTEM

TextBox5.Text = DataGridView1.Rows(e.RowIndex).Cells(4).Value
TextBox9.Text = DataGridView1.Rows(e.RowIndex).Cells(5).Value
End Sub

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


System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
pkvar = DataGridView1.CurrentRow.Cells(0).Value
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim Cmd0 As New SqlCommand("Select * from ordertab where BookingId='" & pkvar & "'",
Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
If D1.HasRows Then
D1.Read()
'TextBox1.Text = D1(0).ToString
'TextBox2.Text = D1(1).ToString
Else
'TextBox1.Text = ""
'TextBox2.Text = ""
End If
End Sub
Sub disRecords()
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim DS1 As New DataSet
Dim adp As New SqlDataAdapter("select BookingId,Petrol ,Diesel ,Oil50ml, Oil100ml,
Amount From ordertab order by BookingId", Conn)
adp.Fill(DS1)
DataGridView1.DataSource = DS1.Tables(0)
If Conn.State = ConnectionState.Open Then Conn.Close()
End Sub

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


MyBase.Load
disRecords()

If Conn.State = ConnectionState.Open Then Conn.Close()


Conn.Open()
Dim command As New SqlCommand("select * from approvedtab", Conn)
Dim adapter As New SqlDataAdapter(command)
Dim table As New DataTable()
adapter.Fill(table)
ComboBox2.DataSource = table
ComboBox2.DisplayMember = "PumpRegNo"
ComboBox2.ValueMember = "PumpRegNo"
End Sub

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


Handles Button1.Click
Dim q1var, q2var
If TextBox10.Text = "" Then
MsgBox("Please Enter The Necessary Details")
Exit Sub
End If
If Conn.State = ConnectionState.Open Then Conn.Close()

27
FUEL MANAGEMENT SYSTEM

Conn.Open()
Dim cmd0 As New SqlCommand("Select BookingId from payment where BookingId='" &
(TextBox10.Text) & "'", Conn)
Dim D1 As SqlDataReader = cmd0.ExecuteReader()
If D1.HasRows Then
MsgBox("Already Payment Is Done")
If Conn.State = ConnectionState.Open Then Conn.Close()
Exit Sub
End If
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
q1var = "Insert into payment("
q2var = "Values("
q1var = q1var & "BookingId" & " , "
q2var = q2var & "'" & (TextBox10.Text) & " ', "
q1var = q1var & "Petrol" & " , "
q2var = q2var & "'" & (TextBox8.Text) & " ', "
q1var = q1var & "Diesel" & " , "
q2var = q2var & "'" & (TextBox7.Text) & " ', "
q1var = q1var & "Oil50ml" & " , "
q2var = q2var & "'" & (TextBox6.Text) & " ', "
q1var = q1var & "Oil100ml" & " , "
q2var = q2var & "'" & (TextBox5.Text) & " ', "
q1var = q1var & "Amount" & " , "
q2var = q2var & "'" & (TextBox9.Text) & " ', "
q1var = q1var & "PumpRegNo" & " , "
q2var = q2var & "'" & (ComboBox2.Text) & " ', "
q1var = q1var & "EmailId" & " , "
q2var = q2var & "'" & (TextBox1.Text) & " ', "
q1var = q1var & "payment" & ")"
q2var = q2var & "'" & (ComboBox1.Text) & " ') "

Dim cmd1 As New SqlCommand(q1var & q2var, Conn)


cmd1.ExecuteNonQuery()
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
'disrecords

TextBox2.AppendText("Fuel Management System" + vbNewLine)


TextBox2.AppendText("----------------------------------------------------------" +
vbNewLine)
TextBox2.AppendText("Welcome To Fuel Management System" + vbNewLine)
TextBox2.AppendText("----------------------------------------------------------" +
vbNewLine)
TextBox2.AppendText("Pump Reg. No. : " + ComboBox2.Text + vbNewLine)
TextBox2.AppendText("Booking Id : " + TextBox10.Text + vbNewLine)
TextBox2.AppendText("Email Id : " + TextBox1.Text + vbNewLine)
TextBox2.AppendText("----------------------------------------------------------" +
vbNewLine)
TextBox2.AppendText("Petrol In Liters : " + TextBox8.Text + vbNewLine)
TextBox2.AppendText("Disel In Liters : " + TextBox7.Text + vbNewLine)
TextBox2.AppendText("Oil 50 ML(Packets) In Liters : " + TextBox6.Text + vbNewLine)
TextBox2.AppendText("Oil 100 ML(Packets) In Liters : " + TextBox5.Text + vbNewLine)
TextBox2.AppendText("----------------------------------------------------------" +
vbNewLine)
TextBox2.AppendText("Total Amount :" + TextBox9.Text + vbNewLine)

28
FUEL MANAGEMENT SYSTEM

TextBox2.AppendText("----------------------------------------------------------" +
vbNewLine)
TextBox2.AppendText("----------------------------------------------------------" +
vbNewLine)
TextBox2.AppendText(Today & vbTab & TimeOfDay + vbNewLine)
TextBox2.AppendText("----------------------------------------------------------" +
vbNewLine)
TextBox2.AppendText("Mode Of Payment :" + ComboBox1.Text + vbNewLine)
TextBox2.AppendText("----------------------------------------------------------" +
vbNewLine)
TextBox2.AppendText("Thanks For The Order" + vbNewLine)
TextBox2.AppendText("----------------------------------------------------------" +
vbNewLine)

Dim Mail As New MailMessage


Mail.Subject = "Fuel Management System E-Bill"
If TextBox1.Text = "" Then
MsgBox("Please Enter The E-Mail Address", MsgBoxStyle.Information +
MsgBoxStyle.OkOnly, "Error!")
End If
Mail.To.Add(TextBox1.Text)
Mail.From = New MailAddress("fuelmanagement360@gmail.com")
Mail.Body = TextBox2.Text

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


SMTP.EnableSsl = True
SMTP.Credentials = New System.Net.NetworkCredential("fuelmanagement360@gmail.com",
"Fuel@360")
SMTP.Port = "587"
SMTP.Send(Mail)

MsgBox("Your Payment Is Done E-Bill Is Sent To The MailId !!")


TextBox1.Text = ""

TextBox5.Text = ""
TextBox6.Text = ""
TextBox7.Text = ""
TextBox8.Text = ""
TextBox9.Text = ""
TextBox10.Text = ""
ComboBox1.Text = "Select"
ComboBox2.Text = "Select"

End Sub

29
FUEL MANAGEMENT SYSTEM

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


Handles Button2.Click
PrintDocument1.Print()
PrintDialog1.Document.Print()

TextBox2.Text = ""
End Sub
Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As
System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
e.Graphics.DrawString(TextBox2.Text, New Font("Book Antiqua", 20, FontStyle.Bold,
GraphicsUnit.Pixel), Brushes.Black, 25, 70)
End Sub

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


TextBox1.LostFocus
Dim reEmail As Regex = New Regex("^[a-z][a-z|0-9|]*([_][a-z|0-9]+)*([.][a-z|0-
9]+([_][a-z|0-9]+)*)?@[a-z][a-z|0-9|]*\.([a-z][a-z|0-9]*(\.[a-z][a-z|0-9]*)?)$", _
RegexOptions.IgnoreCase _
Or RegexOptions.CultureInvariant _
Or RegexOptions.IgnorePatternWhitespace _
Or RegexOptions.Compiled _
)

Dim blnPossibleMatch As Boolean = reEmail.IsMatch(TextBox1.Text)


If blnPossibleMatch Then
If Not TextBox1.Text.Equals(reEmail.Match(TextBox1.Text).ToString) Then
MsgBox("Invalid Email Address")
Else
Emailvalid = True
End If
Else
Emailvalid = False
MsgBox("Invalid Email Id")
TextBox1.Clear()
TextBox1.Focus()
End If

End Sub
End Class

30
FUEL MANAGEMENT SYSTEM

4.2 SNAPSHOTS OF OUTPUT


Form1.VB(MAIN PAGE)

31
FUEL MANAGEMENT SYSTEM

Form2.VB(ADMIN LOGIN)

32
FUEL MANAGEMENT SYSTEM

FORM3.VB(PETROL AGENCY SIGNUP)

33
FUEL MANAGEMENT SYSTEM

Form4.VB(AGENCY APPROVAL)

34
FUEL MANAGEMENT SYSTEM

Form5.VB(AGENCY REG FORM)

35
FUEL MANAGEMENT SYSTEM

Form6.VB(CUSTOMER PAYMENT FORM)

36
FUEL MANAGEMENT SYSTEM

CHAPTER-5

TESTING

“Testing is the process of analyzing a software item to detect the differences between existing
and required conditions and the features of software item”. The system is tested under adverse
situations and environment to test its performance, reliability and robustness. Verification and
validation is done for the system and it is reviewed against each and every customer requirement
specification.

The main objective of testing is

 Testing is a process of executing a program with the interest of finding an error.


 A good test is one that has high probability of finding the yet undiscovered errors .
 A successful test is the one that has high probability of finding the undiscovered errors.
 Tests designed to reflect the frequency of user inputs used for reliability estimation.

To test the process two class of inputs are provided, they are

 A software configuration that includes a software requirement specification, a design


specification and source code.
 A software configuration that includes a test plan and procedure, any testing tool
and test cases and their expected results.

Testing is performed to prove that there are no errors in program. This is extremely
difficult since designer cannot prove hundred percent accurate. Therefore, testing is done with a
explicit intension of finding errors that make the program fail. Testing has it’s own cycle. It
requires five basic critical factors: planning, project and process management, risk management,
inspirits, measurement tools.

37
FUEL MANAGEMENT SYSTEM

5.1TYPES OF TESTING

UNIT TESTING

Unit testing is a level of software testing where individual units/ components of a


software are tested. .... A unit is the smallest testable part of software. It usually has one or a
few inputs and usually a single output. In procedural programming a unit may
be an individual program, function, procedure, etc.

Unit testing on Login page

TESTING INPUT OUTPUT

UNIT TESTING Invalid inputs Pop up message:


Username: jhh Invalid password
Password: hfgf7
Valid inputs Login success
Username: admin
Password: admin

MODULE TESTING

Module testing is the testing of complete code objects as produced by the compiler
when built from source. A library may be composed of a single compiled object or several
compiled objects. There is only a slight difference between unit testing and module testing

38
FUEL MANAGEMENT SYSTEM

TEST PLAN

A software project test plan is a document that describes the objectives, scope approach and focus
of a software testing effort. This process of preparing a test plan is a useful way to think through
the efforts needed to validate the acceptability of a software product. The completed document
will help the people outside the test group understand ‘Why and How’ of production validation.
Different test plans are used at different levels of testing.

Test Plans used in Unit Testing

Each module is tested for correctness whether it is meeting all the expected results. Condition
loops in the code are properly terminated so that they don’t enter into an infinite loop. Proper
validations are done so as to avoid any errors related to data entry from user.

Test Cases

Testcase
Number Testing Scenario Expected result Result

Registration Testing

Alert "Please fill all


TC – 01 Clicking submit without entering details details" Pass

Clicking submit without entering Alert "Please fill


TC – 02 Username Username" Pass

Clicking submit without entering Alert "Please fill


TC – 03 password Password" Pass

TC – 04 Clicking submit without entering email id Alert "Please fill email id" Pass

39
FUEL MANAGEMENT SYSTEM

Clicking submit without entering phone Alert "Please fill contact


TC – 05 number number" Pass

Clicking submit entering confirm Alert "Password and


password data which is not matching Confirm Password do not
with password data match"
TC – 06 Pass
Login Testing

Clicking submit without entering login Alert "Please enter the


TC – 07 details username and password" Pass

Clicking submit without Alert "Please enter the


TC – 08 entering password password" Pass

40
FUEL MANAGEMENT SYSTEM

CONCLUSION

It has been a great pleasure for us to work on this project. We started this project with the
intention of giving our best and doing something interesting and we believe that we have
successfully achieved that. If we were able to complete this project, this is largely due to the
collective efforts.

This project proved good for us as it provided practical knowledge of not only programming in
Visual Basic.NET application and know some extent windows application and SQL server.

This DBMS package is very efficient and user friendly and way to store the details that comes to
existence. Although all features are not provided the important ones need to make this software
self-sufficient are present. The project has been successful in that manner.

The tables that are created for this software have been designed in such a way that complete
information is given in a concise manner. Few of the functions provided by this software are new
records, saved and modified.

The software is portable and flexible for future enhancements. Thus, this project helps in retrieving
the details as single go using data base concept.

It is concluded that the objective of the project work entitled "FUEL MANAGEMENT" filled and
desired result has been obtained. each program in the project are functioning normally and reliable
to user. this project designed to track the corona virus in india with very low system resources and
the system will work in almost all configurations and provide a user friendly application that
provides records of the covid test center’s, user’s health reports city wise and updates of the corona
virus cases.

41
FUEL MANAGEMENT SYSTEM

FUTURE ENHANCEMENT:

 The future enhancement further tracks the user’s location and checks whether it is present
in the list of identified Containment Zones.
 It sends separate notification alerts to the users on entering details.
 It extracts IMEI number of the trespasser in the containment zone which can be useful to
local police to track and identify who are frequently trespassing the containment zone.

42
FUEL MANAGEMENT SYSTEM

BIBLIOGRAPHY

Books:
 Chitra Ravi "Database Management System" Subhash publications.
 Ashwini S Divakar "Software Engineering" Skyward publications.

Online References:
 www.tutorialpoint.com
 www.wikipedia.com
 www.google.com
 www.slideshare.com

43
FUEL MANAGEMENT SYSTEM

44

You might also like