Petrol Pump Management System Project Report
Petrol Pump Management System Project Report
Petrol Pump Management System Project Report
Chapter 1
Preliminary Investigation
1
Petrol Pump Management System
Organizational Overview
Organizational Chart
PETROL
PUMP
MANAGEMENT
SYSTEM
Employee
2
Petrol Pump Management System
Description of System
employee detail in files and folders. They use to keep the record of petrol and
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
As mentioned above most of details are maintained manually. Due to this the
data retrieved is time consuming. Due to human calculation errors occur.
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.
Lack of security.
4
Petrol Pump Management System
Proposed System
5
Petrol Pump Management System
All the information about sale, purchase, stock will be maintain properly in
this system.
6
Petrol Pump Management System
Feasibility Of Study
1. Software Specification:-
2. Hardware Specifications
Minimum hardware requirements for this System are listed below:
Processor : Pentium-4
RAM : 256MB.
NETWORK : LAN.
7
Petrol Pump Management System
8
Petrol Pump Management System
View definition: The SQL DDL includes commands for defining views.
9
Petrol Pump Management System
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
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.
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
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
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
Registration
Bill payment
Customer
Registration
Bill generation
Employee
Employee management
Maintaining record
Manager
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
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
4) Inform
5) Petrol available
6) Supply petrol
7) Generate bill
8) Playbill
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
Checking stock
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
Total.
24
Petrol Pump Management System
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
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
HUB
Terminal Printer
29
Petrol Pump Management System
Maintain
user details
Login
Maintain
customer
Customer Detail
Petrol pump
Management Maintain Stock report
stock
System Stock details
Maintain
employee
Employee details
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
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
34
Petrol Pump Management System
35
Petrol Pump Management System
36
Petrol Pump Management System
Program List
37
Petrol Pump Management System
Report List
38
Petrol Pump Management System
Program Description
39
Petrol Pump Management System
40
Petrol Pump Management System
Code:-
Public Class splash
Dim per As Integer
ProgressBar1.PerformStep()
per = per + 1
lbls_per.Text = per
End Sub
End Class
41
Petrol Pump Management 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
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()
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
End Sub
End While
cn.Close()
cmbusrename.SelectedIndex = 0
End Sub
44
Petrol Pump Management System
45
Petrol Pump Management System
46
Petrol Pump Management System
Code:-
Imports System.Data.SqlClient
sure.Show()
End Sub
47
Petrol Pump Management System
48
Petrol Pump Management System
End Sub
End Sub
End Sub
End Sub
End Sub
End Sub
49
Petrol Pump Management System
End Sub
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
End Class
50
Petrol Pump Management System
Pseudo Code:
51
Petrol Pump Management System
Code:-
Imports System.Data.SqlClient
End Sub
Public Sub bindfields()
txtc_r_ID.DataBindings.Clear()
txtc_r_ID.DataBindings.Add("text", odv, "cust_id")
End Sub
52
Petrol Pump Management System
End If
filldatasetandview()
bindfields()
objcur.Position = objcur.Count - 1
txtc_r_ID.Text = Val(txtc_r_ID.Text) + 1
End If
End Sub
53
Petrol Pump Management System
End If
End Sub
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
End Sub
54
Petrol Pump Management System
End Sub
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:
Code:-
57
Petrol Pump Management System
Imports System.Data.SqlClient
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
Else
txtc_b_deisel1.Text = ""
txtC_b_totalbill.Text = ""
txtc_b_deisel1.ReadOnly = True
txtc_b_deisel1.BackColor = Color.WhiteSmoke
End If
End Sub
filldatasetandview1()
bindfields1()
objcur1.Position = objcur1.Count - 1
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
Txtc_b_date.Text = Now.ToString("d")
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()
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
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
End If
Else
MsgBox("nothing purchest to make bill")
End If
End Sub
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
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
Pseudo Code:
66
Petrol Pump Management System
Code:-
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
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
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
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
77
Petrol Pump Management System
Test Result:
78
Petrol Pump Management System
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
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
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
84
Petrol Pump Management System
End Sub
End Class
85
Petrol Pump Management System
Test Result:
86
Petrol Pump Management System
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
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
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)
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
93
Petrol Pump Management System
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
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
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:
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
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)
103
Petrol Pump Management System
104
Petrol Pump Management System
Test result:-
105
Petrol Pump Management System
Pseudo Code:
106
Petrol Pump Management System
Code:-
Imports System.Data.SqlClient
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
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
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
115
Petrol Pump Management System
116
Petrol Pump Management System
Code:-
Imports CrystalDecisions.CrystalReports.Engine
Public Class sales
117
Petrol Pump Management System
118
Petrol Pump Management System
Code:-
Imports CrystalDecisions.CrystalReports.Engine
Public Class emprecord
119
Petrol Pump Management System
120
Petrol Pump Management System
Code:-
Imports CrystalDecisions.CrystalReports.Engine
Public Class Salaryreport
121
Petrol Pump Management System
122
Petrol Pump Management System
Code:-
Imports CrystalDecisions.CrystalReports.Engine
Public Class inventryreport1
End Class
123
Petrol Pump Management System
Validations
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
125
Petrol Pump Management System
126
Petrol Pump Management System
Code:-
127
Petrol Pump Management System
Chapter 5
System Implementation &
Uploading
128
Petrol Pump Management System
System Implementation
129
Petrol Pump Management System
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.
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
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.
133
Petrol Pump Management System
Chapter 7
References &
Bibliography
134
Petrol Pump Management System
Publication : Murach
Book name : Mastering Visual Basic 2008
2.
Author : Evangelos Petroutsos
www.google.com
www.wonderranchpublishing.net
4 URL www.hindustanpetroleum.com
135