Final
Final
Final
PROJECT REPORT
ON
ELECTRICITY BILLING SYSTEM
SESSION: 2013-2016
ACKNOWLEDGEMENT
Thanking You,
CHANDRA PRAKASH
ELECTRICITY BILLING SYSTEM
DECLARATION
I, Mr. CHANDRA PRAKASH hereby declare that this project is the record
of authentic work carried out by me during the academic year 2013 –
2016 and has not been submitted to any other University or Institute
towards the award of any degree.
ChandraPrakash
Name of the Student
ELECTRICITY BILLING SYSTEM
TABLE OF CONTENTS
TITLE PAGE NO
1 System Introduction 1
16 Coding 71-275
TITLE PAGE NO
18 Test Procedures and Implementation 285-297
24 Drawbacks 312
25 Conclusion 313
26 Bibliography 314
ELECTRICITY BILLING SYSTEM
SYSTEM INTRODUCTION
We use Visual Basic 6.0 as front end and Oracle 10g as back end for
developing our project.
1
ELECTRICITY BILLING SYSTEM
Major Drawbacks:
1. The existing system is assumed to be manual billing system and
hence all the operations are assumed to be done manually by pen and
paper works.Thus there are chances of error in processing.
2. The basic and major drawbacks in the existing system are the speed
of retrieval of data from files, which leads to delay.
2
ELECTRICITY BILLING SYSTEM
8. Less accuracy.
3
ELECTRICITY BILLING SYSTEM
PROPOSED SYSTEM
4
ELECTRICITY BILLING SYSTEM
5
ELECTRICITY BILLING SYSTEM
FEASIBILITYSTUDY
As we know each and every project needs to have a feasibility study for
the complete understandability of the project. We will consider three
types of feasibility study they are technical feasibility, operational
feasibility and economical feasibility.
Technical Feasibility:
This new system requires 6 fully trained people to run the system
perfectly. 1 Admin person to maintain database and 5persons to handle
the system interface and order making things.
Operational Feasibility:
The new solution is feasible in all sense but operationally it is not.
The new system demands the expulsion of at least 15 people from the
6
ELECTRICITY BILLING SYSTEM
Econimical Feasibility:
The purpose of the economic feasibility assessment is to determine the
positive economic benefits to the organization that the proposed
system will provide.It includes quantification and identification of all
the benefits expected. This assessment typically involves a
cost/benefits analysis.
7
ELECTRICITY BILLING SYSTEM
HARDWARE ENVIRONMENT
SOFTWARE ENVIRONMENT
8
ELECTRICITY BILLING SYSTEM
ABOUTFRONTEND
Over past few years visual basic 6.0 (front end) the relational data base
management system has been fine-tuning it is offering a large complex
application in the relational market. Visual basic 6.0 is a front end (i.e.
uses graphical user interface) visual basic 6.0 uses windows
environment. It may use any DBMS or RDBMS as a back-end through
ODBC (open database connectivity).
9
ELECTRICITY BILLING SYSTEM
degree of user interaction using the graphical elements that forms the
objects on the window the user sees .If the user interface is not correct,
user will not like the program.
Visual Basic lets one add menus, text boxes, command buttons,
option buttons (for making exclusive choice), check boxes, list boxes,
scroll bars and file and directory boxes to black windows. One can use
Visual Basic to communicate with other applications, running under
windows. Visual Basic offers: More Internet features, better support
for data base development, more language feature to make
programming job easier.
Visual Basic applications are event driven. Event driven means the
user is in Control of the application.
Visual Basic supports the principle of object-oriented design.
Visual Basic is a complete window application development
system.
Data access features allow creating databases, front-end
applications andscalable server side components for most popular
10
ELECTRICITY BILLING SYSTEM
11
ELECTRICITY BILLING SYSTEM
ORACLE
7. Program-Data Independence.
8. Minimal Data-Redundancy.
9. Data Consistency.
10. Data Sharing.
12
ELECTRICITY BILLING SYSTEM
Data Dictionary:-
13
ELECTRICITY BILLING SYSTEM
DBMS or RDBMS: -
The Database Management System is the software and
collection of tools that manages the database. Oracle software is the
DBMS. A Relational Database Management System is a DBMS that is
relational in nature. This means that the internal workings oracle data
in a relational manner. Oracle is an RDBMS.
Query:-
Schema:-
14
ELECTRICITY BILLING SYSTEM
Oracle is a very effective DBMS tool which is generally used by all the
users. It is compatible with all types ofsystems & can be installed and
used as and when required.
15
ELECTRICITY BILLING SYSTEM
The following are the major improvement of the new system over the
existing system.
16
ELECTRICITY BILLING SYSTEM
17
ELECTRICITY BILLING SYSTEM
USER REQUIREMENTS
FUNCTIONAL REQUIREMENTS
A.INPUT/OUTPUT
18
ELECTRICITY BILLING SYSTEM
B.PROCESSING
C. ERROR HANDLING
3. Should report any data type mismatches any field on the forms.
19
ELECTRICITY BILLING SYSTEM
D. NON-FUNCTIONAL REQUIREMENTS
20
ELECTRICITY BILLING SYSTEM
21
ELECTRICITY BILLING SYSTEM
22
ELECTRICITY BILLING SYSTEM
A DFD shows what kind of information will be input to and output from
the system, where the dat will come from and go to, and where the
data will be stored.It does not show information about the timing of
process or information about whether processes will operate in
sequence or in parallel.
23
ELECTRICITY BILLING SYSTEM
24
ELECTRICITY BILLING SYSTEM
25
ELECTRICITY BILLING SYSTEM
26
ELECTRICITY BILLING SYSTEM
27
ELECTRICITY BILLING SYSTEM
MODUE DESCRIPTION
1. Log in:
It provides safety and security to the system. After the
log in process, the rest of application is available to the user. Firstly user
has to register by providing user id and password. These user id and
password maintained in a database. Only authenticated person can log
in through the system.
2. Consumer management:
In this module there are many sub modules.
In it we can manage the customer information, consuming unit of
energy etc.
28
ELECTRICITY BILLING SYSTEM
(3)Edit:
In this module we have the facility to edit the
consumer and meter details.
(a)Consumer Record
In this if any changes occur with consumer details,
then we have the facility to modify it and again save it
into database with modified data and then after that
all the process is going to be executed according to
new modified records.
29
ELECTRICITY BILLING SYSTEM
(b)Meter Record:
(4)Billing:
In this module the final bill will be
generated for the entire consumer at a time and dispatched to their
mentioned address. In this bill id is generated automatically. For
generating the bill we have to use some charges to calculate and
producing of bill. These charges are as following:
30
ELECTRICITY BILLING SYSTEM
31
ELECTRICITY BILLING SYSTEM
(f) Rebate:
Rebate is also given to the consumer if
he pays the bill under the first given
date.10ps/unit is given to the entire
consumer; it means total consumed
unit of a single month is multiplied to
10ps every month.
(g) Dues:
If previous month bill is not paid then
dues is combined with the next month
bill.
(5).Payment
In this module the payment of bill is managed.
(a) Receipt:
The final receipt is generated at the
time when the consumer pays their monthly bill.
32
ELECTRICITY BILLING SYSTEM
(6)View
In this module we can search and view customer
records, meter details, bill details and receipt details
in a specified way.
(a)Consumr Details:
In this sub-module we can view all types of
customer and all of its records on different fields such
as on customer id, name, sub-division, meter no, tariff
etc. and also take print out of this.
(b)Bill Details:
In this sub-module we can view all previous bills
of all months of all consumers and take print out of this.
(c)Receipt Details:
In this sub-module we can view all the previous
receipt of all months of all consumers which is made at the
time of payment of bill. We can also take print out of this.
33
ELECTRICITY BILLING SYSTEM
(d)Status:
In this sub-module we can view all the consumer
records on the basis of their status, it means that which
consumer paid the bill and which is not in the specified given
month. We can take print out of it.
(e)Meter Details:
In this sub-module we can view the entire previous
consumed unit used by the consumer.We can view
particular consumer consumed unit and take print out of it.
(7)Administrator:
Handling databases is in the power of the admin person only. It
performs general and special purpose both type of work.
34
ELECTRICITY BILLING SYSTEM
Create user:
In this sub module the new user account is created by
the administrator and the user id and password is given to the
user to use it. The add command button is used to save all the
data record in the database. The reset command button is used to
clear all the data after processing and exit command button is
used to come back from that form
35
ELECTRICITY BILLING SYSTEM
TABLE
SPECIFICATION
36
ELECTRICITY BILLING SYSTEM
LOGIN TABLE
37
ELECTRICITY BILLING SYSTEM
38
ELECTRICITY BILLING SYSTEM
39
ELECTRICITY BILLING SYSTEM
40
ELECTRICITY BILLING SYSTEM
41
ELECTRICITY BILLING SYSTEM
42
ELECTRICITY BILLING SYSTEM
43
ELECTRICITY BILLING SYSTEM
INPUT
SCREEN
44
ELECTRICITY BILLING SYSTEM
SPLASH SCREEN
45
ELECTRICITY BILLING SYSTEM
ADMINISTRATOR INFORMATION
46
ELECTRICITY BILLING SYSTEM
47
ELECTRICITY BILLING SYSTEM
LOGIN
48
ELECTRICITY BILLING SYSTEM
49
ELECTRICITY BILLING SYSTEM
50
ELECTRICITY BILLING SYSTEM
51
ELECTRICITY BILLING SYSTEM
BILL GENERATION
52
ELECTRICITY BILLING SYSTEM
53
ELECTRICITY BILLING SYSTEM
PAYMENT RECEIPT
54
ELECTRICITY BILLING SYSTEM
CREATE USER
55
ELECTRICITY BILLING SYSTEM
56
ELECTRICITY BILLING SYSTEM
CHANGE PASSWORD
57
ELECTRICITY BILLING SYSTEM
58
ELECTRICITY BILLING SYSTEM
59
ELECTRICITY BILLING SYSTEM
60
ELECTRICITY BILLING SYSTEM
61
ELECTRICITY BILLING SYSTEM
62
ELECTRICITY BILLING SYSTEM
63
ELECTRICITY BILLING SYSTEM
64
ELECTRICITY BILLING SYSTEM
65
ELECTRICITY BILLING SYSTEM
66
ELECTRICITY BILLING SYSTEM
67
ELECTRICITY BILLING SYSTEM
68
ELECTRICITY BILLING SYSTEM
69
ELECTRICITY BILLING SYSTEM
70
ELECTRICITY BILLING SYSTEM
CODING
71
ELECTRICITY BILLING SYSTEM
SPLASH SCREEN
Dim n As Integer
Dim p As String
Dim c As ADODB.Connection
Dim r As ADODB.Recordset
Timer1.Interval = 100
If n = 4 Then
n=1
Else
n=n+1
End If
Select Case n
Case 1:
Shape1.Visible = True
Shape2.Visible = False
Shape3.Visible = False
Case 2:
Shape1.Visible = True
Shape2.Visible = True
Shape3.Visible = False
Case 3:
72
ELECTRICITY BILLING SYSTEM
Shape1.Visible = True
Shape2.Visible = True
Shape3.Visible = True
Case 4:
Shape1.Visible = False
Shape2.Visible = False
Shape3.Visible = False
End Select
Unload Me
Set r = c.Execute(sql)
If r.Fields(0) = 0 Then
frm_admininfo.Show
Else
frm_login.Show
End If
Else
ProgressBar1.value = ProgressBar1.value + 5
End If
End Sub
73
ELECTRICITY BILLING SYSTEM
ADMINISTRATOR INFORMATION
Dim d As Date
Dim id As Integer
If X = True Then
Unload Me
Else
Cancel = 1
End If
End Sub
txt_name.Text = ""
txt_phno.Text = ""
txt_email.Text = ""
txt_add.Text = ""
txt_dist.Text = ""
txt_pin.Text = ""
dtp_doj = Now
74
ELECTRICITY BILLING SYSTEM
End Sub
'Unload Me
'Else
'Cancel = 1
'End If
'End Sub
If KeyAscii = 13 Then
txt_dist.SetFocus
End If
End Sub
txt_add = UCase(Trim(txt_add))
End Sub
txt_dist = UCase(Trim(txt_dist))
End Sub
75
ELECTRICITY BILLING SYSTEM
If KeyAscii = 13 Then
dtp_doj.SetFocus
End If
End Sub
If (KeyAscii < 65 Or KeyAscii > 90 And KeyAscii < 97 Or KeyAscii > 122) And KeyAscii <>
8 And KeyAscii <> 13 Then
KeyAscii = 0
txt_dist.SetFocus
txt_pin.SetFocus
End If
End Sub
txt_email.Text = Trim(txt_email.Text)
End Sub
76
ELECTRICITY BILLING SYSTEM
End If
End Sub
If KeyAscii = 13 Then
txt_name = UCase(Trim(txt_name.Text))
txt_add.SetFocus
ElseIf (KeyAscii < 65 Or KeyAscii > 90 And KeyAscii < 97 Or KeyAscii > 122) And KeyAscii
<> 8 And KeyAscii <> 32 Then
KeyAscii = 0
txt_name.SetFocus
End If
End Sub
txt_name.Text = Trim(txt_name.Text)
End Sub
If ((KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 And KeyAscii <> 13) Then
KeyAscii = 0
txt_phno.SetFocus
End If
77
ELECTRICITY BILLING SYSTEM
If KeyAscii = 13 Then
txt_email.SetFocus
End If
End Sub
If (KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 And KeyAscii <> 13 Then
KeyAscii = 0
txt_pin.SetFocus
End If
If KeyAscii = 13 Then
txt_phno.SetFocus
End If
End Sub
If txt_name.Text = "" And txt_phno.Text = "" And txt_email.Text = "" And txt_add.Text = ""
And txt_dist.Text = "" And txt_pin.Text = "" Then
txt_name.SetFocus
txt_name.SetFocus
78
ELECTRICITY BILLING SYSTEM
txt_add.SetFocus
txt_dist.SetFocus
txt_pin.SetFocus
Else
conn
sql = "insert into employee values('" + str + "','" + txt_name.Text + "'," + txt_phno.Text +
",'" + txt_email.Text + "','" + txt_add.Text + "','" + txt_dist.Text + "'," + txt_pin.Text + ",'" +
Format(dtp_doj.value, "DD MMM YY") + "')"
Set r = c.Execute(sql)
frm_admin.Show
frm_admin.txt_nm.Text = txt_name.Text
frm_admin.txt_uid.Text = str
Unload frm_admininfo
End If
End Sub
79
ELECTRICITY BILLING SYSTEM
CREATE ADMINISTRATOR
Dim c As ADODB.Connection
Dim r As ADODB.Recordset
txt_cpass.Text = ""
txt_nm.SetFocus
txt_pass.Text = ""
txt_cpass.Text = ""
txt_nm.SetFocus
Exit Sub
txt_pass.Text = ""
txt_cpass.Text = ""
txt_uid.SetFocus
Exit Sub
80
ELECTRICITY BILLING SYSTEM
txt_cpass.Text = ""
txt_pass.SetFocus
Exit Sub
txt_pass.Text = ""
txt_cpass.Text = ""
txt_pass.SetFocus
Exit Sub
txt_pass.Text = ""
txt_cpass.Text = ""
txt_pass.SetFocus
Exit Sub
Else
sql = "insert into login values('" + txt_nm.Text + "','" + txt_uid.Text + "','" + txt_pass.Text
+ "','ADMINISTRATOR')"
Set r = c.Execute(sql)
81
ELECTRICITY BILLING SYSTEM
Unload Me
Load frm_login
frm_login.Show
Exit Sub
End If
End Sub
Unload Me
End Sub
If X = True Then
Unload Me
Else
Cancel = 1
End If
End Sub
End If
82
ELECTRICITY BILLING SYSTEM
End Sub
End If
End Sub
If KeyAscii = 13 Then
txt_cpass.SetFocus
End If
End Sub
txt_uid.Text = UCase(Trim(txt_uid.Text))
End Sub
If KeyAscii = 13 Then
Call cmd_ok_click
End If
End Sub
83
ELECTRICITY BILLING SYSTEM
If KeyAscii = 13 Then
txt_pass.SetFocus
End If
End Sub
84
ELECTRICITY BILLING SYSTEM
LOGIN
Dim p As String
Dim c As ADODB.Connection
Dim r As ADODB.Recordset
If chk_showpass.value = 1 Then
txt_pass.PasswordChar = value
Else
txt_pass.PasswordChar = "*"
End If
cmd_ok.SetFocus
End Sub
If KeyAscii = 13 Then
If chk_showpass.value = 1 Then
chk_showpass.value = 0
Else
chk_showpass.value = 1
End If
Call chk_showpass_Click
85
ELECTRICITY BILLING SYSTEM
End If
End Sub
If X = True Then
Unload Me
Else
Cancel = 1
End If
End Sub
If KeyAscii = 13 Then
txt_pass.SetFocus
End If
End Sub
If KeyAscii = 13 Then
Exit Sub
Else
combo_uid.SetFocus
86
ELECTRICITY BILLING SYSTEM
End If
End If
End Sub
combo_ltype.SetFocus
txt_pass.Text = ""
combo_uid.SetFocus
txt_pass.SetFocus
Exit Sub
MDIForm1.Administator.Visible = True
emp_id = combo_uid.Text
pass = txt_pass.Text
Unload Me
MDIForm1.Show
Exit Sub
MDIForm1.Administator.Visible = False
87
ELECTRICITY BILLING SYSTEM
emp_id = combo_uid.Text
pass = txt_pass.Text
Unload Me
MDIForm1.Show
Exit Sub
Else
txt_pass.Text = ""
chk_showpass.value = 0
txt_pass.SetFocus
End If
End Sub
combo_uid.Clear
combo_uid.Enabled = True
txt_pass.Enabled = True
Set r = c.Execute(sql)
combo_uid.AddItem Trim(r.Fields(0))
r.MoveNext
88
ELECTRICITY BILLING SYSTEM
Loop
End Sub
Set r = c.Execute(sql)
combo_ltype.AddItem Trim(r.Fields(0))
r.MoveNext
Loop
End Sub
End If
End Sub
89
ELECTRICITY BILLING SYSTEM
On Error GoTo X
Set r = c.Execute(sql)
p = r.Fields(0)
Exit Sub
X:
combo_uid.SetFocus
End Sub
If KeyAscii = 13 Then
Call cmd_ok_click
End If
End Sub
90
ELECTRICITY BILLING SYSTEM
MDI FORM
frm_user.Show
End Sub
frm_pbill.Show
End Sub
frm_password.Show
End Sub
frm_user.Show
End Sub
frm_bill.Show
End Sub
frm_custview.Show
91
ELECTRICITY BILLING SYSTEM
End Sub
frm_c_rec.Show
End Sub
frm_dcharge.Show
End Sub
frm_domestic.Show
End Sub
frm_allbill.Show
End Sub
Unload Me
End Sub
frm_allbill.Show
End Sub
92
ELECTRICITY BILLING SYSTEM
If X = True Then
MDIForm1.Hide
frm_login.Show
Else
Exit Sub
End If
End Sub
frm_updmeter.Show
End Sub
Picture2.Left = -8650
End Sub
93
ELECTRICITY BILLING SYSTEM
If X = True Then
End
Else
Cancel = 1
End If
End Sub
frm_meter.Show
End Sub
frm_new.Show
End Sub
frm_nondomestic.Show
End Sub
frm_ndcharge.Show
End Sub
frm_unit.Show
94
ELECTRICITY BILLING SYSTEM
End Sub
frm_pay.Show
End Sub
frm_reciptview.Show
End Sub
Frm_status.Show
End Sub
Picture2.Left = Picture2.Left + 30
Else
Picture2.Left = -8650
End If
End Sub
frm_userupdate.Show
End Sub
95
ELECTRICITY BILLING SYSTEM
Public id As Integer
If txt_name = "" And txt_phno = "" And txt_add = "" And txt_dist = "" And txt_pin = "" Then
txt_name.SetFocus
txt_name.SetFocus
txt_add.SetFocus
txt_dist.SetFocus
txt_pin.SetFocus
combo_sdiv.SetFocus
96
ELECTRICITY BILLING SYSTEM
ElseIf txt_mno = "" And Combo_phase = "" And txt_cdate = "" And Combo_ssec = "" And
Combo_ssec = "" And Combo_cload = "" Then
txt_mno.SetFocus
txt_mno.SetFocus
txt_phase.SetFocus
Combo_ssec.SetFocus
Combo_tarrif.SetFocus
Combo_cload.SetFocus
Else
conn
sql = " insert into customer values('" + txt_cid + "','" + txt_name + "',Null,Null,'" + txt_add
+ "','" + txt_dist + "'," + txt_pin + ",'" + txt_div + "','" + combo_sdiv + "')"
97
ELECTRICITY BILLING SYSTEM
sql = " insert into customer values('" + txt_cid + "','" + txt_name + "',Null,'" + txt_eid.Text
+ "','" + txt_add + "','" + txt_dist + "'," + txt_pin + ",'" + txt_div + "','" + combo_sdiv + "')"
sql = " insert into customer values('" + txt_cid + "','" + txt_name + "'," + txt_phno.Text +
",Null,'" + txt_add + "','" + txt_dist + "'," + txt_pin + ",'" + txt_div + "','" + combo_sdiv + "')"
Else
sql = " insert into customer values('" + txt_cid + "','" + txt_name + "'," + txt_phno.Text +
",'" + txt_eid.Text + "','" + txt_add + "','" + txt_dist + "'," + txt_pin + ",'" + txt_div + "','" +
combo_sdiv + "')"
End If
sql1 = "insert into meter values ('" + txt_cid + "'," + txt_mno + "," + Combo_phase + ",'" +
Format(dtp_cdate, "dd mmm yy") + "','" + Combo_ssec + "','" + Combo_tarrif + "'," +
Combo_cload + ")"
c.Execute (sql)
c.Execute (sql1)
Call cmd_reset_Click
End If
Exit Sub
End Sub
Unload Me
End Sub
98
ELECTRICITY BILLING SYSTEM
txt_cid.Text = ""
txt_name.Text = ""
txt_phno.Text = ""
txt_eid.Text = ""
txt_add.Text = ""
txt_dist.Text = ""
txt_pin.Text = ""
combo_sdiv.ListIndex = -1
txt_mno.Text = ""
Combo_phase.ListIndex = -1
dtp_cdate.value = Now
Combo_ssec.ListIndex = -1
Combo_tarrif.ListIndex = -1
Adodc1.Refresh
Call Form_Load
txt_name.SetFocus
End Sub
If KeyAscii = 13 Then
cmd_add.SetFocus
End If
End Sub
99
ELECTRICITY BILLING SYSTEM
Combo_cload.Clear
If Combo_phase = 1 Then
For i = 1 To 7
Combo_cload.AddItem i
Next
For i = 5 To 10
Combo_cload.AddItem i
Next
End If
End Sub
str = "DBG"
str = "LRS"
End If
conn
Set r = c.Execute(sql)
100
ELECTRICITY BILLING SYSTEM
If IsNull(r.Fields(0)) Then
txt_cid.Visible = True
Else
id = r.Fields(0) + 1
txt_cid.Visible = True
End If
End Sub
If KeyAscii = 13 Then
If txt_name = "" And txt_phno = "" And txt_add = "" And txt_dist = "" And txt_pin = "" Then
txt_name.SetFocus
txt_name.SetFocus
txt_add.SetFocus
txt_dist.SetFocus
101
ELECTRICITY BILLING SYSTEM
txt_pin.SetFocus
Else
Frame2.Enabled = True
txt_mno.SetFocus
End If
End If
End Sub
Call combo_sdiv_KeyPress(13)
End Sub
Combo_ssec.Clear
Combo_ssec.AddItem "DONAR"
Combo_ssec.AddItem "BELA"
Combo_ssec.AddItem "LAXMINAGAR"
Combo_ssec.AddItem "BENTA"
Combo_ssec.AddItem "PANDASARAI"
End If
End Sub
102
ELECTRICITY BILLING SYSTEM
If KeyAscii = 13 Then
Combo_tarrif.SetFocus
End If
End Sub
If KeyAscii = 13 Then
Combo_cload.SetFocus
End If
End Sub
If KeyAscii = 13 Then
Combo_ssec.SetFocus
End If
End Sub
txt_cid.Visible = False
txt_cid.Text = ""
dtp_cdate.value = Now()
txt_div.Text = "DARBHANGA"
Frame2.Enabled = False
103
ELECTRICITY BILLING SYSTEM
End Sub
If X = True Then
Unload Me
Else
Cancel = 1
End If
End Sub
If KeyAscii = 13 Then
txt_dist.SetFocus
End If
End Sub
txt_add = Trim(UCase(txt_add))
End Sub
If (KeyAscii < 65 Or KeyAscii > 90 And KeyAscii < 97 Or KeyAscii > 122) And KeyAscii <>
8 And KeyAscii <> 32 And KeyAscii <> 13 Then
104
ELECTRICITY BILLING SYSTEM
KeyAscii = 0
txt_dist.SetFocus
End If
If KeyAscii = 13 Then
txt_pin.SetFocus
End If
End Sub
txt_dist = Trim(UCase(txt_dist))
End Sub
If KeyAscii = 13 Then
txt_add.SetFocus
KeyAscii = 0
End If
End Sub
txt_eid.Text = Trim(txt_eid.Text)
conn
Set r = c.Execute(sql)
105
ELECTRICITY BILLING SYSTEM
txt_eid.Text = ""
txt_eid.SetFocus
Exit Sub
Else
r.MoveNext
End If
Loop
End Sub
txt_mno.Text = ""
txt_mno.SetFocus
End If
conn
Set r = c.Execute(sql)
txt_mno.Text = ""
106
ELECTRICITY BILLING SYSTEM
txt_mno.SetFocus
Exit Sub
Else
r.MoveNext
End If
Loop
End Sub
If KeyAscii = 13 Then
txt_phno.SetFocus
ElseIf (KeyAscii < 65 Or KeyAscii > 90 And KeyAscii < 97 Or KeyAscii > 122) And KeyAscii
<> 8 And KeyAscii <> 32 Then
KeyAscii = 0
txt_name.SetFocus
End If
End Sub
If (KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 And KeyAscii <> 32 And KeyAscii
<> 13 Then
KeyAscii = 0
txt_mno.SetFocus
107
ELECTRICITY BILLING SYSTEM
Combo_phase.SetFocus
End If
End Sub
txt_name.Text = UCase(Trim(txt_name.Text))
End Sub
If KeyAscii = 13 Then
dtp_cdate.SetFocus
End If
End Sub
If ((KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 And KeyAscii <> 13) Then
KeyAscii = 0
txt_phno.SetFocus
End If
If KeyAscii = 13 Then
txt_eid.SetFocus
End If
End Sub
108
ELECTRICITY BILLING SYSTEM
txt_phno.Text = ""
txt_phno.SetFocus
Exit Sub
End If
conn
Set r = c.Execute(sql)
txt_phno.Text = ""
txt_phno.SetFocus
Exit Sub
Else
r.MoveNext
End If
Loop
End Sub
109
ELECTRICITY BILLING SYSTEM
If (KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 And KeyAscii <> 13 Then
KeyAscii = 0
txt_pin.SetFocus
End If
If KeyAscii = 13 Then
combo_sdiv.SetFocus
End If
End Sub
txt_pin.Text = ""
txt_pin.SetFocus
End If
End Sub
110
ELECTRICITY BILLING SYSTEM
METER READING
Dim d As Date
d = txt_pdate.Text
dtp_cdate.SetFocus
Exit Sub
dtp_cdate.SetFocus
Exit Sub
End If
conn
sql = "insert into measure values('" + txt_eid.Text + "','" + txt_cid + "'," + txt_mno + ",'" +
Format(txt_pdate, "dd MMM yy") + "'," + txt_pread + "," + txt_punit + ",'" +
Format(dtp_cdate, "dd MMM yy") + "'," + txt_cread + "," + txt_cunit + ")"
Set r = c.Execute(sql)
Call cmd_reset_Click
End Sub
111
ELECTRICITY BILLING SYSTEM
Unload Me
End Sub
txt_cid = ""
txt_name = ""
txt_mno = ""
txt_phase = ""
txt_condate = ""
txt_div = ""
txt_sdiv = ""
txt_ssec = ""
txt_tarrif = ""
txt_eid.Text = ""
txt_pdate = ""
txt_pread = ""
txt_punit = ""
dtp_cdate.value = Now
txt_cread = ""
txt_cunit = ""
Adodc1.Refresh
txt_cid.SetFocus
End Sub
112
ELECTRICITY BILLING SYSTEM
dtp_cdate.value = Now
End Sub
If X = True Then
Unload Me
Else
Cancel = 1
End If
End Sub
If KeyAscii = 13 Then
txt_cid = UCase(Trim(txt_cid))
conn
On Error GoTo X
Set r = c.Execute(sql)
txt_cid.Text = ""
113
ELECTRICITY BILLING SYSTEM
txt_cid.SetFocus
Exit Sub
End If
On Error GoTo X
Set r = c.Execute(sql)
txt_div.Text = r.Fields("DIVISION")
txt_name.Text = r.Fields("CUST_NAME")
txt_mno.Text = r.Fields("M_NO")
txt_phase.Text = r.Fields("phase")
txt_sdiv.Text = r.Fields("sub_division")
txt_ssec.Text = r.Fields("supp_section")
txt_tarrif.Text = r.Fields("tarrif")
txt_eid.Text = emp_id
dtp_cdate.Enabled = True
txt_cread.Enabled = True
dtp_cdate.SetFocus
sql = "select c_date,c_reading,c_unit from measure where cust_id='" + txt_cid.Text + "' and
c_date=(select max(c_date) from measure where cust_id='" + txt_cid.Text + "')"
On Error GoTo y
Set r = c.Execute(sql)
114
ELECTRICITY BILLING SYSTEM
txt_pread = r.Fields(1)
txt_punit = r.Fields(2)
Exit Sub
y:
Set r = c.Execute(sql)
txt_pread = 0
txt_punit = 0
Exit Sub
X:
txt_cid.Text = ""
ElseIf (KeyAscii < 65 Or KeyAscii > 90 And KeyAscii < 97 Or KeyAscii > 122) And
(KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 Then
KeyAscii = 0
End If
End Sub
txt_cunit.Text = ""
Exit Sub
End If
115
ELECTRICITY BILLING SYSTEM
End Sub
If KeyAscii = 13 Then
cmd_add.SetFocus
End If
End Sub
Exit Sub
txt_cread.Text = ""
txt_cread.SetFocus
txt_cunit.Text = ""
Else
Call txt_cread_KeyPress(13)
End If
End Sub
116
ELECTRICITY BILLING SYSTEM
ENERGY BILL
Dim r8 As ADODB.Recordset
Dim r2 As ADODB.Recordset
Dim r3 As ADODB.Recordset
Dim r4 As ADODB.Recordset
Dim r5 As ADODB.Recordset
Dim id As Integer
Dim mm As String
Dim i As Integer
Unload Me
End Sub
Unload Me
End Sub
117
ELECTRICITY BILLING SYSTEM
Adodc1.Recordset.MoveFirst
Call ado
End Sub
Adodc1.Recordset.MoveLast
Call ado
End Sub
On Error GoTo X
Adodc1.Recordset.MoveNext
Call ado
Exit Sub
X:
End Sub
On Error GoTo X
Adodc1.Recordset.MovePrevious
118
ELECTRICITY BILLING SYSTEM
Call ado
Exit Sub
X:
End Sub
DataReport2.Show
cmd_reset.Enabled = True
End Sub
txt_bid.Text = ""
txt_div.Text = ""
txt_eid.Text = ""
txt_bdate.Text = ""
txt_bmonth.Text = ""
txt_cid.Text = ""
txt_sdiv.Text = ""
txt_ddate.Text = ""
txt_ename.Text = ""
txt_eadd.Text = ""
txt_ephone.Text = ""
119
ELECTRICITY BILLING SYSTEM
txt_name.Text = ""
txt_add.Text = ""
txt_c1.Text = ""
txt_c2.Text = ""
txt_c3.Text = ""
lbl_d1.Caption = "DATE1"
lbl_d2.Caption = "DATE2"
lbl_d3.Caption = "DATE3"
txt_mno.Text = ""
txt_tarrif.Text = ""
txt_phase.Text = ""
txt_cload.Text = ""
txt_pdate.Text = ""
txt_pread.Text = ""
txt_punit.Text = ""
txt_cdate.Text = ""
txt_cread.Text = ""
txt_cunit.Text = ""
txt_ech.Text = ""
txt_dpscurr.Text = ""
txt_fxdch.Text = ""
txt_ed.Text = ""
txt_mrent.Text = ""
txt_tass.Text = ""
txt_dues.Text = ""
120
ELECTRICITY BILLING SYSTEM
txt_gtot.Text = ""
txt_rebate.Text = ""
txt_rno.Text = ""
txt_date.Text = ""
txt_amt.Text = ""
Call Form_Load
End Sub
conn
Adodc2.Refresh
DataGrid1.Columns(1).Caption = "NAME"
DataGrid1.Columns(2).Caption = "PHONE"
DataGrid1.Columns(4).Caption = "ADDRESS"
DataGrid1.Columns(6).Caption = "PIN"
121
ELECTRICITY BILLING SYSTEM
DataGrid1.Columns(14).Caption = "LOAD"
DataGrid1.Columns(16).Caption = "READING"
DataGrid1.Columns(17).Caption = "UNIT"
DataGrid1.Columns(22).Caption = "DPS"
DataGrid1.Columns(26).Caption = "TOTAL"
DataGrid1.Columns(27).Caption = "REBAIT"
DataGrid1.Columns(29).Caption = "DUES"
DataGrid1.Columns(31).Caption = "CHARGE"
DataGrid1.Columns(33).Caption = "CHARGE"
DataGrid1.Columns(34).Caption = "CHARGE"
DataGrid1.Columns(35).Caption = "STATUS"
122
ELECTRICITY BILLING SYSTEM
End Sub
conn
c.Execute (sql)
Set r = c.Execute(sql)
Set r3 = c.Execute(sql)
Set r1 = c.Execute(sql)
123
ELECTRICITY BILLING SYSTEM
If IsNull(r11.Fields(0)) Then GoTo next1 '-------------- if bill is not generted (1st time)
GoTo xx
End If
GoTo xx
End If
'===================================================
========================================
next1:
'===================================================
=== DUES/RECEIPT DETAIL ENTRY ==============================
124
ELECTRICITY BILLING SYSTEM
sql = "select * FROM bill where B_ID=(SELECT MAX(B_ID) FROM BILL WHERE CUST_ID=
'" + r1.Fields(0) + "')"
sql = "select * from payment where b_id=(select max(b_id) from payment where
cust_id='" + r1.Fields(0) + "')"
rno = "XXXXX"
pdate = "XXXXX"
amt = "XXXXX"
dues = 0
GoTo n1
End If
'===================================================
============================
'
rno = "XXXXX"
pdate = "XXXXX"
amt = "XXXXX"
125
ELECTRICITY BILLING SYSTEM
dues = r13.Fields("gross_total")
GoTo n1
End If
'===================================================
====================================================
=====
rno = r14.Fields("r_no")
pdate = r14.Fields("r_date")
amt = r14.Fields("amount")
'===================================================
===============================
If IsNull(r14.Fields("b_id")) Then
bid = 0
Else
bid = r14.Fields("b_id")
End If
Else
126
ELECTRICITY BILLING SYSTEM
dues = r14.Fields("dues")
End If
n1:
'=================================== CALCULATION
====================================================
'===================================================
=== DOMESTIC CALCULATION
=====================================
Set r2 = c.Execute(sql)
Else
127
ELECTRICITY BILLING SYSTEM
End If
p = r2.Fields("d_dps")
For i = 1 To 10
rent = r2.Fields("d_mrent")
'===================================================
================================================
rent = r2.Fields("d_mrent3")
End If
'===================================================
==================================================
Next
128
ELECTRICITY BILLING SYSTEM
'=================================================
NON-DOMESTIC CALCULATION
====================================
Set r2 = c.Execute(sql1)
Else
End If
p = r2.Fields("n_dps")
For i = 1 To 10
129
ELECTRICITY BILLING SYSTEM
rent = r2.Fields("n_mrent")
'===================================================
====================================================
===========
rent = r2.Fields("n_mrent3")
End If
'===================================================
====================================================
================
Next
End If
'===================================== NON-DOMESTIC
CALCULATION END ======================================
c1 = gross_total - rebate
c2 = gross_total
130
ELECTRICITY BILLING SYSTEM
d1 = Now + 14
d2 = Now + 21
Set r5 = c.Execute(sql)
If IsNull(r5.Fields(0)) Then
bid = 1
Else
id = r5.Fields(0) + 1
bid = id
End If
sql = "insert into calculate values('" & emp_id & "','" & r1.Fields("cust_id") & "'," &
r1.Fields("m_no") & "," & e_charge & "," & dps_current & "," & fixed & "," & e_duty & "," &
rent & "," & total & "," & rebate & "," & gross_total & "," & dues & ",'" &
UCase(Format(r.Fields("p_date"), "MMM yyyy")) & "','" & Format(r.Fields("c_date"), "dd
MMM yyyy") & "'," & r.Fields("c_reading") & "," & r.Fields("c_unit") & ")"
c.Execute (sql)
sql = "insert into bill values('" & emp_id & "','" & r1.Fields("cust_id") & "'," &
r1.Fields("m_no") & "," & bid & ",'" & Format(Now, "dd MMM yyyy") & "','" &
UCase(Format(r.Fields("p_date"), "MMM yyyy")) & "'," & gross_total & ",'" & Format(d1,
"dd MMM yyyy") & "','" & Format(d2, "dd MMM yyyy") & "'," & c1 & "," & c2 & "," & c3 &
",'UN PAID')"
c.Execute (sql)
131
ELECTRICITY BILLING SYSTEM
sql = "insert into temp values(" & bid & ",'" & Format(Now, "dd MMM yyyy") & "','" & mm &
"','" & Format(d1, "dd MMM yyyy") & "', '" & r1.Fields("cust_id") & "','" &
r1.Fields("cust_name") & "','" & r1.Fields("cust_add") & "','" & r1.Fields("division") & "','" &
r1.Fields("sub_division") & "'," & r1.Fields("m_no") & ",'" & r1.Fields("tarrif") & "'," &
r1.Fields("phase") & ",'" & r1.Fields("c_load") & "','" & emp_id & "','" & r3.Fields("e_nm") &
"','" & r3.Fields("e_add") & "'," & r3.Fields("e_phno") & ",'" & Format(r.Fields("p_date"), "dd
MMM yyyy") & "'," & r.Fields("p_reading") & "," & r.Fields("p_unit") & ",'" &
Format(r.Fields("c_date"), "dd MMM yyyy") & "'," & r.Fields("c_reading") & "," &
r.Fields("c_unit") & "," & dues & "," & e_charge & "," & dps_current & "," & fixed & "," &
e_duty & "," & rent & "," & total & "," & rebate & "," & gross_total & ",'" & Format(d1, "dd
MMM yyyy") & "','" & Format(d2, "dd MMM yyyy") & "'," & c1 & "," & c2 & "," & c3 & ",'" &
rno & "','" & pdate & "','" & amt & "')"
c.Execute (sql)
Adodc1.Refresh
Call ado
cmd_print.Enabled = True
cmd_first.Enabled = True
cmd_last.Enabled = True
cmd_previous.Enabled = True
cmd_next.Enabled = True
cmd_reset.Enabled = False
cmd_save.Enabled = False
a=1
xx:
r.MoveNext
132
ELECTRICITY BILLING SYSTEM
Loop
If a <> 1 Then
End If
End Sub
txt_bid.Text = Adodc1.Recordset.Fields("bill_id")
txt_div.Text = Adodc1.Recordset.Fields("div")
txt_eid.Text = Adodc1.Recordset.Fields("e_id")
txt_bdate.Text = Adodc1.Recordset("bdate")
txt_bmonth.Text = Adodc1.Recordset.Fields("bmonth")
txt_cid.Text = Adodc1.Recordset.Fields("c_id")
txt_sdiv.Text = Adodc1.Recordset.Fields("sdiv")
txt_ddate.Text = Adodc1.Recordset.Fields("due_date")
txt_ename.Text = Adodc1.Recordset.Fields("e_name")
txt_eadd.Text = Adodc1.Recordset.Fields("e_add")
txt_ephone.Text = Adodc1.Recordset.Fields("phone")
txt_name.Text = Adodc1.Recordset.Fields("c_name")
txt_add.Text = Adodc1.Recordset.Fields("addr")
txt_c1.Text = Adodc1.Recordset.Fields("c1")
txt_c2.Text = Adodc1.Recordset.Fields("c2")
txt_c3.Text = Adodc1.Recordset.Fields("c3")
133
ELECTRICITY BILLING SYSTEM
lbl_d1.Caption = Adodc1.Recordset.Fields("d1")
lbl_d2.Caption = Adodc1.Recordset.Fields("d2")
txt_mno.Text = Adodc1.Recordset.Fields("m_no")
txt_tarrif.Text = Adodc1.Recordset.Fields("tariff")
txt_phase.Text = Adodc1.Recordset.Fields("phase")
txt_cload.Text = Adodc1.Recordset.Fields("c_load")
txt_pdate.Text = Adodc1.Recordset.Fields("pread_date")
txt_pread.Text = Adodc1.Recordset.Fields("pread")
txt_punit.Text = Adodc1.Recordset.Fields("punit")
txt_cdate.Text = Adodc1.Recordset.Fields("cread_date")
txt_cread.Text = Adodc1.Recordset.Fields("cread")
txt_cunit.Text = Adodc1.Recordset.Fields("cunit")
txt_ech.Text = Adodc1.Recordset.Fields("e_ch")
txt_dpscurr.Text = Adodc1.Recordset.Fields("dps")
txt_fxdch.Text = Adodc1.Recordset.Fields("fxd_ch")
txt_ed.Text = Adodc1.Recordset.Fields("ed")
txt_mrent.Text = Adodc1.Recordset.Fields("mrent")
txt_tass.Text = Adodc1.Recordset.Fields("tot")
txt_dues.Text = Adodc1.Recordset.Fields("dues")
txt_gtot.Text = Adodc1.Recordset.Fields("gtot")
txt_rebate.Text = Adodc1.Recordset.Fields("rebate")
txt_rno.Text = Adodc1.Recordset.Fields("r_no")
txt_date.Text = Adodc1.Recordset.Fields("r_date")
txt_amt.Text = Adodc1.Recordset.Fields("at")
134
ELECTRICITY BILLING SYSTEM
cmd_print.Enabled = True
cmd_first.Enabled = True
cmd_last.Enabled = True
cmd_previous.Enabled = True
cmd_next.Enabled = True
End Sub
Adodc1.Refresh
conn
cmd_print.Enabled = False
cmd_first.Enabled = False
cmd_last.Enabled = False
cmd_previous.Enabled = False
cmd_next.Enabled = False
cmd_reset.Enabled = True
cmd_save.Enabled = True
On Error GoTo X
Adodc2.RecordSource = "select
c.*,m.m_no,phase,conn_date,supp_section,tarrif,c_load,ca.c_date,ca.c_reading,ca.c_unit,b_id,b
ill_month,b_date,energy_charge,dps_cmonth,fixed_charge,electricity_duty,meter_rent,total_
assesment,rebait,ca.gross_total,dues,date1,charge1,date2,charge2,charge3,status from
customer c,meter m,measure re,calculate ca,bill b where c.cust_id=m.cust_id and
re.cust_id=c.cust_id and re.c_reading in (select c_reading from measure where
to_char(c_date,'MON YYYY')='" & UCase(Format(Now, "MMM YYYY")) & "') And c.cust_id
in (select cust_id from measure where to_char(c_date,'MON YYYY')='" &
UCase(Format(Now, "MMM YYYY")) & "') and re.c_reading=ca.c_reading and
ca.month=b.bill_month and c.cust_id=ca.cust_id and c.cust_id=b.cust_id"
135
ELECTRICITY BILLING SYSTEM
Adodc2.Refresh
DataGrid1.Columns(1).Caption = "NAME"
DataGrid1.Columns(2).Caption = "PHONE"
DataGrid1.Columns(4).Caption = "ADDRESS"
DataGrid1.Columns(6).Caption = "PIN"
DataGrid1.Columns(14).Caption = "LOAD"
DataGrid1.Columns(16).Caption = "READING"
DataGrid1.Columns(17).Caption = "UNIT"
DataGrid1.Columns(22).Caption = "DPS"
136
ELECTRICITY BILLING SYSTEM
DataGrid1.Columns(26).Caption = "TOTAL"
DataGrid1.Columns(27).Caption = "REBAIT"
DataGrid1.Columns(29).Caption = "DUES"
DataGrid1.Columns(31).Caption = "CHARGE"
DataGrid1.Columns(33).Caption = "CHARGE"
DataGrid1.Columns(34).Caption = "CHARGE"
DataGrid1.Columns(35).Caption = "STATUS"
Exit Sub
X:
Exit Sub
End Sub
If X = True Then
Unload Me
Else
Cancel = 1
End If
End Sub
137
ELECTRICITY BILLING SYSTEM
RECEIPT
Dim id As Integer
Unload Me
End Sub
conn
txt_cid.SetFocus
txt_amt.SetFocus
Else
If X = True Then
Set r = c.Execute(sql)
138
ELECTRICITY BILLING SYSTEM
c.Execute (sql)
cmd_pay.Enabled = False
cmd_print.Enabled = True
cmd_reset.Enabled = False
cmd_exit.Enabled = False
cmd_print.SetFocus
Else
txt_amt.Text = ""
txt_dues.Text = ""
txt_amt.SetFocus
End If
End If
End Sub
sql = "select max(b_id) from payment where cust_id='" & txt_cid.Text & "'"
Set r = c.Execute(sql)
DataReport1.Sections("section1").Controls("label18").Caption =
NoToWord(Val(txt_amt.Text))
DataReport1.Show
Call cmd_reset_Click
139
ELECTRICITY BILLING SYSTEM
End Sub
txt_cname.Text = ""
txt_bid.Text = ""
txt_bmonth.Text = ""
txt_mno.Text = ""
txt_sdiv.Text = ""
txt_tot.Text = ""
txt_amt.Text = ""
txt_dues.Text = ""
txt_cid.Text = ""
txt_cid.SetFocus
Call Form_Load
End Sub
conn
Set r = c.Execute(sql)
If IsNull(r.Fields(0)) Then
txt_rno = 1
Else
id = r.Fields(0) + 1
txt_rno.Text = id
140
ELECTRICITY BILLING SYSTEM
End If
txt_div.Text = "DARBHANGA"
txt_eid.Text = emp_id
Set r = c.Execute(sql)
txt_ename = r.Fields(0)
cmd_print.Enabled = False
cmd_pay.Enabled = True
cmd_exit.Enabled = True
cmd_reset.Enabled = True
End Sub
If X = True Then
Unload Me
Else
Cancel = 1
End If
End Sub
txt_dues.Text = ""
141
ELECTRICITY BILLING SYSTEM
Exit Sub
End If
End Sub
If KeyAscii = 13 Then
cmd_pay.Enabled = True
cmd_pay.SetFocus
End If
End Sub
Call txt_amt_KeyPress(13)
End Sub
If KeyAscii = 13 Then
Call txt_cid_LostFocus
conn
sql = "select distinct cust_id from bill where cust_id='" + txt_cid.Text + "'"
On Error GoTo X
Set r = c.Execute(sql)
142
ELECTRICITY BILLING SYSTEM
Set r = c.Execute(sql)
If r.Fields(0) = 0 Then
txt_cid.Text = ""
txt_cid.SetFocus
Exit Sub
End If
sql = "SELECT MAX(B_ID) FROM BILL WHERE CUST_ID= '" + txt_cid.Text + "'"
Set r = c.Execute(sql)
Set r1 = c.Execute(sql1)
Exit Sub
X:
txt_cid.Text = ""
txt_cid.SetFocus
Exit Sub
End If
143
ELECTRICITY BILLING SYSTEM
Set r = c.Execute(sql)
txt_cname.Text = r.Fields("cust_name")
txt_bid.Text = r.Fields("b_id")
txt_bmonth.Text = r.Fields("bill_month")
txt_mno.Text = r.Fields("m_no")
txt_sdiv.Text = r.Fields("sub_division")
sql1 = "select * from bill where b_id=(select max(b_id)from bill where cust_id='" + txt_cid
+ "')"
Set r1 = c.Execute(sql1)
date1 = txt_date.Text
txt_tot.Text = r.Fields("charge1")
txt_tot.Text = r.Fields("charge2")
Else
txt_tot.Text = r.Fields("charge3")
End If
txt_amt.SetFocus
ElseIf (KeyAscii < 65 Or KeyAscii > 90 And KeyAscii < 97 Or KeyAscii > 122) And
(KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 Then
KeyAscii = 0
End If
144
ELECTRICITY BILLING SYSTEM
End Sub
txt_cid.Text = UCase(Trim(txt_cid.Text))
End Sub
145
ELECTRICITY BILLING SYSTEM
CREATE USER
Dim d As Date
Dim id As Integer
Unload Me
End Sub
txt_eid.Text = ""
txt_name.Text = ""
txt_phno.Text = ""
txt_email.Text = ""
txt_add.Text = ""
txt_dis.Text = ""
txt_pin.Text = ""
dtp_doj = Now
txt_eid.Text = ""
txt_uname.Text = ""
txt_pass.Text = ""
txt_cpass.Text = ""
txt_ltype.Text = ""
146
ELECTRICITY BILLING SYSTEM
Call Form_Load
End Sub
If X = True Then
Unload Me
Else
Cancel = 1
End If
End Sub
If KeyAscii = 13 Then
txt_dis.SetFocus
End If
End Sub
txt_add = UCase(Trim(txt_add))
End Sub
147
ELECTRICITY BILLING SYSTEM
txt_pass.Text = ""
txt_cpass.Text = ""
txt_pass.SetFocus
End If
End Sub
txt_dis = UCase(Trim(txt_dis))
End Sub
If KeyAscii = 13 Then
txt_phno.SetFocus
End If
End Sub
If (KeyAscii < 65 Or KeyAscii > 90 And KeyAscii < 97 Or KeyAscii > 122) And KeyAscii <>
8 And KeyAscii <> 32 And KeyAscii <> 13 Then
KeyAscii = 0
txt_dis.SetFocus
End If
If KeyAscii = 13 Then
148
ELECTRICITY BILLING SYSTEM
txt_pin.SetFocus
End If
End Sub
txt_email.Text = Trim(txt_email.Text)
conn
Set r = c.Execute(sql)
txt_email.Text = ""
txt_email.SetFocus
Exit Sub
Else
r.MoveNext
End If
Loop
End Sub
End If
149
ELECTRICITY BILLING SYSTEM
End Sub
If KeyAscii = 13 Then
txt_name = UCase(Trim(txt_name.Text))
txt_add.SetFocus
ElseIf (KeyAscii < 65 Or KeyAscii > 90 And KeyAscii < 97 Or KeyAscii > 122) And KeyAscii
<> 8 And KeyAscii <> 32 Then
KeyAscii = 0
txt_name.SetFocus
End If
End Sub
txt_name.Text = Trim(txt_name.Text)
End Sub
If ((KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 And KeyAscii <> 13) Then
KeyAscii = 0
txt_phno.SetFocus
End If
If KeyAscii = 13 Then
150
ELECTRICITY BILLING SYSTEM
'Call txt_phno_LostFocus
If txt_name.Text = "" And txt_phno.Text = "" And txt_email.Text = "" And txt_add.Text = ""
And txt_dis.Text = "" And txt_pin.Text = "" Then
txt_name.SetFocus
Exit Sub
txt_name.SetFocus
Exit Sub
txt_add.SetFocus
Exit Sub
txt_dis.SetFocus
Exit Sub
txt_pin.SetFocus
Exit Sub
Else
Frame1.Enabled = True
151
ELECTRICITY BILLING SYSTEM
str = Mid(txt_name, 1, 3)
conn
Set r = c.Execute(sql)
If IsNull(r.Fields(0)) Then
Else
id = r.Fields(0) + 1
End If
End If
txt_uname.Text = txt_name.Text
txt_pass.SetFocus
txt_ltype.Text = "EMPLOYEE"
End If
End If
End Sub
txt_phno.Text = ""
txt_phno.SetFocus
Exit Sub
End If
152
ELECTRICITY BILLING SYSTEM
conn
Set r = c.Execute(sql)
txt_phno.Text = ""
txt_phno.SetFocus
Exit Sub
Else
r.MoveNext
End If
Loop
Call txt_phno_KeyPress(13)
End Sub
If (KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 And KeyAscii <> 13 Then
KeyAscii = 0
txt_pin.SetFocus
End If
If KeyAscii = 13 Then
153
ELECTRICITY BILLING SYSTEM
dtp_doj.SetFocus
End If
End Sub
If txt_name.Text = "" And txt_phno.Text = "" And txt_email.Text = "" And txt_add.Text = ""
And txt_dis.Text = "" And txt_pin.Text = "" Then
txt_name.SetFocus
txt_name.SetFocus
txt_add.SetFocus
txt_dis.SetFocus
txt_pin.SetFocus
txt_phno.SetFocus
ElseIf txt_uname.Text = "" And txt_eid.Text = "" And txt_pass.Text = "" Then
154
ELECTRICITY BILLING SYSTEM
txt_uname.SetFocus
Exit Sub
txt_uname.SetFocus
Exit Sub
txt_cpass.Text = ""
txt_pass.SetFocus
Exit Sub
txt_pass.Text = ""
txt_cpass.Text = ""
txt_pass.SetFocus
Exit Sub
Else
conn
Set r = c.Execute(sql)
155
ELECTRICITY BILLING SYSTEM
Set r1 = c.Execute(sql1)
Adodc1.Refresh
If X = True Then
Call cmd_reset_Click
Else
Unload Me
End If
End If
End Sub
Frame1.Enabled = False
End Sub
If KeyAscii = 13 Then
txt_cpass.SetFocus
End If
End Sub
If KeyAscii = 13 Then
156
ELECTRICITY BILLING SYSTEM
Call txt_cpass_LostFocus
End If
Call cmd_add_click
End If
End Sub
157
ELECTRICITY BILLING SYSTEM
UPDATE USER
Unload Me
End Sub
txt_eid.Text = ""
txt_name.Text = ""
txt_phno.Text = ""
txt_email.Text = ""
txt_add.Text = ""
txt_dis.Text = ""
txt_pin.Text = ""
dtp_doj.value = Now
Adodc1.Refresh
Call Form_Load
txt_eid.SetFocus
End Sub
If txt_name.Text = "" And txt_add.Text = "" And txt_dis.Text = "" And txt_pin.Text = "" And
txt_phno.Text = "" And txt_email.Text = "" Then
txt_name.SetFocus
158
ELECTRICITY BILLING SYSTEM
txt_name.SetFocus
txt_add.SetFocus
txt_dis.SetFocus
txt_pin.SetFocus
txt_phno.SetFocus
txt_email.SetFocus
Else
conn
Set r = c.Execute(sql)
159
ELECTRICITY BILLING SYSTEM
Call cmd_reset_Click
End If
End Sub
If KeyAscii = 13 Then
End If
End Sub
Frame3.Enabled = False
cmd_update.Enabled = False
End Sub
If X = True Then
Unload Me
Else
Cancel = 1
End If
End Sub
160
ELECTRICITY BILLING SYSTEM
If KeyAscii = 13 Then
txt_dis.SetFocus
End If
End Sub
txt_add.Text = UCase(Trim(txt_add.Text))
End Sub
If KeyAscii = 13 Then
txt_pin.SetFocus
ElseIf (KeyAscii < 65 Or KeyAscii > 90 And KeyAscii < 97 Or KeyAscii > 122) And KeyAscii
<> 8 Then
KeyAscii = 0
End If
End Sub
txt_dis.Text = UCase(Trim(txt_dis.Text))
End Sub
161
ELECTRICITY BILLING SYSTEM
If KeyAscii = 13 Then
txt_eid.Text = UCase(Trim(txt_eid.Text))
conn
On Error GoTo X
Frame3.Enabled = True
Set r = c.Execute(sql)
txt_name.Text = r.Fields("e_nm")
txt_phno.Text = r.Fields("e_phno")
txt_email.Text = r.Fields("e_email")
txt_add.Text = r.Fields("e_add")
txt_dis.Text = r.Fields("e_dist")
txt_pin.Text = r.Fields("e_pin")
dtp_doj = r.Fields("e_doj")
cmd_update.Enabled = True
txt_name.SetFocus
Exit Sub
X:
txt_eid.Text = ""
txt_eid.SetFocus
ElseIf (KeyAscii < 65 Or KeyAscii > 90 And KeyAscii < 97 Or KeyAscii > 122) And
(KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 Then
162
ELECTRICITY BILLING SYSTEM
KeyAscii = 0
End If
End Sub
If KeyAscii = 13 Then
cmd_update.SetFocus
KeyAscii = 0
End If
End Sub
If KeyAscii = 13 Then
txt_add.SetFocus
ElseIf (KeyAscii < 65 Or KeyAscii > 90 And KeyAscii < 97 Or KeyAscii > 122) And KeyAscii
<> 8 And KeyAscii <> 32 Then
KeyAscii = 0
End If
End Sub
txt_name.Text = UCase(Trim(txt_name.Text))
End Sub
163
ELECTRICITY BILLING SYSTEM
If KeyAscii = 13 Then
txt_email.SetFocus
ElseIf (KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 Then
KeyAscii = 0
End If
End Sub
If KeyAscii = 13 Then
dtp_doj.SetFocus
ElseIf (KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 Then
KeyAscii = 0
End If
End Sub
164
ELECTRICITY BILLING SYSTEM
CHANGE PASSWORD
txt_id.Text = ""
txt_name = ""
txt_ltype = ""
txt_pass = ""
txt_cpass = ""
Call Form_Load
txt_id.SetFocus
End Sub
txt_pass = ""
txt_cpass = ""
txt_pass.SetFocus
Else
conn
sql = "update login set password='" + txt_pass.Text + "' where user_id='" + txt_id + "'"
Set r = c.Execute(sql)
165
ELECTRICITY BILLING SYSTEM
Adodc1.Refresh
Call cmd_reset_Click
End If
End Sub
Unload Me
End Sub
Frame1.Enabled = False
End Sub
If X = True Then
Unload Me
Else
Cancel = 1
End If
End Sub
If KeyAscii = 13 Then
166
ELECTRICITY BILLING SYSTEM
cmd_save.SetFocus
End If
End Sub
If KeyAscii = 13 Then
Frame1.Enabled = True
txt_id = UCase(Trim(txt_id))
conn
Set r = c.Execute(sql)
On Error GoTo X:
txt_name = r.Fields(0)
txt_ltype = r.Fields(3)
txt_pass.SetFocus
Else
If (KeyAscii < 65 Or KeyAscii > 90 And KeyAscii < 97 Or KeyAscii > 122) And (KeyAscii <
48 Or KeyAscii > 57) And KeyAscii <> 8 Then
KeyAscii = 0
End If
End If
Exit Sub
X:
167
ELECTRICITY BILLING SYSTEM
End Sub
If KeyAscii = 13 Then
txt_cpass.SetFocus
End If
End Sub
168
ELECTRICITY BILLING SYSTEM
Dim c As ADODB.Connection
Dim r As ADODB.Recordset
Unload Me
End Sub
Call Form_Load
End Sub
txt_upto100 = ""
txt_upto200 = ""
txt_upto300 = ""
txt_above300 = ""
txt_dps = ""
txt_ed = ""
txt_fixed1 = ""
txt_akw1 = ""
txt_mrent1 = ""
169
ELECTRICITY BILLING SYSTEM
txt_fixed3 = ""
txt_akw3 = ""
txt_mrent3 = ""
txt_rebate = ""
End Sub
Set r = c.Execute(sql)
Set r = c.Execute(sql)
End Sub
170
ELECTRICITY BILLING SYSTEM
Set r = c.Execute(sql)
txt_upto100.Text = r.Fields("D_UPTO100")
txt_upto200.Text = r.Fields("d_upto200")
txt_upto300.Text = r.Fields("d_upto300")
txt_above300.Text = r.Fields("d_above300")
txt_dps.Text = r.Fields("d_dps")
txt_ed.Text = r.Fields("d_ed")
txt_fixed1.Text = r.Fields("d_fc")
txt_akw1.Text = r.Fields("d_akw")
txt_mrent1.Text = r.Fields("d_mrent")
txt_fixed3.Text = r.Fields("d_fc3")
txt_akw3.Text = r.Fields("d_akw3")
txt_mrent3.Text = r.Fields("d_mrent3")
txt_rebate.Text = r.Fields("d_rebate")
End Sub
If X = True Then
Unload Me
Else
Cancel = 1
End If
171
ELECTRICITY BILLING SYSTEM
End Sub
If ((KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 And KeyAscii <> 13 And KeyAscii
<> 46) Then
KeyAscii = 0
txt_above300.SetFocus
End If
If KeyAscii = 13 Then
txt_dps.SetFocus
End If
End Sub
If ((KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 And KeyAscii <> 13 And KeyAscii
<> 46) Then
KeyAscii = 0
txt_akw1.SetFocus
End If
If KeyAscii = 13 Then
172
ELECTRICITY BILLING SYSTEM
txt_mrent1.SetFocus
End If
End Sub
If ((KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 And KeyAscii <> 13 And KeyAscii
<> 46) Then
KeyAscii = 0
txt_akw3.SetFocus
End If
If KeyAscii = 13 Then
txt_mrent3.SetFocus
End If
End Sub
If ((KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 And KeyAscii <> 13 And KeyAscii
<> 46) Then
KeyAscii = 0
173
ELECTRICITY BILLING SYSTEM
txt_dps.SetFocus
End If
If KeyAscii = 13 Then
txt_ed.SetFocus
End If
End Sub
If ((KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 And KeyAscii <> 13 And KeyAscii
<> 46) Then
KeyAscii = 0
txt_ed.SetFocus
End If
If KeyAscii = 13 Then
txt_rebate.SetFocus
End If
End Sub
174
ELECTRICITY BILLING SYSTEM
If ((KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 And KeyAscii <> 13 And KeyAscii
<> 46) Then
KeyAscii = 0
txt_fixed1.SetFocus
End If
If KeyAscii = 13 Then
txt_akw1.SetFocus
End If
End Sub
If ((KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 And KeyAscii <> 13 And KeyAscii
<> 46) Then
KeyAscii = 0
txt_fixed3.SetFocus
End If
If KeyAscii = 13 Then
txt_akw3.SetFocus
End If
End Sub
175
ELECTRICITY BILLING SYSTEM
If ((KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 And KeyAscii <> 13 And KeyAscii
<> 46) Then
KeyAscii = 0
txt_mrent1.SetFocus
End If
If KeyAscii = 13 Then
txt_fixed3.SetFocus
End If
End Sub
If ((KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 And KeyAscii <> 13 And KeyAscii
<> 46) Then
KeyAscii = 0
txt_upto100.SetFocus
End If
If KeyAscii = 13 Then
cmd_update.SetFocus
176
ELECTRICITY BILLING SYSTEM
End If
End Sub
If ((KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 And KeyAscii <> 13 And KeyAscii
<> 46) Then
KeyAscii = 0
txt_rebate.SetFocus
End If
If KeyAscii = 13 Then
txt_fixed1.SetFocus
End If
End Sub
If ((KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 And KeyAscii <> 13 And KeyAscii
<> 46) Then
KeyAscii = 0
txt_upto100.SetFocus
End If
177
ELECTRICITY BILLING SYSTEM
If KeyAscii = 13 Then
txt_upto200.SetFocus
End If
End Sub
If ((KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 And KeyAscii <> 13 And KeyAscii
<> 46) Then
KeyAscii = 0
txt_upto200.SetFocus
End If
If KeyAscii = 13 Then
txt_upto300.SetFocus
End If
End Sub
If ((KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 And KeyAscii <> 13 And KeyAscii
<> 46) Then
KeyAscii = 0
txt_upto300.SetFocus
178
ELECTRICITY BILLING SYSTEM
End If
If KeyAscii = 13 Then
txt_above300.SetFocus
End If
End Sub
179
ELECTRICITY BILLING SYSTEM
Dim c As ADODB.Connection
Dim r As ADODB.Recordset
Unload Me
End Sub
Call Form_Load
End Sub
txt_upto100 = ""
txt_upto200 = ""
txt_above200 = ""
txt_dps = ""
txt_ed = ""
txt_fixed1 = ""
txt_akw1 = ""
txt_mrent1 = ""
txt_fixed3 = ""
180
ELECTRICITY BILLING SYSTEM
txt_akw3 = ""
txt_mrent3 = ""
txt_rebate = ""
End Sub
Set r = c.Execute(sql)
End Sub
Set r = c.Execute(sql)
txt_upto100.Text = r.Fields("n_UPTO100")
txt_upto200.Text = r.Fields("n_upto200")
181
ELECTRICITY BILLING SYSTEM
txt_above200.Text = r.Fields("n_above200")
txt_dps.Text = r.Fields("n_dps")
txt_ed.Text = r.Fields("n_ed")
txt_fixed1.Text = r.Fields("n_fc")
txt_akw1.Text = r.Fields("n_akw")
txt_mrent1.Text = r.Fields("n_mrent")
txt_fixed3.Text = r.Fields("n_fc3")
txt_akw3.Text = r.Fields("n_akw3")
txt_mrent3.Text = r.Fields("n_mrent3")
txt_rebate.Text = r.Fields("n_rebate")
End Sub
If X = True Then
Unload Me
Else
Cancel = 1
End If
End Sub
182
ELECTRICITY BILLING SYSTEM
If ((KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 And KeyAscii <> 13 And KeyAscii
<> 46) Then
KeyAscii = 0
txt_above200.SetFocus
End If
If KeyAscii = 13 Then
txt_dps.SetFocus
End If
End Sub
If ((KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 And KeyAscii <> 13 And KeyAscii
<> 46) Then
KeyAscii = 0
txt_akw1.SetFocus
End If
If KeyAscii = 13 Then
txt_mrent1.SetFocus
End If
End Sub
183
ELECTRICITY BILLING SYSTEM
If ((KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 And KeyAscii <> 13 And KeyAscii
<> 46) Then
KeyAscii = 0
txt_akw3.SetFocus
End If
If KeyAscii = 13 Then
txt_mrent3.SetFocus
End If
End Sub
If ((KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 And KeyAscii <> 13 And KeyAscii
<> 46) Then
KeyAscii = 0
txt_dps.SetFocus
End If
If KeyAscii = 13 Then
txt_ed.SetFocus
184
ELECTRICITY BILLING SYSTEM
End If
End Sub
If ((KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 And KeyAscii <> 13 And KeyAscii
<> 46) Then
KeyAscii = 0
txt_ed.SetFocus
End If
If KeyAscii = 13 Then
txt_rebate.SetFocus
End If
End Sub
If ((KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 And KeyAscii <> 13 And KeyAscii
<> 46) Then
KeyAscii = 0
txt_fixed1.SetFocus
185
ELECTRICITY BILLING SYSTEM
End If
If KeyAscii = 13 Then
txt_akw1.SetFocus
End If
End Sub
If ((KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 And KeyAscii <> 13 And KeyAscii
<> 46) Then
KeyAscii = 0
txt_fixed3.SetFocus
End If
If KeyAscii = 13 Then
txt_akw3.SetFocus
End If
End Sub
If ((KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 And KeyAscii <> 13 And KeyAscii
<> 46) Then
186
ELECTRICITY BILLING SYSTEM
KeyAscii = 0
txt_mrent1.SetFocus
End If
If KeyAscii = 13 Then
txt_fixed3.SetFocus
End If
End Sub
If ((KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 And KeyAscii <> 13 And KeyAscii
<> 46) Then
KeyAscii = 0
txt_upto100.SetFocus
End If
If KeyAscii = 13 Then
cmd_update.SetFocus
End If
End Sub
If ((KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 And KeyAscii <> 13 And KeyAscii
<> 46) Then
187
ELECTRICITY BILLING SYSTEM
KeyAscii = 0
txt_rebate.SetFocus
End If
If KeyAscii = 13 Then
txt_fixed1.SetFocus
End If
End Sub
If ((KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 And KeyAscii <> 13 And KeyAscii
<> 46) Then
KeyAscii = 0
txt_upto200.SetFocus
End If
If KeyAscii = 13 Then
txt_above200.SetFocus
End If
End Sub
If ((KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 And KeyAscii <> 13 And KeyAscii
<> 46) Then
KeyAscii = 0
txt_upto100.SetFocus
188
ELECTRICITY BILLING SYSTEM
End If
If KeyAscii = 13 Then
txt_upto200.SetFocus
End If
End Sub
189
ELECTRICITY BILLING SYSTEM
Dim c As ADODB.Connection
Dim r As ADODB.Recordset
Unload Me
End Sub
txt_cid = ""
txt_name = ""
txt_phno = ""
txt_eid = ""
txt_add = ""
txt_dist = ""
txt_pin = ""
txt_sdiv.Text = ""
txt_mno = ""
Combo_phase.ListIndex = -1
dtp_cdate.value = Now
190
ELECTRICITY BILLING SYSTEM
Combo_ssec.ListIndex = -1
Combo_tarrif.ListIndex = -1
txt_volt = ""
Adodc1.Refresh
End Sub
If txt_name = "" And txt_phno = "" And txt_add = "" And txt_dist = "" And txt_pin = "" Then
txt_name.SetFocus
txt_name.SetFocus
txt_phno.SetFocus
txt_add.SetFocus
txt_dist.SetFocus
txt_pin.SetFocus
191
ELECTRICITY BILLING SYSTEM
ElseIf txt_mno = "" And txt_cdate = "" And Combo_ssec = "" And Combo_phase = "" And
Combo_cload = "" Then
txt_mno.SetFocus
txt_mno.SetFocus
Combo_phase.SetFocus
Combo_ssec.SetFocus
Combo_tarrif.SetFocus
Combo_cload.SetFocus
Else
192
ELECTRICITY BILLING SYSTEM
c.Execute (sql)
c.Execute (sql1)
Call cmd_reset_Click
cmd_update.Enabled = False
txt_cid.SetFocus
End If
End Sub
Combo_cload.Clear
If Combo_phase = 1 Then
For i = 1 To 7
Combo_cload.AddItem i
Next
For i = 5 To 10
Combo_cload.AddItem i
Next
193
ELECTRICITY BILLING SYSTEM
End If
End Sub
If X = True Then
Unload Me
Else
Cancel = 1
End If
End Sub
If KeyAscii = 13 Then
txt_cid = UCase(Trim(txt_cid))
On Error GoTo X
Set r = c.Execute(sql)
Frame1.Enabled = True
Frame2.Enabled = True
194
ELECTRICITY BILLING SYSTEM
cmd_update.Enabled = True
txt_div.Text = r.Fields("DIVISION")
txt_name.Text = r.Fields("CUST_NAME")
If IsNull(r.Fields("phone_no")) Then
txt_phno.Text = ""
Else
txt_phno.Text = r.Fields("PHONE_NO")
End If
If IsNull(r.Fields("EMAIL_ID")) Then
txt_eid.Text = ""
Else
txt_eid.Text = r.Fields("EMAIL_ID")
End If
txt_add.Text = r.Fields("CUST_ADD")
txt_dist.Text = r.Fields("DISTRICT")
txt_pin.Text = r.Fields("P_CODE")
txt_mno.Text = r.Fields("M_NO")
dtp_cdate.value = r.Fields("conn_date")
If r.Fields("phase") = 1 Then
Combo_phase.ListIndex = 0
Else
Combo_phase.ListIndex = 1
End If
195
ELECTRICITY BILLING SYSTEM
txt_sdiv.Text = r.Fields("sub_division")
Combo_ssec.Clear
Combo_ssec.AddItem "DONAR"
Combo_ssec.AddItem "BELA"
Combo_ssec.AddItem "LAXMINAGAR"
Combo_ssec.AddItem "BENTA"
Combo_ssec.AddItem "PANDASARAI"
End If
Combo_ssec.ListIndex = 0
Combo_ssec.ListIndex = 1
Combo_ssec.ListIndex = 2
End If
Combo_tarrif.ListIndex = 0
Else
Combo_tarrif.ListIndex = 1
End If
Call Combo_phase_Click
For i = 0 To Combo_cload.ListCount
196
ELECTRICITY BILLING SYSTEM
Combo_cload.ListIndex = i
txt_name.SetFocus
Exit Sub
End If
Next
Exit Sub
X:
txt_cid.Text = ""
ElseIf (KeyAscii < 65 Or KeyAscii > 90 And KeyAscii < 97 Or KeyAscii > 122) And
(KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 Then
KeyAscii = 0
End If
End Sub
txt_eid.Text = Trim(txt_eid.Text)
conn
Set r = c.Execute(sql)
197
ELECTRICITY BILLING SYSTEM
txt_eid.Text = ""
txt_eid.SetFocus
Exit Sub
Else
r.MoveNext
End If
Loop
End Sub
End If
End Sub
If KeyAscii = 13 Then
txt_phno.SetFocus
ElseIf (KeyAscii < 65 Or KeyAscii > 90 And KeyAscii < 97 Or KeyAscii > 122) And KeyAscii
<> 8 And KeyAscii <> 32 Then
198
ELECTRICITY BILLING SYSTEM
KeyAscii = 0
txt_name.SetFocus
End If
End Sub
End If
End Sub
txt_name.Text = UCase(Trim(txt_name.Text))
End Sub
If ((KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 And KeyAscii <> 13) Then
KeyAscii = 0
txt_phno.SetFocus
End If
If KeyAscii = 13 Then
txt_eid.SetFocus
199
ELECTRICITY BILLING SYSTEM
End If
End Sub
txt_phno.Text = ""
txt_phno.SetFocus
Exit Sub
End If
conn
Set r = c.Execute(sql)
txt_phno.Text = ""
txt_phno.SetFocus
Exit Sub
Else
r.MoveNext
End If
Loop
200
ELECTRICITY BILLING SYSTEM
End Sub
If (KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 And KeyAscii <> 32 And KeyAscii
<> 13 Then
KeyAscii = 0
txt_pin.SetFocus
End If
If KeyAscii = 13 Then
txt_sdiv.SetFocus
End If
End Sub
txt_pin.Text = ""
txt_pin.SetFocus
End If
End Sub
If KeyAscii = 13 Then
Combo_tarrif.SetFocus
201
ELECTRICITY BILLING SYSTEM
End If
End Sub
If KeyAscii = 13 Then
cmd_update.SetFocus
End If
End Sub
If KeyAscii = 13 Then
Combo_cload.SetFocus
End If
End Sub
If KeyAscii = 13 Then
Combo_ssec.SetFocus
End If
End Sub
If KeyAscii = 13 Then
txt_dist.SetFocus
End If
202
ELECTRICITY BILLING SYSTEM
End Sub
txt_add = Trim(UCase(txt_add))
End Sub
If (KeyAscii < 65 Or KeyAscii > 90 And KeyAscii < 97 Or KeyAscii > 122) And KeyAscii <>
8 And KeyAscii <> 32 And KeyAscii <> 13 Then
KeyAscii = 0
txt_dist.SetFocus
End If
If KeyAscii = 13 Then
txt_pin.SetFocus
End If
End Sub
txt_dist = Trim(UCase(txt_dist))
End Sub
If KeyAscii = 13 Then
txt_add.SetFocus
203
ELECTRICITY BILLING SYSTEM
End If
End Sub
If KeyAscii = 13 Then
dtp_cdate.SetFocus
End If
End Sub
If KeyAscii = 13 Then
txt_mno.SetFocus
End If
End Sub
204
ELECTRICITY BILLING SYSTEM
frm_bill.txt_cid.Text = txt_cid.Text
frm_bill.Show
Call cmd_reset_Click
Unload frm_updmeter
End Sub
Unload Me
End Sub
txt_cid = ""
txt_name = ""
txt_mno = ""
txt_phase = ""
txt_condate = ""
txt_div = ""
txt_sdiv = ""
txt_ssec = ""
txt_tarrif = ""
205
ELECTRICITY BILLING SYSTEM
txt_eid.Text = ""
txt_pdate = ""
txt_pread = ""
txt_punit = ""
dtp_cdate.value = Now
txt_cread = ""
txt_cunit = ""
txt_cid.SetFocus
Call Form_Load
End Sub
txt_cread.SetFocus
Else
conn
sql = "select max(b_id) from payment where cust_id='" + txt_cid.Text + "' "
Set r = c.Execute(sql)
sql = "select b_id from bill where cust_id='" + txt_cid.Text + "' and bill_month=(select
to_char(p_date,'MON YYYY') from measure where cust_id='" + txt_cid.Text + "' and
to_char(c_date,'MON YYYY')=to_char((select sysdate from dual),'MON YYYY'))"
On Error GoTo X
Set r1 = c.Execute(sql)
If IsNull(r1.Fields(0)) Then
206
ELECTRICITY BILLING SYSTEM
GoTo X
End If
txt_cid.Text = ""
txt_cid.SetFocus
Call cmd_reset_Click
Exit Sub
End If
X:
sql = "delete from bill where cust_id='" + txt_cid.Text + "' and bill_month=(select
to_char(p_date,'MON YYYY') from measure where cust_id='" + txt_cid.Text + "' and
to_char(c_date,'MON YYYY')=to_char((select sysdate from dual),'MON YYYY'))"
c.Execute (sql)
sql = "delete from calculate where cust_id='" + txt_cid.Text + "' and month=(select
to_char(p_date,'MON YYYY') from measure where cust_id='" + txt_cid.Text + "' and
to_char(c_date,'MON YYYY')=to_char((select sysdate from dual),'MON YYYY'))"
c.Execute (sql)
If X = True Then
sql = "update measure set c_date='" + Format(dtp_cdate, "dd MMM yy") + "',c_reading="
+ txt_cread + ",c_unit=" + txt_cunit + " where cust_id='" + txt_cid.Text + "' and p_date='"
+ Format(txt_pdate.Text, "dd MMM yy") + "'"
Set r = c.Execute(sql)
207
ELECTRICITY BILLING SYSTEM
cmd_update.Enabled = False
cmd_bill.Enabled = True
cmd_exit.Enabled = False
cmd_reset.Enabled = False
cmd_bill.SetFocus
Adodc1.Refresh
Else
Exit Sub
End If
End If
End Sub
208
ELECTRICITY BILLING SYSTEM
dtp_cdate.SetFocus
End If
End Sub
cmd_update.Enabled = False
cmd_bill.Enabled = False
cmd_reset.Enabled = True
cmd_exit.Enabled = True
End Sub
If X = True Then
Unload Me
Else
Cancel = 1
End If
End Sub
209
ELECTRICITY BILLING SYSTEM
If KeyAscii = 13 Then
txt_cid = UCase(Trim(txt_cid.Text))
conn
sql = "select distinct cust_id from measure where cust_id='" + txt_cid.Text + "'"
On Error GoTo y
Set r = c.Execute(sql)
sql = "select max(c_date) from measure where cust_id='" + r.Fields(0) + "' and
to_char(c_date,'MON YYYY')=to_char((select sysdate from dual),'MON YYYY')"
Set r1 = c.Execute(sql)
sql = "select * from measure where cust_id='" + txt_cid.Text + "' and (select sysdate from
dual) between '" & Format(r1.Fields(0), "dd MMM yy") & "' and '" & Format(r1.Fields(0) +
15, "dd MMM yy") & "'"
On Error GoTo xx
Set r = c.Execute(sql)
txt_eid.Text = emp_id
txt_cid.Text = r.Fields("cust_id")
txt_mno.Text = r.Fields("m_no")
txt_pdate.Text = r.Fields("p_date")
txt_pread.Text = r.Fields("p_reading")
txt_punit.Text = r.Fields("p_unit")
dtp_cdate.value = r.Fields("c_date")
txt_cread.Text = r.Fields("c_reading")
txt_cunit.Text = r.Fields("c_unit")
210
ELECTRICITY BILLING SYSTEM
Set r = c.Execute(sql)
txt_name.Text = r.Fields("cust_name")
txt_mno.Text = r.Fields("m_no")
txt_phase.Text = r.Fields("phase")
txt_condate.Text = r.Fields("conn_date")
txt_div.Text = r.Fields("division")
txt_sdiv.Text = r.Fields("sub_division")
txt_ssec.Text = r.Fields("supp_section")
txt_tarrif.Text = r.Fields("tarrif")
dtp_cdate.SetFocus
cmd_update.Enabled = True
ElseIf (KeyAscii < 65 Or KeyAscii > 90 And KeyAscii < 97 Or KeyAscii > 122) And
(KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 Then
KeyAscii = 0
End If
Exit Sub
xx:
txt_cid.Text = ""
txt_cid.SetFocus
211
ELECTRICITY BILLING SYSTEM
Exit Sub
y:
txt_cid.Text = ""
txt_cid.SetFocus
End Sub
txt_cunit.Text = ""
Exit Sub
End If
End Sub
If KeyAscii = 13 Then
cmd_update.SetFocus
End If
End Sub
Call txt_cread_KeyPress(13)
End Sub
212
ELECTRICITY BILLING SYSTEM
Dim r3 As ADODB.Recordset
Dim d As Date
Dim p As Double
Dim du As Double
Dim m1 As String
Dim d1 As Date
Dim d2 As Date
conn
Set r = c.Execute(sql)
sql = "insert into temp values(" + txt_bid + ",'" + Format(txt_bdate, "dd MMM yyyy") + "','"
+ txt_bmonth + "','" + Format(txt_ddate, "dd MMM yyyy") + "', '" + txt_cid + "','" +
txt_name + "','" + txt_add + "','" + txt_div + "','" + txt_sdiv + "'," + txt_mno + ",'" +
txt_tarrif + "'," + txt_phase + "," + txt_cload + ",'" + txt_eid.Text + "','" + txt_ename + "','"
+ txt_eadd + "'," + txt_ephone + ",'" + Format(txt_pdate, "dd MMM yyyy") + "'," +
txt_pread + "," + txt_punit + ",'" + Format(txt_cdate, "dd MMM yyyy") + "'," + txt_cread +
"," + txt_cunit + "," + txt_dues + "," + txt_ech + "," + txt_dpscurr + "," + txt_fxdch + "," +
txt_ed + "," + txt_mrent + "," + txt_tass + "," + txt_rebate + "," + txt_gtot + ",'" +
Format(lbl_d1.Caption, "dd MMM yyyy") + "','" + Format(lbl_d2.Caption, "dd MMM yyyy")
+ "'," + txt_c1 + "," + txt_c2 + "," + txt_c3 + ",'" + txt_rno + "','" + txt_date + "','" + txt_amt
+ "')"
213
ELECTRICITY BILLING SYSTEM
Set r = c.Execute(sql)
Unload Me
DataReport2.Show
End Sub
txt_cid.SetFocus
End Sub
Set r = c.Execute(sql)
If IsNull(r.Fields(0)) Then
txt_bid = 1
Else
id = r.Fields(0) + 1
txt_bid.Text = id
End If
214
ELECTRICITY BILLING SYSTEM
txt_eid.Text = emp_id
d = txt_bdate.Text
d = lbl_d1.Caption
cmd_print.Enabled = False
End Sub
If KeyAscii = 13 Then
txt_cid = UCase(Trim(txt_cid))
conn
Set r = c.Execute(sql)
Set r1 = c.Execute(sql1)
If IsNull(r1.Fields(0)) Then GoTo next1 '-------------- when no unit is consumed (1st time)
215
ELECTRICITY BILLING SYSTEM
Exit Sub
End If
next1:
Set r = c.Execute(sql)
If (r.Fields(0) = 0) Then
Exit Sub
Else
'===================================================
=== DUES/RECEIPT DETAIL ENTRY ==============================
sql = "select * FROM bill where B_ID=(SELECT MAX(B_ID) FROM BILL WHERE CUST_ID=
'" + txt_cid.Text + "')"
sql1 = "select * from payment where b_id=(select max(b_id) from payment where
cust_id='" + txt_cid.Text + "')"
Set r = c.Execute(sql)
Set r1 = c.Execute(sql1)
216
ELECTRICITY BILLING SYSTEM
txt_rno.Text = "XXXXX"
txt_date.Text = "XXXXX"
txt_amt.Text = "XXXXX"
txt_dues.Text = 0
GoTo n1
End If
'===================================================
============================
txt_rno.Text = "XXXXX"
txt_date.Text = "XXXXX"
txt_amt.Text = "XXXXX"
GoTo n2
End If
'===================================================
====================================================
=====
txt_rno.Text = r1.Fields("r_no")
txt_date.Text = r1.Fields("r_date")
txt_amt.Text = r1.Fields("amount")
'===================================================
===============================
217
ELECTRICITY BILLING SYSTEM
If IsNull(r1.Fields("b_id")) Then
bid = 0
Else
bid = r1.Fields("b_id")
End If
n2:
date1 = txt_bdate.Text
sql3 = "select count(dues) from payment where b_id=(select max(b_id) from payment
where cust_id='" + txt_cid.Text + "')"
Set r3 = c.Execute(sql3)
If (r3.Fields(0) = 0) Then
du = 0
Else
du = r1.Fields("dues")
End If
txt_dues.Text = r.Fields("gross_total") + du
Else
txt_dues.Text = r1.Fields("dues")
End If
218
ELECTRICITY BILLING SYSTEM
n1:
Set r = c.Execute(sql)
txt_div.Text = r.Fields("DIVISION")
txt_sdiv.Text = r.Fields("sub_division")
txt_name.Text = r.Fields("CUST_NAME")
txt_add.Text = r.Fields("CUST_ADD")
txt_mno.Text = r.Fields("M_NO")
txt_tarrif.Text = r.Fields("tarrif")
txt_phase.Text = r.Fields("phase")
txt_cload.Text = r.Fields("c_load")
'===================================================
==========================
txt_pdate.Text = r.Fields("p_date")
txt_pread.Text = r.Fields("p_reading")
219
ELECTRICITY BILLING SYSTEM
txt_punit.Text = r.Fields("p_unit")
txt_cdate.Text = r.Fields("c_date")
txt_cread.Text = r.Fields("c_reading")
txt_cunit.Text = r.Fields("c_unit")
Set r = c.Execute(sql)
txt_ename.Text = r.Fields("e_nm")
txt_eadd.Text = r.Fields("e_add")
txt_ephone.Text = r.Fields("e_phno")
'=================================== CALCULATION
====================================================
'===================================================
=== DOMESTIC CALCULATION
=====================================
Set r = c.Execute(sql)
220
ELECTRICITY BILLING SYSTEM
Else
End If
p = r.Fields("d_dps")
For i = 1 To 10
txt_mrent.Text = r.Fields("d_mrent")
'===================================================
================================================
221
ELECTRICITY BILLING SYSTEM
txt_mrent.Text = r.Fields("d_mrent3")
End If
'===================================================
==================================================
Next
'=================================================
NON-DOMESTIC CALCULATION
====================================
Set r = c.Execute(sql)
Else
End If
p = r.Fields("n_dps")
For i = 1 To 10
222
ELECTRICITY BILLING SYSTEM
txt_mrent.Text = r.Fields("n_mrent")
'===================================================
====================================================
===========
txt_mrent.Text = r.Fields("n_mrent3")
End If
'===================================================
====================================================
================
Next
End If
'===================================== NON-DOMESTIC
CALCULATION END ======================================
223
ELECTRICITY BILLING SYSTEM
txt_c2.Text = txt_gtot.Text
sql1 = "insert into bill values('" + txt_eid.Text + "','" + txt_cid.Text + "'," + txt_mno.Text +
"," + txt_bid.Text + ",'" + txt_bdate.Text + "','" + txt_bmonth.Text + "'," + txt_gtot.Text +
",'" + lbl_d1.Caption + "','" + lbl_d2.Caption + "'," + txt_c1.Text + "," + txt_c2.Text + "," +
txt_c3.Text + ",'UN PAID')"
Set r = c.Execute(sql)
Set r = c.Execute(sql1)
cmd_print.Enabled = True
cmd_print.SetFocus
Exit Sub
'===================================================
====================================================
=
X:
txt_cid.Text = ""
224
ELECTRICITY BILLING SYSTEM
Exit Sub
End If
Else
KeyAscii = 0
End If
End Sub
Call txt_cid_KeyPress(13)
End Sub
225
ELECTRICITY BILLING SYSTEM
Unload Me
End Sub
Adodc1.Recordset.MoveFirst
Call value
End Sub
Adodc1.Recordset.MoveLast
Call value
End Sub
On Error GoTo X
Adodc1.Recordset.MoveNext
Call value
Exit Sub
X:
End Sub
226
ELECTRICITY BILLING SYSTEM
On Error GoTo X
Adodc1.Recordset.MovePrevious
Call value
Exit Sub
X:
End Sub
DataEnvironment1.rsCommand6.Open Adodc1.RecordSource
DataReport4.Show
End Sub
Combo_search.ListIndex = -1
txt_search.Text = ""
txt_search.Visible = False
txt_cid.Text = ""
txt_name.Text = ""
txt_phno.Text = ""
txt_eid.Text = ""
txt_add.Text = ""
227
ELECTRICITY BILLING SYSTEM
txt_dist.Text = ""
txt_pin.Text = ""
txt_sdiv.Text = ""
txt_mno.Text = ""
txt_phase.Text = ""
txt_cdate.Text = ""
txt_ssec.Text = ""
txt_tarrif.Text = ""
txt_div.Text = ""
txt_cload.Text = ""
MonthView1.Visible = False
Call Form_Load
Combo_search.SetFocus
End Sub
txt_search.Text = ""
txt_search.Visible = False
txt_cid.Text = ""
txt_name.Text = ""
txt_phno.Text = ""
txt_eid.Text = ""
txt_add.Text = ""
228
ELECTRICITY BILLING SYSTEM
txt_dist.Text = ""
txt_pin.Text = ""
txt_sdiv.Text = ""
txt_mno.Text = ""
txt_phase.Text = ""
txt_cdate.Text = ""
txt_ssec.Text = ""
txt_tarrif.Text = ""
txt_div.Text = ""
txt_cload.Text = ""
MonthView1.Visible = False
txt_search.Visible = True
txt_search.Text = ""
txt_search.SetFocus
txt_search.Locked = False
MonthView1.Visible = False
txt_search.Visible = True
txt_search.Text = ""
txt_search.SetFocus
txt_search.Locked = False
229
ELECTRICITY BILLING SYSTEM
MonthView1.Visible = False
txt_search.Visible = True
txt_search.Text = ""
txt_search.SetFocus
txt_search.Locked = False
MonthView1.Visible = False
txt_search.Visible = True
txt_search.Text = ""
txt_search.SetFocus
txt_search.Locked = False
MonthView1.Visible = False
txt_search.Visible = True
txt_search.Text = ""
txt_search.SetFocus
txt_search.Locked = False
txt_search.Visible = True
MonthView1.Visible = False
230
ELECTRICITY BILLING SYSTEM
txt_search.Text = ""
txt_search.SetFocus
txt_search.Locked = True
MonthView1.Visible = False
txt_search.Visible = True
txt_search.Text = ""
txt_search.SetFocus
txt_search.Locked = False
MonthView1.Visible = False
txt_search.Visible = True
txt_search.Text = ""
txt_search.SetFocus
txt_search.Locked = False
MonthView1.Visible = False
txt_search.Visible = True
txt_search.Text = ""
txt_search.SetFocus
txt_search.Locked = False
231
ELECTRICITY BILLING SYSTEM
MonthView1.Visible = False
txt_search.Visible = True
txt_search.Text = ""
txt_search.SetFocus
txt_search.Locked = False
cmd_print.Enabled = True
cmd_print.SetFocus
Call rs
On Error GoTo X
Adodc1.Refresh
DataGrid1.Columns(1).Caption = "NAME"
DataGrid1.Columns(2).Caption = "PHONE"
DataGrid1.Columns(4).Caption = "ADDRESS"
DataGrid1.Columns(6).Caption = "PIN"
232
ELECTRICITY BILLING SYSTEM
DataGrid1.Columns(14).Caption = "LOAD"
Call value
Exit Sub
X:
Call cmd_reset_Click
End If
End Sub
If KeyAscii = 13 Then
txt_search.SetFocus
End If
End Sub
Adodc1.RecordSource = "select
customer.cust_id,customer.cust_name,customer.phone_no,customer.email_id,customer.cust
_add,customer.district,customer.p_code,customer.division,customer.sub_division,meter.m_
no,meter.phase,meter.conn_date,meter.supp_section,meter.tarrif,meter.c_load from
customer,meter where customer.cust_id='0'"
Adodc1.Refresh
DataGrid1.Columns(1).Caption = "NAME"
233
ELECTRICITY BILLING SYSTEM
DataGrid1.Columns(2).Caption = "PHONE"
DataGrid1.Columns(4).Caption = "ADDRESS"
DataGrid1.Columns(6).Caption = "PIN"
DataGrid1.Columns(14).Caption = "LOAD"
cmd_print.Enabled = False
cmd_first.Enabled = False
cmd_last.Enabled = False
cmd_previous.Enabled = False
cmd_next.Enabled = False
End Sub
If X = True Then
Unload Me
Else
Cancel = 1
End If
234
ELECTRICITY BILLING SYSTEM
End Sub
txt_search.Text = MonthView1.value
MonthView1.Visible = False
Adodc1.RecordSource = "select
customer.cust_id,customer.cust_name,customer.phone_no,customer.email_id,customer.cust
_add,customer.district,customer.p_code,customer.division,customer.sub_division,meter.m_
no,meter.phase,meter.conn_date,meter.supp_section,meter.tarrif,meter.c_load from
customer,meter where customer.cust_id=meter.cust_id and customer.cust_id in (select
cust_id from customer where conn_date='" + Format(txt_search.Text, "dd MMM yy") + "')"
On Error GoTo xx
Adodc1.Refresh
DataGrid1.Columns(1).Caption = "NAME"
DataGrid1.Columns(2).Caption = "PHONE"
DataGrid1.Columns(4).Caption = "ADDRESS"
DataGrid1.Columns(6).Caption = "PIN"
DataGrid1.Columns(14).Caption = "LOAD"
Call value
235
ELECTRICITY BILLING SYSTEM
Exit Sub
xx:
txt_cid.Text = ""
txt_name.Text = ""
txt_phno.Text = ""
txt_eid.Text = ""
txt_add.Text = ""
txt_dist.Text = ""
txt_pin.Text = ""
txt_sdiv.Text = ""
txt_mno.Text = ""
txt_phase.Text = ""
txt_cdate.Text = ""
txt_ssec.Text = ""
txt_tarrif.Text = ""
txt_div.Text = ""
txt_cload.Text = ""
Adodc1.RecordSource = "select
customer.cust_id,customer.cust_name,customer.phone_no,customer.email_id,customer.cust
_add,customer.district,customer.p_code,customer.division,customer.sub_division,meter.m_
no,meter.phase,meter.conn_date,meter.supp_section,meter.tarrif,meter.c_load from
customer,meter where customer.cust_id='0'"
Adodc1.Refresh
236
ELECTRICITY BILLING SYSTEM
DataGrid1.Columns(1).Caption = "NAME"
DataGrid1.Columns(2).Caption = "PHONE"
DataGrid1.Columns(4).Caption = "ADDRESS"
DataGrid1.Columns(6).Caption = "PIN"
DataGrid1.Columns(14).Caption = "LOAD"
cmd_print.Enabled = False
cmd_first.Enabled = False
cmd_last.Enabled = False
cmd_previous.Enabled = False
cmd_next.Enabled = False
txt_search.Text = ""
txt_search.SetFocus
End Sub
End If
237
ELECTRICITY BILLING SYSTEM
End Sub
Call rs
MonthView1.Visible = True
End If
End Sub
If KeyAscii = 13 Then
MonthView1.Visible = False
Exit Sub
End If
txt_search.Text = UCase(Trim(txt_search.Text))
Call rs
On Error GoTo X
Adodc1.Refresh
DataGrid1.Columns(1).Caption = "NAME"
DataGrid1.Columns(2).Caption = "PHONE"
238
ELECTRICITY BILLING SYSTEM
DataGrid1.Columns(4).Caption = "ADDRESS"
DataGrid1.Columns(6).Caption = "PIN"
DataGrid1.Columns(14).Caption = "LOAD"
Call value
Else
Call valid(KeyAscii)
End If
Exit Sub
X:
txt_cid.Text = ""
txt_name.Text = ""
txt_phno.Text = ""
txt_eid.Text = ""
txt_add.Text = ""
txt_dist.Text = ""
txt_pin.Text = ""
txt_sdiv.Text = ""
txt_mno.Text = ""
txt_phase.Text = ""
txt_cdate.Text = ""
239
ELECTRICITY BILLING SYSTEM
txt_ssec.Text = ""
txt_tarrif.Text = ""
txt_div.Text = ""
txt_cload.Text = ""
MonthView1.Visible = False
cmd_print.Enabled = False
cmd_first.Enabled = False
cmd_last.Enabled = False
cmd_previous.Enabled = False
cmd_next.Enabled = False
Adodc1.RecordSource = "select
customer.cust_id,customer.cust_name,customer.phone_no,customer.email_id,customer.cust
_add,customer.district,customer.p_code,customer.division,customer.sub_division,meter.m_
no,meter.phase,meter.conn_date,meter.supp_section,meter.tarrif,meter.c_load from
customer,meter where customer.cust_id='0'"
Adodc1.Refresh
DataGrid1.Columns(1).Caption = "NAME"
DataGrid1.Columns(2).Caption = "PHONE"
DataGrid1.Columns(4).Caption = "ADDRESS"
DataGrid1.Columns(6).Caption = "PIN"
240
ELECTRICITY BILLING SYSTEM
DataGrid1.Columns(14).Caption = "LOAD"
txt_search.Text = ""
txt_search.SetFocus
End Sub
txt_cid.Text = Adodc1.Recordset.Fields("cust_ID")
txt_div.Text = Adodc1.Recordset.Fields("DIVISION")
txt_name.Text = Adodc1.Recordset.Fields("cust_name")
txt_phno.Text = Adodc1.Recordset.Fields("PHONE_NO")
End If
txt_eid.Text = Adodc1.Recordset.Fields("EMAIL_ID")
End If
txt_add.Text = Adodc1.Recordset.Fields("cust_add")
txt_dist.Text = Adodc1.Recordset.Fields("DISTRICT")
txt_pin.Text = Adodc1.Recordset.Fields("P_CODE")
txt_mno.Text = Adodc1.Recordset.Fields("M_NO")
txt_cdate.Text = Adodc1.Recordset.Fields("CONN_DATE")
'txt_volt.Text = Adodc1.Recordset.Fields("SUPPLY_VOLTAGE")
txt_sdiv.Text = Adodc1.Recordset.Fields("SUB_DIVISION")
txt_phase.Text = Adodc1.Recordset.Fields("PHASE")
241
ELECTRICITY BILLING SYSTEM
txt_tarrif.Text = Adodc1.Recordset.Fields("TARRIF")
txt_cload.Text = Adodc1.Recordset.Fields("C_LOAD")
txt_ssec.Text = Adodc1.Recordset.Fields("SUPP_SECTION")
cmd_print.Enabled = True
cmd_first.Enabled = True
cmd_last.Enabled = True
cmd_previous.Enabled = True
cmd_next.Enabled = True
End Sub
conn
txt_search.MaxLength = 0
'txt_search.Locked = False
Adodc1.RecordSource = "select
customer.cust_id,customer.cust_name,customer.phone_no,customer.email_id,customer.cust
_add ,customer.district,customer.p_code,customer.division,customer.sub_division
,meter.m_no,meter.phase,meter.conn_date,meter.supp_section,meter.tarrif,meter.c_load
from customer,meter where customer.cust_id='" + txt_search.Text + "' and
customer.cust_id=meter.cust_id"
txt_search.MaxLength = 10
txt_search.MaxLength = 0
242
ELECTRICITY BILLING SYSTEM
where meter.cust_id=(select cust_id from meter where m_no=" + txt_search.Text + ") and
customer.cust_id=meter.cust_id"
txt_search.MaxLength = 8
txt_search.MaxLength = 0
txt_search.MaxLength = 30
txt_search.MaxLength = 0
txt_search.MaxLength = 25
txt_search.MaxLength = 0
txt_search.MaxLength = 15
243
ELECTRICITY BILLING SYSTEM
txt_search.MaxLength = 0
txt_search.MaxLength = 0
txt_search.MaxLength = 6
txt_search.MaxLength = 0
txt_search.MaxLength = 4
txt_search.MaxLength = 0
Adodc1.RecordSource = "select
customer.cust_id,customer.cust_name,customer.phone_no,customer.email_id,customer.cust
244
ELECTRICITY BILLING SYSTEM
_add,customer.district,customer.p_code,customer.division,customer.sub_division,meter.m_
no,meter.phase,meter.conn_date,meter.supp_section,meter.tarrif,meter.c_load from
customer,meter where customer.cust_id=meter.cust_id and customer.cust_id in (select
cust_id from customer where phase=" + txt_search.Text + ")"
txt_search.MaxLength = 1
Adodc1.RecordSource = "select
customer.cust_id,customer.cust_name,customer.phone_no,customer.email_id,customer.cust
_add,customer.district,customer.p_code,customer.division,customer.sub_division,meter.m_
no,meter.phase,meter.conn_date,meter.supp_section,meter.tarrif,meter.c_load from
customer,meter where customer.cust_id=meter.cust_id"
End If
End Sub
If (KeyAscii < 65 Or KeyAscii > 90 And KeyAscii < 97 Or KeyAscii > 122) And KeyAscii <>
8 Then
KeyAscii = 0
txt_search.SetFocus
End If
KeyAscii = 0
txt_search.SetFocus
245
ELECTRICITY BILLING SYSTEM
End If
If (KeyAscii < 65 Or KeyAscii > 90 And KeyAscii < 97 Or KeyAscii > 122) And KeyAscii <>
8 And KeyAscii <> 32 Then
KeyAscii = 0
txt_search.SetFocus
End If
If (KeyAscii < 65 Or KeyAscii > 90 And KeyAscii < 97 Or KeyAscii > 122) And (KeyAscii <
48 Or KeyAscii > 57) And KeyAscii <> 8 And KeyAscii <> 32 Then
KeyAscii = 0
txt_search.SetFocus
End If
If (KeyAscii < 65 Or KeyAscii > 90 And KeyAscii < 97 Or KeyAscii > 122) And (KeyAscii <
48 Or KeyAscii > 57) And KeyAscii <> 8 Then
KeyAscii = 0
txt_search.SetFocus
End If
End If
End Function
246
ELECTRICITY BILLING SYSTEM
Call Form_Load
txt_cid.Text = ""
txt_cid.SetFocus
End Sub
Unload Me
End Sub
If DataEnvironment1.rsCommand5.State = 1 Then
DataEnvironment1.rsCommand5.Close
End If
DataEnvironment1.Command5 txt_cid.Text
DataReport7.Show
End Sub
Adodc1.RecordSource = "select
customer.*,meter.m_no,phase,conn_date,supp_section,tarrif,c_load,c_date,c_reading,c_unit,b
_id,bill_month,b_date,gross_total,date1,charge1,date2,charge2,charge3,status from
247
ELECTRICITY BILLING SYSTEM
Adodc1.Refresh
DataGrid1.Columns(1).Caption = "NAME"
DataGrid1.Columns(2).Caption = "PHONE"
DataGrid1.Columns(4).Caption = "ADDRESS"
DataGrid1.Columns(6).Caption = "PIN"
DataGrid1.Columns(14).Caption = "LOAD"
DataGrid1.Columns(16).Caption = "READING"
DataGrid1.Columns(17).Caption = "UNIT"
DataGrid1.Columns(23).Caption = "CHARGE"
248
ELECTRICITY BILLING SYSTEM
DataGrid1.Columns(25).Caption = "CHARGE"
DataGrid1.Columns(26).Caption = "CHARGE"
DataGrid1.Columns(27).Caption = "STATUS"
cmd_print.Enabled = False
End Sub
If X = True Then
Unload Me
Else
Cancel = 1
End If
End Sub
If KeyAscii = 13 Then
txt_cid.Text = UCase(txt_cid.Text)
conn
Set r = c.Execute(sql)
249
ELECTRICITY BILLING SYSTEM
a=1
Adodc1.RecordSource = "select
customer.*,meter.m_no,phase,conn_date,supp_section,tarrif,c_load,c_date,c_reading,c_unit,b
_id,bill_month,b_date,gross_total,date1,charge1,date2,charge2,charge3,status from
measure,customer,meter,bill where customer.cust_id=meter.cust_id and
customer.cust_id=measure.cust_id and customer.cust_id=bill.cust_id and
customer.cust_id='" + txt_cid.Text + "' and to_char(measure.p_date,'MON
YYYY')=bill.bill_month"
Adodc1.Refresh
DataGrid1.Columns(1).Caption = "NAME"
DataGrid1.Columns(2).Caption = "PHONE"
DataGrid1.Columns(4).Caption = "ADDRESS"
DataGrid1.Columns(6).Caption = "PIN"
DataGrid1.Columns(14).Caption = "LOAD"
DataGrid1.Columns(16).Caption = "READING"
DataGrid1.Columns(17).Caption = "UNIT"
250
ELECTRICITY BILLING SYSTEM
DataGrid1.Columns(23).Caption = "CHARGE"
DataGrid1.Columns(25).Caption = "CHARGE"
DataGrid1.Columns(26).Caption = "CHARGE"
DataGrid1.Columns(27).Caption = "STATUS"
cmd_print.Enabled = True
cmd_print.SetFocus
Exit Sub
End If
r.MoveNext
Loop
If a <> 1 Then
Call cmd_clear_Click
End If
ElseIf (KeyAscii < 65 Or KeyAscii > 90 And KeyAscii < 97 Or KeyAscii > 122) And
(KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 Then
KeyAscii = 0
End If
End Sub
251
ELECTRICITY BILLING SYSTEM
Call txt_cid_KeyPress(13)
End Sub
252
ELECTRICITY BILLING SYSTEM
Unload Me
End Sub
DataReport3.Sections("section1").Controls("lbl_div").Caption = txt_div.Text
DataReport3.Sections("section1").Controls("lbl_sdiv").Caption = txt_sdiv.Text
DataReport3.Sections("section1").Controls("lbl_tarrif").Caption = txt_tarrif.Text
DataReport3.Sections("section1").Controls("lbl_phase").Caption = txt_phase.Text
DataReport3.Sections("section1").Controls("lbl_cload").Caption = txt_cload.Text
DataReport3.Sections("section1").Controls("lbl_cnm").Caption = txt_name.Text
DataReport3.Sections("section1").Controls("lbl_cadd").Caption = txt_add.Text
DataReport3.Sections("section1").Controls("lbl_rno").Caption = txt_rno.Text
DataReport3.Sections("section1").Controls("lbl_rdate").Caption = txt_date.Text
DataReport3.Sections("section1").Controls("lbl_ramt").Caption = txt_amt.Text
DataReport3.Sections("section1").Controls("lbl_enm").Caption = txt_ename.Text
DataReport3.Sections("section1").Controls("lbl_eadd").Caption = txt_eadd.Text
253
ELECTRICITY BILLING SYSTEM
DataReport3.Sections("section1").Controls("lbl_ephno").Caption = txt_ephone.Text
DataReport3.Sections("section1").Controls("lbl_pdate").Caption = txt_pdate.Text
DataReport3.Sections("section1").Controls("lbl_pread").Caption = txt_pread.Text
DataReport3.Sections("section1").Controls("lbl_punit").Caption = txt_punit.Text
DataReport3.Show
End Sub
txt_cid.Text = ""
txt_sdiv.Text = ""
txt_name.Text = ""
txt_add.Text = ""
txt_mno.Text = ""
txt_tarrif.Text = ""
txt_cload.Text = ""
txt_phase.Text = ""
txt_c1.Text = ""
txt_c2.Text = ""
txt_c3.Text = ""
txt_ename.Text = ""
txt_eadd.Text = ""
txt_ephone.Text = ""
txt_pdate.Text = ""
txt_pread.Text = ""
txt_punit.Text = ""
254
ELECTRICITY BILLING SYSTEM
txt_cdate.Text = ""
txt_cread.Text = ""
txt_cunit.Text = ""
txt_rno.Text = ""
txt_amt.Text = ""
txt_date.Text = ""
txt_ech.Text = ""
txt_dpscurr.Text = ""
txt_fxdch.Text = ""
txt_ed.Text = ""
txt_mrent.Text = ""
txt_tass.Text = ""
txt_rebate.Text = ""
txt_dues.Text = ""
txt_gtot.Text = ""
txt_bid.Text = ""
txt_bdate.Text = ""
txt_div.Text = ""
txt_eid.Text = ""
txt_sdiv.Text = ""
txt_ddate.Text = ""
Combo_bmonth.Clear
Call Form_Load
End Sub
255
ELECTRICITY BILLING SYSTEM
conn
Set r = c.Execute(sql)
txt_div.Text = r.Fields("DIVISION")
txt_sdiv.Text = r.Fields("sub_division")
txt_name.Text = r.Fields("CUST_NAME")
txt_add.Text = r.Fields("CUST_ADD")
txt_mno.Text = r.Fields("M_NO")
txt_tarrif.Text = r.Fields("tarrif")
txt_phase.Text = r.Fields("phase")
txt_cload.Text = r.Fields("c_load")
'===================================================
==========================
Set r = c.Execute(sql)
txt_pdate.Text = r.Fields("p_date")
256
ELECTRICITY BILLING SYSTEM
txt_pread.Text = r.Fields("p_reading")
txt_punit.Text = r.Fields("p_unit")
txt_cdate.Text = r.Fields("c_date")
txt_cread.Text = r.Fields("c_reading")
txt_cunit.Text = r.Fields("c_unit")
sql = "select * from employee where e_id='" & r.Fields("e_id") & "'"
Set r = c.Execute(sql)
txt_eid.Text = r.Fields("e_id")
txt_ename.Text = r.Fields("e_nm")
txt_eadd.Text = r.Fields("e_add")
txt_ephone.Text = r.Fields("e_phno")
index1 = Combo_bmonth.ListIndex - 1
sql = "select r_no,r_date,amount from payment where cust_id='" & txt_cid.Text & "' and
b_month='" & Combo_bmonth.List(index1) & "'"
On Error GoTo X
Set r = c.Execute(sql)
txt_rno.Text = r.Fields(0)
txt_date.Text = r.Fields(1)
txt_amt.Text = r.Fields(2)
GoTo next1
257
ELECTRICITY BILLING SYSTEM
X:
txt_rno.Text = "XXXXX"
txt_date.Text = "XXXXX"
txt_amt.Text = "XXXXX"
next1:
sql = "select * from calculate,bill where calculate.cust_id='" & txt_cid.Text & "' and
bill.cust_id='" & txt_cid.Text & "' and calculate.month='" & Combo_bmonth.Text & "' and
calculate.month=bill.bill_month and bill.bill_month='" & Combo_bmonth.Text & "'"
Set r = c.Execute(sql)
txt_dues.Text = r.Fields("dues")
txt_ech.Text = r.Fields("energy_charge")
txt_dpscurr.Text = r.Fields("dps_cmonth")
txt_fxdch.Text = r.Fields("fixed_charge")
txt_ed.Text = r.Fields("electricity_duty")
txt_mrent.Text = r.Fields("meter_rent")
txt_tass.Text = r.Fields("total_assesment")
txt_rebate.Text = r.Fields("rebait")
txt_gtot.Text = r.Fields("gross_total")
txt_bid.Text = r.Fields("b_id")
txt_bdate.Text = r.Fields("b_date")
txt_ddate.Text = r.Fields("date1")
lbl_d1.Caption = r.Fields("date1")
lbl_d2.Caption = r.Fields("date2")
258
ELECTRICITY BILLING SYSTEM
txt_c1.Text = r.Fields("charge1")
txt_c2.Text = r.Fields("charge2")
txt_c3.Text = r.Fields("charge3")
cmd_print.Enabled = True
End Sub
If KeyAscii = 13 Then
cmd_print.SetFocus
End If
End Sub
cmd_print.Enabled = False
End Sub
If X = True Then
Unload Me
Else
Cancel = 1
End If
259
ELECTRICITY BILLING SYSTEM
End Sub
If KeyAscii = 13 Then
txt_cid.Text = UCase(Trim(txt_cid.Text))
conn
sql = "select distinct cust_id from bill where cust_id='" + txt_cid.Text + "'"
On Error GoTo X
Set r = c.Execute(sql)
Set r = c.Execute(sql)
Combo_bmonth.Clear
Combo_bmonth.AddItem r.Fields(0)
r.MoveNext
Loop
Combo_bmonth.SetFocus
ElseIf (KeyAscii < 65 Or KeyAscii > 90 And KeyAscii < 97 Or KeyAscii > 122) And
(KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 Then
KeyAscii = 0
ElseIf (KeyAscii < 65 Or KeyAscii > 90 And KeyAscii < 97 Or KeyAscii > 122) And
(KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 And KeyAscii <> 32 Then
KeyAscii = 0
260
ELECTRICITY BILLING SYSTEM
End If
Exit Sub
X:
Call cmd_reset_Click
txt_cid.SetFocus
End Sub
261
ELECTRICITY BILLING SYSTEM
If KeyAscii = 13 Then
conn
sql = "select * from payment where cust_id='" + txt_cid.Text + "' and b_month='" +
cmbo_rmonth.Text + "'"
Set r = c.Execute(sql)
txt_bid.Text = r.Fields("b_id")
txt_bmonth.Text = r.Fields("b_month")
txt_mno.Text = r.Fields("m_no")
txt_tot.Text = r.Fields("tot_bill")
txt_amt.Text = r.Fields("amount")
txt_rno.Text = r.Fields("r_no")
txt_date.Text = r.Fields("r_date")
txt_dues.Text = r.Fields("dues")
txt_eid.Text = r.Fields("e_id")
Set r = c.Execute(sql)
txt_ename.Text = r.Fields("e_nm")
Set r = c.Execute(sql)
txt_cname.Text = r.Fields("cust_name")
txt_sdiv.Text = r.Fields("sub_division")
262
ELECTRICITY BILLING SYSTEM
txt_div.Text = r.Fields("division")
End If
End Sub
Unload Me
End Sub
If DataEnvironment1.rsCommand10.State = 1 Then
DataEnvironment1.rsCommand10.Close
DataReport8.Sections("section1").Controls("label18").Caption =
NoToWord(Val(txt_amt.Text))
DataReport8.Show
Call cmd_reset_Click
End Sub
cmbo_rmonth.Clear
txt_cname.Text = ""
txt_bid.Text = ""
txt_bmonth.Text = ""
txt_mno.Text = ""
263
ELECTRICITY BILLING SYSTEM
txt_sdiv.Text = ""
txt_tot.Text = ""
txt_rno.Text = ""
txt_date.Text = ""
txt_eid.Text = ""
txt_ename.Text = ""
txt_amt.Text = ""
txt_dues.Text = ""
txt_cid.Text = ""
txt_cid.SetFocus
End Sub
If X = True Then
Unload Me
Else
Cancel = 1
End If
End Sub
If KeyAscii = 13 Then
txt_cid.Text = UCase(Trim(txt_cid.Text))
conn
264
ELECTRICITY BILLING SYSTEM
sql = "select b_month from payment where cust_id='" + txt_cid.Text + "' "
Set r = c.Execute(sql)
txt_cid.Text = ""
Else
cmbo_rmonth.AddItem r.Fields(0)
r.MoveNext
Loop
cmbo_rmonth.SetFocus
End If
ElseIf (KeyAscii < 65 Or KeyAscii > 90 And KeyAscii < 97 Or KeyAscii > 122) And
(KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 Then
KeyAscii = 0
End If
End Sub
265
ELECTRICITY BILLING SYSTEM
Unload Me
End Sub
DataEnvironment1.rsCommand7.Open Adodc1.RecordSource
DataReport5.Show
DataEnvironment1.rsCommand8.Open Adodc1.RecordSource
DataReport6.Show
End If
End Sub
Adodc1.RecordSource = "select
customer.cust_id,customer.cust_name,customer.cust_add,customer.division,customer.sub_
division,meter.m_no,meter.conn_date,meter.tarrif,meter.phase,meter.c_load,bill.b_id,bill.b_
date,bill.bill_month,bill.gross_total,payment.r_no,payment.r_date,payment.amount,payment
.dues from customer,meter,bill,payment where customer.cust_id=meter.cust_id and
266
ELECTRICITY BILLING SYSTEM
Adodc1.Refresh
DataGrid1.Columns(1).Caption = "NAME"
DataGrid1.Columns(2).Caption = "ADDRESS"
DataGrid1.Columns(9).Caption = "LOAD"
DataGrid1.Columns(16).Caption = "AMOUNT"
DataGrid1.Columns(17).Caption = "DUES"
Adodc1.RecordSource = "select
customer.cust_id,customer.cust_name,customer.cust_add,customer.division,customer.sub_
division,meter.m_no,meter.conn_date,meter.tarrif,meter.phase,meter.c_load,bill.b_id,bill.b_
date,bill.bill_month,bill.gross_total from customer,meter,bill where
customer.cust_id=meter.cust_id and customer.cust_id in (select distinct bill.cust_id from
267
ELECTRICITY BILLING SYSTEM
Adodc1.Refresh
DataGrid1.Columns(1).Caption = "NAME"
DataGrid1.Columns(2).Caption = "ADDRESS"
DataGrid1.Columns(9).Caption = "LOAD"
End If
cmd_print.Enabled = True
Exit Sub
End Sub
Call Form_Load
txt_month.Text = ""
txt_month.SetFocus
268
ELECTRICITY BILLING SYSTEM
cmd_print.Enabled = False
End Sub
If KeyAscii = 13 Then
cmd_print.SetFocus
End If
End Sub
Adodc1.RecordSource = "select
customer.cust_id,customer.cust_name,customer.cust_add,customer.division,customer.sub_
division,meter.m_no,meter.conn_date,meter.tarrif,meter.phase,meter.c_load,bill.b_id,bill.b_
date,bill.bill_month,bill.gross_total from customer,meter,bill where
customer.cust_id=meter.cust_id and customer.cust_id='0'"
Adodc1.Refresh
DataGrid1.Columns(1).Caption = "NAME"
DataGrid1.Columns(2).Caption = "ADDRESS"
DataGrid1.Columns(9).Caption = "LOAD"
269
ELECTRICITY BILLING SYSTEM
Combo_status.Visible = False
cmd_print.Enabled = False
End Sub
If X = True Then
Unload Me
Else
Cancel = 1
End If
End Sub
Combo_status.Visible = False
End Sub
If KeyAscii = 13 Then
txt_month.Text = UCase(Trim(txt_month.Text))
conn
270
ELECTRICITY BILLING SYSTEM
Set r = c.Execute(sql)
Combo_status.Visible = True
Combo_status.ListIndex = -1
Combo_status.SetFocus
a=1
Exit Sub
End If
r.MoveNext
Loop
If a <> 1 Then
Call cmd_clear_Click
End If
Else
If (KeyAscii < 65 Or KeyAscii > 90 And KeyAscii < 97 Or KeyAscii > 122) And (KeyAscii <
48 Or KeyAscii > 57) And KeyAscii <> 8 And KeyAscii <> 32 Then
KeyAscii = 0
End If
End If
End Sub
271
ELECTRICITY BILLING SYSTEM
Call txt_month_KeyPress(13)
End Sub
272
ELECTRICITY BILLING SYSTEM
Set r = c.Execute(sql)
txt_upto100.Text = r.Fields("D_UPTO100")
txt_upto200.Text = r.Fields("d_upto200")
txt_upto300.Text = r.Fields("d_upto300")
txt_above300.Text = r.Fields("d_above300")
txt_dps.Text = r.Fields("d_dps")
txt_ed.Text = r.Fields("d_ed")
txt_fixed1.Text = r.Fields("d_fc")
txt_akw1.Text = r.Fields("d_akw")
txt_mrent1.Text = r.Fields("d_mrent")
txt_fixed3.Text = r.Fields("d_fc3")
txt_akw3.Text = r.Fields("d_akw3")
txt_mrent3.Text = r.Fields("d_mrent3")
txt_rebate.Text = r.Fields("d_rebate")
End Sub
273
ELECTRICITY BILLING SYSTEM
Set r = c.Execute(sql)
txt_upto100.Text = r.Fields("n_UPTO100")
txt_upto200.Text = r.Fields("n_upto200")
txt_above200.Text = r.Fields("n_above200")
txt_dps.Text = r.Fields("n_dps")
txt_ed.Text = r.Fields("n_ed")
txt_fixed1.Text = r.Fields("n_fc")
txt_akw1.Text = r.Fields("n_akw")
txt_mrent1.Text = r.Fields("n_mrent")
txt_fixed3.Text = r.Fields("n_fc3")
txt_akw3.Text = r.Fields("n_akw3")
txt_mrent3.Text = r.Fields("n_mrent3")
txt_rebate.Text = r.Fields("n_rebate")
End Sub
274
ELECTRICITY BILLING SYSTEM
OUTPUT
SCREEN
275
ELECTRICITY BILLING SYSTEM
ENERGY BILL
276
ELECTRICITY BILLING SYSTEM
PAYMENT RECEIPT
277
ELECTRICITY BILLING SYSTEM
278
ELECTRICITY BILLING SYSTEM
279
ELECTRICITY BILLING SYSTEM
280
ELECTRICITY BILLING SYSTEM
281
ELECTRICITY BILLING SYSTEM
282
ELECTRICITY BILLING SYSTEM
283
ELECTRICITY BILLING SYSTEM
TEST PROCEDURES
AND
IMPLEMENTATION
284
ELECTRICITY BILLING SYSTEM
INTRODUCTION
285
ELECTRICITY BILLING SYSTEM
286
ELECTRICITY BILLING SYSTEM
Testing principles
Testing should being “in the small” and progress toward testing
“in the large”.
287
ELECTRICITY BILLING SYSTEM
that can help to ensure the completeness of tests and provide the
highest likelihood for uncovering errors in software.
Any engineered product (and most other things) can be tested in one of
two ways:
While at the same time searching for errors in each function; (2)
knowing the internal
UNIT TESTING
INTEGRATION TESTING
288
ELECTRICITY BILLING SYSTEM
DATABASE TESTING
RECOVERY TESTING
FUNCTIONALITY TESTING
COMPATIBILITY TESTING
LOAD TESTING
SYSTEM TESTING
PERFORMANCE TESTING
USER ACCEPTANCE TESTING
289
ELECTRICITY BILLING SYSTEM
290
ELECTRICITY BILLING SYSTEM
In this system, the system was tested for the calculation matters
were the data provided for giving the right output or not. If wrong data
was provided then what it is throwing error or accepting.
291
ELECTRICITY BILLING SYSTEM
292
ELECTRICITY BILLING SYSTEM
2. Interface errors,
3. Errors in data structures or external database access,
4. Behavior or performance errors, and
5. Initialization and termination errors. By applying back-box
techniques, we derive a set of test cases that satisfy the following
criteria:
a. Test cases that reduce, by a count that is greater than
one, the number of additional test cases that must be designed to
achieve reasonable testing and
b. Test cases that tell us something about the presence or
absence of classes of errors, rather than an error associated only with
the specific test at hand.
293
ELECTRICITY BILLING SYSTEM
Black box testing for this system was done to check the internal
testing i.e, the system is working properly in each case or no. What kind
of errors are there in database design.
294
ELECTRICITY BILLING SYSTEM
Testing Process
The testing process can be shown as:
Levels of testing
Test Plan Test Procedures
Yes
Test Case
Specification
Is Error
Test Case Analysis
Uncovered?
No
Test Report
295
ELECTRICITY BILLING SYSTEM
MENU TREE
296
ELECTRICITY BILLING SYSTEM
Main Page
Change Fixed
Consumer Energy
Charge
Bill
Record
Consumer Receipt Create user
Meter Record
297
ELECTRICITY BILLING SYSTEM
USER MANUAL
298
ELECTRICITY BILLING SYSTEM
MENU DESCRIPTION
Entry Menu:
In this menu consumer record, meter record and
consumed unit is processed.
Meter Entry:
This is the second sub-module of this process. At this form
the consumed unit details used by the consumer in a single month is
entered. The previous reading date, unit consumed and reading like this
also current reading date, current unit consumed and reading. All this
information is saved into the respected database through the add
command. There is also one reset command which clear all the record
after processing of records and there is one exit button which executed
exit process to back from that form and comes to the main form.
299
ELECTRICITY BILLING SYSTEM
Edit Menu:
In this menu editing of consumer and meter entry
record is processed if any wrong information is entered.
Consumer Entry:
In this sub-menu there is a form on which consumer record
is updated. If any record is inputted wrong then we have the
facility to update the whole record. This process is completed by
an update button. This is the update command which update the
whole record and saved into the respected database. In this there
is reset button which clear all the record after the updating of
right record and there is exit button which performs the exit from
the form.
Meter Entry:
In tis sub-menu there is form on which the consumer
consumed unit is updated through the update command. There is
an update button which modifies the consumed unit if entry is
wrong. There is a reset button which clears all the record after
updating. There is an exit button which performs exit process the
form.
300
ELECTRICITY BILLING SYSTEM
Bill Menu:
In this menu there is a form which is known as bill form. In
this billing process is performed.
Energy Bill:
In this sub-menu all consumer billing is performed
month by month .In this there is a generate bill command is
mentioned through which the bill of all consumer is generated.
There is a save command through which all the bill is saved into
their respected database. There is a print command button which
prints the entire consumer bill at a time. At this form there is a
first command button which shows the whole record of all
consumers, there is a last and previous button which skip the
record next and back, there is a last command button which
shows the last consumer record. In this there is a reset button
which clears all the data from the form and there is an exit button
which performs the exit process from the form.
Payment Menu:
In this menu the payment of consumer is processed.
Receipt:
In tis sub-menu the receipt of consumer who
pays the bill is generated. At this form the payment process
is performed and saved in the respected database through
301
ELECTRICITY BILLING SYSTEM
View Menu:
In this menu we can search and view all consumer records,
meter details, bill details, receipt details and consumer status.
Consumer Record:
In this sub-menu we can view consumer records on
different fields such as consumer id, name, sub-division, tariff,
phase, connection date, month, and year. At this form we enter
required data and all the data is showed on the form. The whole
record is printed through the print command button. There is first
command button which shows the first record. There is next and
previous button command which forward and backward the
record. There is last command button which shows the last
consumer record.There is reset command button which clear all
the data after processing and there is an exit button which holds
the performance of go back from the form.
302
ELECTRICITY BILLING SYSTEM
Bill Detail:
In this sub-menu the bill details of consumer is showed on
the form. The bill of all previous month shows at the form. There
is print command button which print the entire previous bill in a
well-knit format.There is reset command button which clear all
the data after processing and there is an exit button by which user
comes out from that form.
Receipt Detail:
In this sub-menu the previous receipt which is generated at
previous and if consumer wants the previous receipt of his
payment then the through the print command button the receipt
is printed. In this there is a reset command button which performs
the clear all record from the form and there is an exit button
which take out the consumer from the form.
Status:
In this sub-menu the current status of consumer is
shown in the data grid. The entire consumer record that paid the
bill and the consumer who has not paid the bill is showed. The
print command button prints all the consumer record. The clear
command button clears all the data grid record.
303
ELECTRICITY BILLING SYSTEM
Meter Detail:
In this sub-menu the previous consumed unit of
consumer is shown in the data grid.In it at a time a particular
consumer entire consumed unit will be shown with all its
records.The print command button prints the record.The clear
command button clears all the data grid record.
Administrator:
Handling databases is in the power of the admin person
only. It performs general and special purpose both type of work.
Create user:
In this sub module the new user account is created by
the administrator and the user id and password is given to the
user to use it. The add command button is used to save all the
data record in the database. The reset command button is used to
clear all the data after processing and exit command button is
used to come back from that form
304
ELECTRICITY BILLING SYSTEM
305
ELECTRICITY BILLING SYSTEM
Analysis
Design
Coding
Testing
Implement
306
ELECTRICITY BILLING SYSTEM
307
ELECTRICITY BILLING SYSTEM
PROPOSED
ENHANCEMENTS
308
ELECTRICITY BILLING SYSTEM
FUTURE SCOPE
The scope of the project includes that what all future enhancements
can be done in this system to make it more feasible to use
309
ELECTRICITY BILLING SYSTEM
3. Graphs could have been added in order to get the records more
clearly.
310
ELECTRICITY BILLING SYSTEM
CONCLUSION
311
ELECTRICITY BILLING SYSTEM
BIBLIOGRAPHY
BOOKS REFERRED
WEB LINK
http://www.nbpdcl.com
312