1.
ABSTRACT
The purpose of the project is to present the requirement of the Computerization of
FEES MANAGEMENT System. The project thus calculates the Feess automatically. It
does almost every work which is related to automatic FEES MANAGEMENT
connection system via- new connection, customer record modification, viewing
customer records & all works related to rate of bills, no.of calls in addition to bill
calculation and bill generation. “FEES MANAGEMENT System” is developed as per
seeing the increasing requirement to speed up the work and incorporate a new work
culture. Thus a new software has been proposed to reduce manual work, improving
work efficiency, saving time and to provide greater flexibility and user-friendliness as
the system previously followed was totally manual one with lots of errors.
1
2. INTRODUCTION
OBJECTIVE OF THE PROJECT
The main objective while implementing the project FEES MANAGEMENT
System were to minimize the work and at the same time increase the
speed of the work done.
This new system is built with the following objective:
1. Information retrieval will become easy.
2. Maintenance of database as well as overall project will become easy.
3. Security measure will be adopted, by maintaining the login of username
and the password.
4. Data redundancy will be greatly reduced because this new system is built using
Visual Basic .NET as front-end. It entails looking into duplication of efforts,
bottlenecks and inefficient existing procedures.
2
EXISTING SYSTEM
The existing system was a manual one. Whatever be the process involved in
the system were done through register (files). There were lots of complexities
involved in the system. When any customer takes new connections then
separate files were maintained. Updating of data was very tedious job. It was
not easy to do several administrative works like managing rates of calls,
addition or modification of metered calls & customer entries.
DRAWBACKS OF EXISTING SYSTEM
In the existing system all the office works was done manually. The manual work
processes were time consuming and hence slow. Following are the main
drawbacks of the existing system:
The existing system is totally manual thus there are chances of error in
processing.
The basic and major drawbacks in the existing system are the speed of
retrieval of data from files, which leads to delay.
Maintenance of voluminous data is very cumbersome and laborious job.
The manual jobs such as calculation are more error prone.
There are plenty of chances of duplicity of data and information.
Updating is very tedious job.
There is no central database from where one can get different statistical
data at one place.
The above facts, figures and drawbacks clearly indicate that there is need for
computerization and thus decided to computerize the “FEES MANAGEMENT
SYSTEM”. Since the existing system was totally manual which has lots of
complexities, shortcomings in itself and all the data was being stored in
registers, files etc thus to overcome the limitation of the existing system, the
3
new computerized system was needed, so that information can be provided to
the user more quickly, easily and more accurately.
PROPOSED SYSTEM
The new system titled “FEES MANAGEMENT SYSTEM” was hence proposed
to remove all the drawbacks discussed above.
Information is a vital ingredient for the operation and
management of any organization. Thus any system should have the ability to
provide error free filtered information after processing the required data. This
system has been taken up with a view for developing a more sophisticated
system that can be easily handled by any kind of users. The proposed system
aims at efficient and timely information for decision-making, integrate with other
functions, and reduce redundant work.
Important features of this proposed system are:
Consistent user interface with high economic features built into it.
System design in modular and structured way so as to make the integration
with other subsystems easier.
User has complete control as it provides and accept only appropriate and
valid data.
User-friendly error messages are provided wherever necessary.
Addition, deletion, modification of records as when needed.
Providing connections to new customers.
Bill generation for customers.
OBJECTIVES OF THE PROPOSED SYSTEM
To reduce workload of staff.
To reduce the delay in processing time.
To reduce the delay in bill generation.
To provide the user-friendliness in all possible ways.
4
To provide greater flexibility.
Make maintenance changes easy.
To store data in a centralized location to reduce redundancy and increase
consistency.
5
SOFTWARE & HARDWARE INFORMATION
REQUIREMENT ANALYSIS
Now the time is to change the computer is become not so costly. So for
doing and performing the right system we have to reducing the current system
and we have to make new system. As we have decided to develop a new
system now it is a time to determine the new requirements for the new system.
As the user is the most important part of any system it is required to find the
users requirement to develop a user friendly system rather than having develop
a developer friendly system.
The outputs required by the user that must be included into the proposed
system are as follows. First we require all date have the security. Second the
work for the particular user must be personalized. Third one is the customer
information must be entered on such a way that it is easier for user to
understand. Fourth is daily reports and monthly reports are printed. Fifth one is
bills are printed as in required order. The user must be provided ease if he
wants to switch from one application to other at a time.
HARDWARE REQUIREMENTS
Processor : Intel Pentium IV or more
RAM : 1 GB RAM
Hard Disk : 250GB or more
SOFTWARE REQUIREMENTS
Operating system server : Windows 7 or later
Database Server : MS SQL
Code Behind : VB.NET
6
DATABASE STRUCTURE
Area
Slno Field name Data type Size Constraint Description
1 Acode Number 4 Primary key Areacode
2 Aname Varchar 20 Areaname
3 Description Varchar 40 Description
Transformer
Slno Field name Data type Size Constraint Description
1 transid Number 4 Primary key tranformercode
2 transname varchar 20 Transformer name
3 areacode Number 40 Foreign Key Areacode
4 Location Varchar 40 Location
5 Maxload Number 5 Maximum Load
Tariff
Slno Field name Data type Size Constraint Description
1 Tname Varchar 4 Primary key Tariif name
2 Trate Number 5 Tariff Rate
3 fc Number 5 Fixed Charge
4 ec Number 5 Energy charge
5 Dc Number 5 Duty charge
7
Login
Slno Field name Data type Size Constraint Description
1 Username Varchar 10 Primary key Username
2 Password Varchar 15 Password
TBilling
Sln Field name Data Size Constraint Description
o type
1 Billno Number 4 Primary Billno
key
2 Accountnumber Number 20 Account No
3 Date Date 8 Date
4 Presreading Number 5 Present
Reading
5 Prevreading Number 5 Previous
Reading
6 Penalty Number 5 Penalty
7 Others Number 6 Other
Charge
8 Consumption Number 6 Consumption
9 Paymentwithnodeduction Number 6 Total amount
10 Paymentwithdeduction Number 6 Netbill
12 Status Varchar 10 Status
Customer
Slno Field name Data Size Constraint Description
8
type
1 cid Number 4 Primary key Customer ID
2 Accno Varchar 20 AccountNo
3 Fname Varchar 20 First name
4 Lname Varchar 20 Last name
5 Mi Varchar 5 Middle Initial
6 Brand Varchar 40 Brandname
7 Meternumber Varchar 15 Meternumber
8 Address Varchar 40 Address
9 Acode Number 5 Foreign key Area Code
10 Typeofconnection Varchar 10 Connection
Type
11 Confee Number 10 Connection fee
12 Depositfee Number 10 Deposit fee
13 Transformer Varchar 10 Foreign key Transformer
14 Status Varchar 10 Status
9
SOFTWARE DESCRIPTION
VISUAL BASIC.NET
VB.Net is a simple, modern, object-oriented computer programming language
developed by Microsoft to combine the power of .NET Framework and the
common language runtime with the productivity benefits that are the hallmark of
Visual Basic.
Visual Basic .NET (VB.NET) is an object-oriented computer programming
language implemented on the .NET Framework. Although it is an evolution of
classic Visual Basic language, it is not backwards-compatible with VB6, and
any code written in the old version does not compile under VB.NET.
Like all other .NET languages, VB.NET has complete support for object-
oriented concepts. Everything in VB.NET is an object, including all of the
primitive types (Short, Integer, Long, String, Boolean, etc.) and user-defined
types, events, and even assemblies. All objects inherits from the base class
Object.
VB.NET is implemented by Microsoft's .NET framework. Therefore, it has full
access to all the libraries in the .Net Framework. It's also possible to run
VB.NET programs on Mono, the open-source alternative to .NET, not only
under Windows, but even Linux or Mac OSX.
The following reasons make VB.Net a widely used professional language:
Modern, general purpose.
Object oriented.
Component oriented.
Easy to learn.
10
Structured language.
It produces efficient programs.
It can be compiled on a variety of computer platforms.
Part of .Net Framework.
Strong Programming Features VB.Net
VB.Net has numerous strong programming features that make it endearing to
multitude of programmers worldwide. Let us mention some of these features:
Boolean Conditions
Automatic Garbage Collection
Standard Library
Assembly Versioning
Properties and Events
Delegates and Events Management
Easy-to-use Generics
Indexers
Conditional Compilation
Simple Multithreading
The .Net Framework
The .Net framework is a revolutionary platform that helps you to write the
following types of applications:
Windows applications
Web applications
Web services
The .Net framework applications are multi-platform applications. The
framework has been designed in such a way that it can be used from any of
the following languages: Visual Basic, C#, C++, Jscript, and COBOL, etc.
All these languages can access the framework as well as communicate with
each other.
11
The .Net framework consists of an enormous library of codes used by the client
languages like VB.Net. These languages use object-oriented methodology.
Following are some of the components of the .Net framework:
Common Language Runtime (CLR)
The .Net Framework Class Library
Common Language Specification
Common Type System
Metadata and Assemblies
Windows Forms
ASP.Net and ASP.Net AJAX
ADO.Net
Windows Workflow Foundation (WF)
Windows Presentation Foundation
Windows Communication Foundation (WCF)
LINQ
INTEGRATED DEVELOPMENT ENVIRONMENT (IDE) FOR VB.NET
Microsoft provides the following development tools for VB.Net programming:
Visual Studio 2010 (VS)
Visual Basic 2010 Express (VBE)
Visual Web Developer
The last two are free. Using these tools, you can write all kinds of VB.Net
programs from simple command-line applications to more complex
applications. Visual Basic Express and Visual Web Developer Express edition
are trimmed down versions of Visual Studio and has the same look and feel.
They retain most features of Visual Studio.
MICROSOFT SQL SERVER
Microsoft SQL Server is a relational database management system developed
by Microsoft. As a database server, it is a software product with the primary
12
function of storing and retrieving data as requested by other software
applications which may run either on the same computer or on another
computer across a network.
Microsoft markets at least a dozen different editions of Microsoft SQL Server,
aimed at different audiences and for workloads ranging from small single-
machine applications to large Internet-facing applications with many concurrent
users.
Database Management Tools
SQL Server comes with a number of tools to help you with your database
administration and programming tasks.
Some typical database administration and programming tasks could include:
Create & maintain databases
Create & maintain tables
Create & maintain other database objects such as stored procedures, views,
etc
Create & maintain and schedule data backups
Replication (eg, create a copy of the database)
Create & maintain users, roles, etc
Optimization tasks
These are some of many tasks that a database administrator (DBA) might need
to perform. SQL Server provides the means for performing these tasks.
Server Database Systems
SQL Server is a server database system, as opposed to a desktop system such
as MS Access.
Server based database systems are designed to run on a central server - or
servers - so that multiple users can access the same data simultaneously. The
users normally access the database through an application.
13
For example, a website could store all its content in a database. Whenever a
visitor views an article, they are retrieving data from the database. At any given
moment, a website could be serving up hundreds, or even thousands of articles
to its website visitors. At the same time, other users could be updating their
personal profile in the members' area, or subscribing to a newsletter, or
anything else that website users do. So users are both reading and updating
the database simultaneously. You need a good, robust database system for
this type of usage. After all, you wouldn't want your database to lock up
because too many users are trying to access it. Or worse still, you wouldn't
want corrupt data in your database due to wires getting crossed somewhere
along the way.
Generally, it's the website application that provides the functionality to these
visitors. It is the database that stores the data and makes it available. However,
SQL Server does include some useful features that can assist the application in
providing its functionality.
14
SCREEN SHOT
Login From
New Subscriber Form
15
Customer List
Bill Form
16
Payment Form
Bill Report
17
Bill collector form
Transformer Form
18
CODE DESIGN
Customer Form
Imports System.Data.SqlClient
Public Class frmNewAccounts
Dim cmd As SqlCommand
Dim cnn As SqlConnection
Dim c As New Class1
Dim querry As String
Dim sqlstr As String
Dim ssql As String
Public temp As String
Dim myData As SqlDataReader
Private Sub cmdAdd_Click_1(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdAdd.Click
If txtAccount.Text <> "" And txtLastName.Text <> "" And
txtFirstName.Text <> "" And txtMI.Text <> "" And txtAddress.Text <> "" Then
querry = "Select * from TAccount Where AccountNumber = '" &
txtAccount.Text & "'"
myData = GetData(querry)
If Not myData.NextResult Then
If txtBrand.Text = "" Then
txtBrand.Text = "-"
End If
If txtMeterNumber.Text = "" Then
txtMeterNumber.Text = CStr(0)
End If
If txtType.Text = "" Then
txtType.Text = "-"
End If
Dim full As String = txtFirstName.Text + txtMI.Text +
txtLastName.Text
sqlstr = "insert into
TAccount(AccountNumber,LastName,FirstName,MiddleInitial,Address,Brand,MeterNumbe
r,Typeofconnection,FullName,status,areacode,transformer,depositfee,confee)
values('" & txtAccount.Text & "','" & txtLastName.Text & "','" &
txtFirstName.Text & "','" & txtMI.Text & "','" & txtAddress.Text & "','" &
txtBrand.Text & "','" & txtMeterNumber.Text & "','" & cmbtype.Text & "','" &
txtTemp.Text & "','" & txtType.Text & "','" & cmbarea.Text & " ', '" &
cmbtransformer.Text & " ', " & txtdepfee.Text & ", " & txtconfee.Text & ")"
Try
c.Exec(sqlstr)
MsgBox("New Consumer information successfully saved",
MsgBoxStyle.Information, "KSEB Billing")
Catch ex As Exception
MsgBox(ex.Message)
End Try
'MsgBox("New account has been successfully added.",
MsgBoxStyle.Information, Me.Text)
19
Call clearTxt()
txtAccount.Focus()
System.Windows.Forms.SendKeys.Send("{home}+{end}")
Else
MsgBox("Account Number: " & txtAccount.Text & " already
exists.", MsgBoxStyle.Information, Me.Text)
End If
Else
MsgBox("Fill up all the required fields.", MsgBoxStyle.Information,
Me.Text)
End If
End Sub
Private Sub clearTxt()
For Each txt In Me.Controls
If TypeOf txt Is System.Windows.Forms.TextBox Then
txt.Text = ""
End If
Next txt
txtAccount.Mask = ""
txtAccount.Text = ""
txtAccount.Mask = "##-####"
txtAccount.Focus()
txtLastName.Text = ""
txtFirstName.Text = ""
txtMI.Text = ""
txtAddress.Text = ""
txtBrand.Text = ""
txtconfee.Text = ""
txtdepfee.Text = ""
txtMeterNumber.Text = ""
txtType.Text = ""
System.Windows.Forms.SendKeys.Send("{home}+{end}")
End Sub
Private Sub cmdClose_Click_1(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdClose.Click
Me.Hide()
End Sub
Private Sub cmdRefresh_Click_1(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdRefresh.Click
lv1.Items.Clear()
txtFind.Text = ""
sqlstr = "Select * from TAccount"
FillListView(lv1, GetData(sqlstr))
End Sub
Private Sub cmdCancel_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdCancel.Click
Call clearTxt()
End Sub
Private Sub cmdEdit_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdEdit.Click
If txtAccount.Text <> " " Then
20
querry = "Select * from TAccount WHERE AccountNumber = '" &
txtAccount.Text & "'"
myData = GetData(querry)
If myData.HasRows = True Then
Call updateRec()
ssql = "Select * from TAccount"
lv1.Items.Clear()
FillListView(lv1, GetData(ssql))
ssql = "Select * from TBilling WHERE AccountNumber = '" & temp &
"'"
myData = GetData(querry)
MsgBox("Record successfully edited.", MsgBoxStyle.Information,
Me.Text)
Call clearTxt()
Else
MsgBox("Account Number: " & txtAccount.Text & " does not
exists.", MsgBoxStyle.Information, Me.Text)
End If
Exit Sub
End If
End Sub
Private Sub updateRec()
If txtBrand.Text = "" Then
txtBrand.Text = "-"
End If
If txtMeterNumber.Text = "" Then
txtMeterNumber.Text = CStr(0)
End If
If txtType.Text = "" Then
txtType.Text = "-"
End If
Try
sqlstr = "Update TAccount Set AccountNumber = '" & txtAccount.Text
& "' ,Lastname = '" & txtLastName.Text & "' ,Firstname = '" & txtFirstName.Text
& "' ,MiddleInitial = '" & txtMI.Text & "',Address = '" & txtAddress.Text &
"' ,Brand = '" & txtBrand.Text & "' ,MeterNumber = " & txtMeterNumber.Text &
" ,TypeOfConnection = '" & cmbtype.Text & "' ,FullName = '" & txtTemp.Text &
"',areacode = '" & cmbarea.Text & "' ,Transformer= '" & cmbtransformer.Text & "'
,depositfee = " & txtdepfee.Text & " , confee = " & txtconfee.Text & " WHERE
AccountNumber = '" & txtAccount.Text & "'"
c.Exec(sqlstr)
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Private Sub frmNewAccounts_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
cnn = New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=|
DataDirectory|\ebill.mdf;Integrated Security=True;User Instance=True")
cnn.Open()
FillCombobox(cmbarea, "SELECT * FROM area", "area", "areacode",
"areacode")
FillCombobox(cmbtransformer, "SELECT * FROM transfomer", "transname",
"transname", "transname")
FillCombobox(cmbtype, "SELECT * FROM tariff", "tariff", "tname",
"tname")
21
Call clearTxt()
sqlstr = "Select * from TAccount"
FillListView(lv1, GetData(sqlstr))
End Sub
Private Sub cmdSearch_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdSearch.Click
sqlstr = "select * from TAccount where Firstname='" & txtFind.Text & "'"
Dim mydata As SqlDataReader
mydata = GetData(sqlstr)
Do While mydata.Read
txtAccount.Text = mydata.GetValue(0)
txtFirstName.Text = mydata.GetValue(2)
txtLastName.Text = mydata.GetValue(1)
txtMI.Text = mydata.GetValue(3)
txtAddress.Text = mydata.GetValue(4)
txtBrand.Text = mydata.GetValue(5)
txtMeterNumber.Text = mydata.GetValue(6)
cmbtype.Text = mydata.GetValue(7)
cmbarea.Text = mydata.GetValue(10)
cmbtransformer.Text = mydata.GetValue(11)
txtdepfee.Text = mydata.GetValue(12)
txtconfee.Text = mydata.GetValue(13)
Loop
End Sub
Private Sub TabPage1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles TabPage1.Click
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim cmddelete As SqlCommand
Dim str As String
If txtAccount.Text <> "" Then
str = "Delete from TAccount where AccountNumber=@AccountNumber"
cmddelete = New SqlCommand(str, cnn)
cmddelete.Parameters.Add("AccountNumber", SqlDbType.NVarChar).Value
= txtAccount.Text
cmddelete.ExecuteNonQuery()
MsgBox("delete succesfully")
Else
MsgBox(" deletion failed")
End If
End Sub
Private Sub txtconfee_KeyPress(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles txtconfee.KeyPress
If Char.IsLetter(e.KeyChar) Or Char.IsSeparator(e.KeyChar) Then
MessageBox.Show("Only numeric value is accepted", "STOP",
MessageBoxButtons.OK, MessageBoxIcon.Stop)
e.Handled = True
End If
End Sub
Private Sub txtdepfee_KeyPress(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles txtdepfee.KeyPress
22
If Char.IsLetter(e.KeyChar) Or Char.IsSeparator(e.KeyChar) Then
MessageBox.Show("Only numeric value is accepted", "STOP",
MessageBoxButtons.OK, MessageBoxIcon.Stop)
e.Handled = True
End If
End Sub
Private Sub txtFirstName_KeyPress(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles txtFirstName.KeyPress
If Char.IsNumber(e.KeyChar) Or Char.IsPunctuation(e.KeyChar) Or
Char.IsDigit(e.KeyChar) Then
MessageBox.Show("Only character type is accepted", "STOP",
MessageBoxButtons.OK, MessageBoxIcon.Stop)
e.Handled = True
End If
End Sub
Private Sub txtMI_KeyPress(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles txtMI.KeyPress
If Char.IsNumber(e.KeyChar) Or Char.IsPunctuation(e.KeyChar) Or
Char.IsDigit(e.KeyChar) Then
MessageBox.Show("Only character type is accepted", "STOP",
MessageBoxButtons.OK, MessageBoxIcon.Stop)
e.Handled = True
End If
End Sub
Private Sub txtLastName_KeyPress(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles txtLastName.KeyPress
If Char.IsNumber(e.KeyChar) Or Char.IsPunctuation(e.KeyChar) Or
Char.IsDigit(e.KeyChar) Then
MessageBox.Show("Only character type is accepted", "STOP",
MessageBoxButtons.OK, MessageBoxIcon.Stop)
e.Handled = True
End If
End Sub
Private Sub txtAddress_KeyPress(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles txtAddress.KeyPress
If Char.IsNumber(e.KeyChar) Or Char.IsPunctuation(e.KeyChar) Or
Char.IsDigit(e.KeyChar) Then
MessageBox.Show("Only character type is accepted", "STOP",
MessageBoxButtons.OK, MessageBoxIcon.Stop)
e.Handled = True
End If
End Sub
'Private Sub incr_acc()
' Dim Next_acc As Integer
' Dim max_acc As Object
' Dim str As String = "select max(AccountNumber) from TAccount"
' cmd = New SqlCommand(str, cnn)
' max_acc = cmd.ExecuteScalar
' If IsDBNull(max_acc) Then
' Next_acc = 85642110
' Else
' Next_acc = Int(max_acc) + 1
' End If
' txtAccount.Text = Next_acc
23
'End Sub
Private Sub cmbtype_SelectedIndexChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles cmbtype.SelectedIndexChanged
cmd = New SqlCommand("select * from tariff where tname='" & cmbtype.Text
& "'", cnn)
Dim dr As SqlDataReader = cmd.ExecuteReader()
While dr.Read
cmbtype.Text = dr.GetValue(0).ToString
txtconfee.Text = dr.GetValue(2).ToString
txtdepfee.Text = dr.GetValue(3).ToString
End While
dr.Close()
End Sub
End Class
Billing Form
Imports System.Data.SqlClient
Public Class frmBillingform
Dim c As New Class1
Dim sSql As String
Dim reply As Boolean
Dim cnn As SqlConnection
Private Sub cmdAdd_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdAdd.Click
If cmdAdd.Text = "Add" Then
Panel1.Enabled = True
txtAccount.Enabled = True
' txtAccount.SetFocus()
Frame2.Enabled = True
Frame3.Enabled = True
cmdSave.Enabled = True
cmdAdd.Text = "Cancel"
Dim billno As String
billno = GetFieldValue("select * from TBilling ", "BillNo")
Dim ps1 As String
ps1 = (billno.Substring(0, 3).ToString)
ps1 = Val(ps1) + 1
txtBillno.Text = ps1 & Month(Now()) & Year(Now())
ElseIf cmdAdd.Text = "Cancel" Then
Panel1.Enabled = False
txtAccount.Enabled = False
cmdSave.Enabled = False
cmdAdd.Text = "Add"
Call clear1()
Call clear2()
24
End If
Dim Query As String
Query = GetFieldValue("select * from TBilling where AccountNumber= '" &
cmbAccount.Text & "'", "PresReading")
Dim ps As String
ps = Query
'If Not Query Then
' txtPrevReading.Text = 0
'Else
txtPrevReading.Text = Query
'End If
End Sub
Private Sub clear1()
txtLastName.Text = ""
txtFirstName.Text = ""
txtMI.Text = ""
txtAddress.Text = ""
txtBrand.Text = ""
txtMeterNumber.Text = ""
txtType.Text = ""
End Sub
Private Sub clear2()
txtAccount.Mask = ""
txtAccount.Text = ""
txtAccount.Mask = "##-####"
' txtDate.Text = ""
txtPresReading.Text = ""
txtPrevReading.Text = ""
txtCum.Text = ""
txtPayment.Text = ""
End Sub
'Private Sub incr_bill()
' Dim cmd As New SqlCommand
' Dim Next_bno As Integer
' Dim max_bno As Object
' Dim str As String = "select max(BillNo) from TBilling"
' cmd = New SqlCommand(str, cnn)
' max_bno = cmd.ExecuteScalar
' If IsDBNull(max_bno) Then
' Next_bno = 102654
' Else
' Next_bno = Int(max_bno) + 1
' End If
' txtBillno.Text = Next_bno
'End Sub
Private Sub cmdSave_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdSave.Click
If txtPresReading.Text <> "" And txtPrevReading.Text <> "" And
txtDate.Text <> "" And IsDate(txtDate.Text) = True Then
Dim Query As String
Query = "insert into
TBilling(BillNO,AccountNumber,Date,PresReading,prevReading,Penalty,Others,Consup
tion,Paymentwithnodeduction,Paymentwithdeduction,Status) values ('" &
25
txtBillno.Text & "','" & cmbAccount.Text & "' ,'" & txtDate.Text & "' ,' " &
txtPresReading.Text & "' ,' " & txtPrevReading.Text & "' ,'" &
txtPrevReading.Text & "','" & txtPrevReading.Text & "', '" & txtCuM.Text &
"' ,'" & txtPayment.Text & "' ,'" & txtPayment.Text & "','" & txtstatus.Text &
"')"
Try
c.Exec(Query)
MsgBox("Bill Information successfully saved",
MsgBoxStyle.Information, "KSEB Billing")
Catch ex As Exception
MsgBox(ex.Message + "hai")
End Try
cmdAdd.Text = "&Add"
cmdSave.Enabled = False
Call clear1()
Call clear2()
reply = MsgBox("Record saved. Add another?", vbQuestion + vbYesNo)
If reply = vbYes Then
End If
Exit Sub
Else
MsgBox("Account Number: " & txtAccount.Text & " already has a record
for this month (" & txtDate.Text & ").", vbInformation)
End If
If txtDate.Text = "" Or IsDate(txtDate.Text) = False Then
MsgBox("Please enter date. (Month / Year)", vbInformation)
Exit Sub
End If
If txtPresReading.Text = "" Then
MsgBox("Please enter Present Reading.", vbInformation)
' txtPresReading.s
Exit Sub
End If
If txtPrevReading.Text = "" Then
MsgBox("Please enter Previous Reading.", vbInformation)
'txtPrevReading.SetFocus()
Exit Sub
End If
If Val(txtCuM.Text) < 0 Then
MsgBox("Present Reading must be greater than Previous Reading.",
vbInformation)
' txtPresReading.SetFocus()
Exit Sub
End If
sSql = "SELECT TAccount.Address, TAccount.Brand, TAccount.MeterNumber,
TAccount.Typeofconnection, TAccount.FullName, TBilling.Status,
TBilling.Paymentwithdeduction, TBilling.Paymentwithnodeduction,
TBilling.Consuption, TBilling.Others, TBilling.Penalty, TBilling.PrevReading,
TBilling.PresReading, TBilling.Date FROM TAccount INNER JOIN TBilling
ON TAccount.AccountNumber = TBilling.AccountNumber"
FillListView(lv1, GetData(sSql))
End Sub
Private Sub cmdclose_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdclose.Click
26
Me.Hide()
End Sub
Private Sub cmdbrowse_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdbrowse.Click
For Each f As Form In Application.OpenForms
If TypeOf f Is frmbrowse Then
f.Activate()
Return
End If
Next
Dim childfrmbilling As New frmbrowse()
' Set the Parent Form of the Child window.
childfrmbilling.MdiParent = MDIParent1
' Display the new form.
childfrmbilling.Show()
End Sub
Private Sub frmBillingform_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
sSql = "SELECT * from TBilling"
FillListView(lv1, GetData(sSql))
FillCombobox(cmbAccount, "SELECT * FROM TAccount", "TAccount",
"AccountNumber", "AccountNumber")
cnn = New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=|
DataDirectory|\ebill.mdf;Integrated Security=True;User Instance=True ")
cnn.Open()
End Sub
Private Sub cmbAccount_SelectedIndexChanged(sender As System.Object, e As
System.EventArgs) Handles cmbAccount.SelectedIndexChanged
Dim myData As SqlDataReader
Dim ssql As String
ssql = "select * from Taccount where Accountnumber='" & cmbAccount.Text
& "'"
myData = GetData(sSql)
Do While myData.Read
txtLastName.Text = IIf(myData.IsDBNull(0), "", myData.GetValue(1))
txtFirstName.Text = IIf(myData.IsDBNull(0), "", myData.GetValue(2))
txtMI.Text = IIf(myData.IsDBNull(0), "", myData.GetValue(3))
txtAddress.Text = IIf(myData.IsDBNull(0), "", myData.GetValue(4))
txtBrand.Text = IIf(myData.IsDBNull(0), "", myData.GetValue(5))
txtMeterNumber.Text = IIf(myData.IsDBNull(0), "",
myData.GetValue(6))
txttype.Text = IIf(myData.IsDBNull(0), "", myData.GetValue(7))
Loop
End Sub
Private Sub txtDate_TextChanged(sender As System.Object, e As
System.EventArgs) Handles txtDate.TextChanged
Dim cmd As SqlCommand
Dim dd As String
Dim yy As String
Dim d As Date
Dim m As Date
d = CDate(txtDate.Text)
27
m = CDate(txtDate.Text)
dd = Month(d)
yy = Year(m)
Dim ssql As String
ssql = "select * from TBilling where (Accountnumber='" & cmbAccount.Text
& "') and (month(Date)=" & dd & ") and (Year(Date)=" & yy & ") "
cmd = New SqlCommand(ssql, cnn)
Dim dr As SqlDataReader = cmd.ExecuteReader
If dr.HasRows Then
MsgBox("Bill Created successfully")
txtDate.Focus()
txtPresReading.Enabled = False
txtPrevReading.Enabled = False
txtCuM.Enabled = False
txtPayment.Enabled = False
Else
MsgBox("ENTER READING")
txtPresReading.Enabled = True
txtPrevReading.Enabled = True
txtCuM.Enabled = True
txtPayment.Enabled = True
End If
dr.Close()
End Sub
Private Sub txtPresReading_KeyDown(sender As Object, e As
System.Windows.Forms.KeyEventArgs) Handles txtPresReading.KeyDown
If e.KeyCode = Keys.Enter Then
txtCuM.Text = Val(txtPresReading.Text) - Val(txtPrevReading.Text)
End If
End Sub
Private Sub MonthCalendar1_DateSelected(ByVal sender As Object, ByVal e As
System.Windows.Forms.DateRangeEventArgs) Handles MonthCalendar1.DateSelected
txtDate.Text = MonthCalendar1.SelectionRange.Start
End Sub
Private Sub txtCuM_TextChanged(sender As System.Object, e As
System.EventArgs) Handles txtCuM.TextChanged
Dim Query As String
Dim tariffcode As String
Dim ur As String
Dim fc, dc, ec As String
Query = GetFieldValue("select * from TAccount where AccountNumber= '" &
cmbAccount.Text & "'", "TypeofConnection")
tariffcode = Query
Query = GetFieldValue("select * from tariff where tname= '" & tariffcode
& "'", "trate")
ur = Query
Query = GetFieldValue("select * from tariff where tname= '" & tariffcode
& "'", "fc")
fc = Query
Query = GetFieldValue("select * from tariff where tname= '" & tariffcode
& "'", "ec")
ec = Query
28
Query = GetFieldValue("select * from tariff where tname= '" & tariffcode
& "'", "dc")
dc = Query
txtPayment.Text = Val(ur) * Val(txtCuM.Text) + Val(fc) + Val(ec) +
Val(dc)
End Sub
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs)
Handles Button1.Click
Dim Query As String
Query = "delete from TBilling where AccountNumber = '" & txtAccount.Text
& "' "
Try
c.Exec(Query)
MsgBox("Account information successfully Deleted",
MsgBoxStyle.Information, "KSEB Billing")
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Private Sub txtPayment_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles txtPayment.TextChanged
End Sub
End Class
29
CONCLUSION
Now a day’s computers are very much influenced human life. The high speed,
accuracy and security make it a perfect fit in the modern world. Complex
calculations can be carried out with in milliseconds. Storing and retrieving
information is very fast and accurate using less space. Internet has reached in
every walks of life with possibilities opened for searching information, mailing
and chatting
The software EMS enables to add members to the tree and administrator can
view details of each prisoner. A member can get registered to the tree by
referring to an already existing member. Graphical representation of the tree is
possible. A member can add two members as child to the tree. When a
member joins the tree, automatic money transferred depends up on the
marketing strategy adopted by the firm. The flow of the business traverses
across a growing binary tree.
30