Banking Management System VB Project
Banking Management System VB Project
To
Inspired by life
Shillong Centre-02791
June 2015
GUID CERTIFICATE
This matter embodied in this project work has been submitted earlier for
award of any degree or diploma to the best of my knowledge and belief.
Date : _______________________
(__________________________________)
Faculty in IT Department,
Sikkim Manipal University,
Shillong Centre.
ACKNOWLEDGEMENT
Finally, I would like to thank my friends and other staff for their
cooperation to complete this project.
(RONALD TLUANGLIANTHANGA)
Bachelor of Computer Application
6th Semester
Reg. No – 1205027228
Shillong.
Date :
DECLEARATION
(RONALD TLUANGLIANTHANGA)
Bachelor of Computer Application
6th Semester
Reg. No - 1205027228
Contents
Unit- 1
A. Problem definition.
C. Hardware Requirement.
1. Minimum Hardware Requirement.
2. Maximum Hardware Requirement.
D. Software Requirement.
1. Minimum Hardware Requirement.
2. Maximum Hardware Requirement.
Unit-2
A. FEASIBILITY STUDY
1. TECHNICAL FEASIBILITY:
2. ECONOMIC FEASIBILITY:
3. BEHAVIORAL FEASIBILITY:
4. OPERATIONAL FEASIBILITY
5. SCHEDULE FEASIBILITY
6. LEGAL FEASIBILITY
B. EQUIPMENT EVALUATION
D. ENTITY-RELATION(ER):
Unit-3
C. MODULES
D. CODING
The need for computering and the concept of this project is to do away with paper
works which is not easy to maintain as paper gets eaten up insects, damaged because of fire,
also there is high risk that paper may get lost, writing on it may gradually fade away time and
also consumes a lot of space that make expensive.
B. DESCRIPTION :
“Banking System " keeps the day by day tally record as a complete banking. It can
keep the information of Account type, account opening form, Deposit, Withdrawal, and
Searching the transaction, Transaction reports, Individual account opening form, Group
Account. The exciting part of this project is; it displays Transaction reports, Statistical
Summary of Account type and Interest Information.
a. Existing System :
In the existing system the transactions are done only manually but in proposed system
we have to computerize all the banking transaction using the software Banking system.
To avoid all these limitations and make the working more accurately the system needs
to be computerized.
Proposed System
The system is very simple in design and to implement. The system requires
very low system resources and the system will work in almost all configurations. It
has got following features
Security of data.
Ensure data accuracy’s.
Proper control of the higher officials.
Reduce the damages of the machines.
Minimize manual data entry.
Minimum time needed for the various processing.
Greater efficiency.
Better service.
User friendliness and interactive.
Minimum time required.
b. Architecture :
d. Modules :
Open an account :
A module new account is literally the form for the customer to open a new
account.
Deposit :
Deposit should be done each time the customer deposit a particular amount for
an account.
Withdraw :
Using this withdraw module the user can withdraw particular amount for an
account.
View detail of an account :
Using this module the user can withdraw particular amount details.
Modify an account :
This module is used to modify the account that we want this done after
receiving the account number then the corresponding name and address are modified.
The Domain “Banking System " keeps the day by day tally record as a complete
banking. It can keep the information of Account type, account opening form, Deposit,
Withdraw, and Searching the transaction, Transaction report, Individual account opening
form, Group Account. The exciting part of this project is; it displays Transaction reports,
Statistical Summary of Account type and Interest Information.
C. HARDWARE REQUIREMENTS :
A. FEASIBILITY STUDY
Feasibility study is made to see if the project on completion will serve the
purpose of the organization for the amount of work, effort and the time that spend
on it. Feasibility study lets the developer foresee the future of the project and the
usefulness. A feasibility study of a system proposal is according to its workability,
which is the impact on the organization, ability to meet their user needs and
effective use of resources. Thus when a new application is proposed it normally goes
through a feasibility study before it is approved for development. The document
provide the feasibility of the project that is being designed and lists various areas
that were considered very carefully during the feasibility study of this project such as
Technical, Economic and Operational feasibilities.
i. TECHNICAL FEASIBILITY:
The system must be evaluated from the technical point of view first. The
assessment of this feasibility must be based on an outline design of the system
requirement in the terms of input, output, programs and procedures. Having
identified an outline system, the investigation must go on to suggest the type of
equipment, required method developing the system, of running the system once
it has been designed. Technical issues raised during the investigation are: Does
the existing technology sufficient for the suggested one? Can the system expand
if developed? The project should be developed such that the necessary functions
and performance are achieved within the constraints. The project is developed
within latest technology. Through the technology may become obsolete after
some period of time, due to the fact that never version of same software
supports older versions, the system may still be used. So there are minimal
constraints involved with this project. The system has been developed using Java
the project is technically feasible for development.
ii. ECONOMIC FEASIBILITY:
The developing system must be justified by cost and benefit. Criteria to ensure
that effort is concentrated on project, which will give best, return at the earliest. One
of the factors, which affect the development of a new system, is the cost it would
require. The following are some of the important financial questions asked during
preliminary investigation:
Since the system is developed as part of project work, there is no manual cost
to spend for the proposed system. Also all the resources are already available, it give
an indication of the system is economically possible for development.
Automation makes our life easy. The proposed system is highly user friendly
and is much easily able to interact with the system. Therefore the users will readily
accept the system as data entry and making queries can be easily done. The process
system is operational feasible because it is friendly and adaptable, thus the user not
have to worry about its effect.
v. SCHEDULE FEASIBILITY:-
This project will fail if it takes too long to be completed before it is useful.
Typically this means estimating how long the system will take to develop, and if it can
be completed in a given time period using some methods like payback period.
Schedule feasibility is a measure of how reasonable the project time is.
B. EQUIPMENT EVALUATION
Its Environment provides all features that are required to develop a graphical
user interface as ready -to- use components. The programmer does not have to write
code to create and display commonly required user-friendly features each time
around.
When the programmer needs a specific user interface feature such as button,
he selects the appropriate ready-to-use component provided by the visual
programming environment. These components can be moved, resized and renamed
as required.
For Example:-
Typically the mouse is used to select and place the necessary components. Thus, the
visual programming environment is also called a point and click environment.
There are several programming tools that allow us to build such visually
appealing and intuitive interface. These tools allow us to design interface that
employ user friendly features such as menus, buttons, windows etc.
However, the disadvantage of such tools is that the interface is designed using code.
The programmer has to code the user interface features specifying the size, position
etc. this makes designing the user interface a major task in itself.
Visual development of graphical user interface which are easy to use and easy
to learn. A programmer need not write code to display the required component.
For Example:-
For example:-
A button’ knows’ when it has been clicked upon. In the case of conventional
programming tools, the programmer has to write code to determine the component
that has been clicked and then execute the appropriate code.
Visual Basic is one of the most popular programming tools available today.
And it’s also secret that there have been massive changes in it as it became Visual
Basic.Net.
The reason of that change is Visual Basic itself, which has now become Visual
Basic.Net. The difference between Visual Basic.Net and the previous version. Visual
Basic 6.0 is revolutionary and far reaching. Visual Basic.Net has been more than four
years in the marking and it represents entirely new directions for Visual Basic.
Besides the biggest change integrated support for web development the very syntax,
of techniques that you’ve probably learned carefully are now completely different
such as data handling and many controls; project types and other aspects of Visual
Basic 6.0 are no longer available at all.
Visual Basic has a long and so far glorious history. When it first appeared, it
created a revolution in windows programming. Visual Basic introduced unheard of
ease to windows programming just builds the program you want right before your
eyes, and then run it. In so doing it changed programming form a chore to something
very like fun.
Microsoft SQL Server 2005 Express Edition(SQL Server Express) is a free and
easy-to-use version of SQL Server 2005 that replaces the Microsoft Desktop
Engine(MSDE). Integrated with Microsoft with Microsoft Visual 2005, SQL Server
Express can be redirected (subject to agreement), and can function as client
database as well as a basic server database, non-professional developers, web
application developers, web application site holders, and hobbyists building client
applications.
It’s fast.
It’s inexpensive.
It’s easy to run.
It can run on many operating systems.
Technical support is widely available.
It’s secure.
It supports large database.
It’s customizable.
Introduction to SQL: -
Unfortunately, there are many different versions of the SQL language, but to
be in compliance with the ANSI standard; they must support the same major
keywords in a similar manner (such as SELECT, UPDATE, DELETE, INSERT, WHERE, and
others).
A database most often contains one or more tables. Each table is identified by
a name (e.g. "Customers" or "Orders"). Tables contain records (rows) with data.
The table above contains three records (one for each person) and four columns
(Last Name, First Name, Address, and City).
SQL Queries: -
With SQL, we can query a database and have a result set returned.
SQL (Structured Query Language) is syntax for executing queries. But the SQL
language also includes syntax to update, insert, and delete records.
These query and update commands together form the Data Manipulation Language
(DML) part of SQL: -
iii. WINDOWS 7:
Among Windows 7’s new features are advances in touch and handwriting
recognition, support for virtual hard disks, improved performance on multi-core
processors, improved boot performance, Direct Access, and Kernel improvements.
Windows 7 adds support for system using multiple heterogeneous graphics card
from different vendors(Heterogeneous Multi-adapter), a new version of Windows
Media Center, a Gadget for Windows Media Center, improved media feature, the
XPS Essential pack and Windows Power Shell being included, and a redesigned
Calculator with multiline capabilities including programmer and statistics modes
along with unit conversion for length, weight , temperature, and several others.
Many new items have been added to the Control Panel, including Clear type Text
Tuner Display Color Calibration Wizard, Gadgets, Recovery, Troubleshooting,
Workspaces Center, Locations and other Sensors, Credential Manager, Biometric
Devices, System Icons, and Display. Windows Security Center had been renamed to
Windows Action Center (Windows Health Center and Windows Solution Center in
earlier builds), which encompasses both security and maintenance of the computer.
Ready Boost on 32-bit editions now supports up to 256 gigabytes of extra allocation.
Windows 7 also supports images in RAW image format through the addition of
Windows imaging component-enabled image decoders, which enables raw image
thumbnails, previewing and metadata display in windows Explorer, plus full-size
viewing and slideshows in windows photo viewer and windows media center.
A Data Flow Diagram is a graphical tool used and analyzes movement of data through
a system. These are the central tool and the basis from which the other components
are developed. The transformation of data from input to output, through processed,
may be described logically and independently of physical components associated
with system. These are known as logical data flow diagrams. The physical data flow
diagram shows implements and movement of data between people, departments
and workstations, A full description of a system actually consists of asset of data flow
diagrams. Using two familiar notation Yourdon, Gane and Sarson notation develops
the data flow diagrams. Each component of a number that will be used for the
identification purpose. The development of DFD’s is done in several levels. Each
process in low lower level diagram can be broken down into a more detailed DFD in
the next level. The top-level diagram is often called context level diagram is exploded
into other process at the first level DFD. Larry Constantine first developed the DFD as
a way of expressing system requirements in a graphical form, this lead to the
modular design. A DFD is also known as ‘Bubble Charts’ has the purpose of clarifying
system requirements and identifying major transformations that will become
programs in system design. So it is the starting points of design to the lowest level of
detail a DFD consists of a series of bubble joined by data flows in the system.
DFD SYMBOLS:
Symbol Meaning
Represent entity set.
Represents process
Process should be named and numbered for an easy reference. Each name
should be representative of the process.
The direction of flow is from top to bottom and from left to right. Data
traditionally flow from source to destination flow from source to destination
although they may flow back to the source. One way to indicate this is to draw
long flow line back to a source. An alternation way is to repeat the source
symbol as a destination. Since it is used more than once in the DFD it is
marked with a sort diagonal.
When a process is exploded into lower level details, they are numbered.
The data source and destinations are written in capital letters, process and
dataflow names have the first letter of each work capitalized.
A DFD typically shows the minimum contends of data store. Each data store should
contain all the data element that flow in and out.
The DFD shows flow of data, not of control loops and decision are
controlled consideration do not appear on a DFD.
The DFD does not indicate the time factor involved in any process whether
the data flow take place daily, weekly, monthly or yearly.
The sequence of events is not brought out on the DFD.
NEW PHYSICAL : The new physical represents only the physical implementation of
the new system.
i. PROCESS:
No process can have only outputs.
No process can have only inputs. If an objects has only inputs than it must
be a slink.
A process has a verb phrase label.
DATA FLOW:
A Data flow has only one direction of flow between symbols. It may flow in
both directions between a process and a data store to show a read before an
update. The later is usually indicated however by two separate arrows since
these happen at different.
A join in DFD means that exactly the same data comes from any of two or
more different processes data store or sink to a common location.
A data flow to a data store means update(delete or change).
A data flow has a noun phrase label more than one data flow noun phrase can
appear on a single arrow on a single arrow as long as all of the same arrows move
together as one package.
D. ENTITY-RELATION(ER):
Dr. Peter Chen is the originator of the Entity-Relationship Model. His original paper about
ER-modeling is one of the most cited papers in the computer software field. Currently the ER model
serves as the foundation of many system analysis and design methodologies, computer-aided
software engineering (CASE) tools, and repository systems.
The original notation for ER-Diagrams uses rectangles to represent entities, and diamonds to
represent relationships.
Entities are the "things" for which we want to store information. An entity is a person, place,
thing or event.
Attributes are the data we want to collect for an entity.
ERDs show entities in a database and relationships between tables within that database. It is
essential to have ER-Diagrams if you want to create a good database design. The diagrams help focus
on how the database actually works.
Emp_ Date_of
Security_ _
answer Emp_id Address
question
password Sex
role
Salary
usernam
e
Add
Employee Contact
Administrator
Delete
Date_of
_
Update Branch_
name
Add
Last_
name Date_of
Middle_ _ Update
name
First_ Delete
Customer_ name
Account_
Customer Avails
type
Branch_ Telephone
name Rate_of_
Permanen
interest
t Pincode
Due_date
Correspon State
_ address
Occupatio
Issue_dat
n Email
Mobile_ Sex
Loan e
City
Amount
Account_
number Branch_ Acc_holde
Account_ name r_ name
number
withdra Branch_
w Transfe name
r
Customer_
deposit
Account
Account_
type
Account_ Account_
opendate opendate
Opening_ Closing_
balance balance
UNIT-3
A system development life cycle is a logical process by which system analysts, software
engineers, programmers, and end users build information systems and computer applications to
solve business problems and needs.
The major phases involved in the MIS development process are referred to as system
development life cycle. Each phase of the development process must have well defined objectives
,and at the end of each phase ,progress towards meeting the objectives must be evaluated.
The development process should not continue until the objectives of all prior phases have been met.
System development life cycle is a phased approach to analysis and design to ensure that
systems are best developed.
The system development life cycle can be divided into seven phases as shown in fig
C. Modules:
1. Welcome Module
This module verifies The Welcome screen for The Project. The user or administrator
can choose their respective login page by clicking “USER” or “ADMINISTRATOR”.
2. Login module
These modules will verify or authenticate the users/administrator so as to allow the
user/administrator to use the system by providing Username and Password. If
accepted the application will be given a confirmation message and will open a new
window or main form where users/administrator can access the overall facilities
provided by this system. If the users/administrator forgot the password, by clicking
‘Forget password’ User/Administrator can get the forgotten password. The password
also can be changed by clicking ‘Change Password’.
3. Main module
This module will verify the respective task for the user and administrator.
Administrator can Add new employee, delete and update employee and set/update
salary for the employee and can also view the report for the customer and employee
(user). User can Add new customer, delete/update customer, withdraw, deposit and
transfer money from one account to another and user can also provide loan.
4. Employee Module
This module will allow accepting the details of the Employee working in the bank.
The administrator of the system can Add a new Employee, Update employee details
or Search any employee working into the Bank or Delete the details of a particular
employee. Under this module also comes the salary for the employee can be set by
providing the Employee ID of the employee. The system authenticates the employee
ID with required information and valid messages to the user.
5. Customer Module
This module will allow accepting the details of the customer in the Bank. Under this
module Employees/Users of the system can Add a new customer with the valid data
about the customer. And also searching of a customer can easily be done by just
giving the account number or ID of the customer. In this module a customer details
can also be Updated and Deleted from the system with valid messages to the user.
6. Transaction/Bank Module
This module will store all the details of various data for Deposit of money, Withdraw
of money, Transfer of money from one account to another by giving the valid account
number of the customer. It only proceeds further if it authenticates the valid account
number with a confirmation message. Otherwise, a rejection message will be
generated by the system. These modules also deal with the Balance Enquiry of a
particular customer account in the Bank by providing a valid account number.
7. Report Module
This module is handled to view the Employee Details and Customer Details or
Account details by searching with their ID or Name or Salary etc…And printing of
reports of certain details of a customer or a employee is also in this module.
D. Coding
1. Module:
Imports System.Data.SqlClient
Module Module1
Public con As SqlConnection
Public cmd As SqlCommand
Public dr As SqlDataReader
Public loginRole As String = ""
Public Sub fconnect()
con = New SqlConnection("Data
Source=.\SQLEXPRESS;AttachDbFilename='C:\Users\Computer
House\Documents\Visual Studio 2008\Projects\Banking
management\Banking management\Banking.mdf';Integrated
Security=True;User Instance=True")
End Sub
End Module
2. Welcome Form:
Imports System.Data.SqlClient
Public Class user_login
Dim validUserPass As Boolean = False
End Sub
Imports System.Data.SqlClient
Public Class forgot_password
Sub retrive()
If cbox_selectcriteria.Text = "User" Then
Try
fconnect()
con.Open()
cmd = New SqlCommand("SELECT * from tb_login
WHERE username='" & txtbox_username.Text & "'", con)
dr = cmd.ExecuteReader()
If dr.HasRows = True Then
While dr.Read()
If cbox_Squestion.Text =
dr(2).ToString() And txtbox_Sanswer.Text = dr(3).ToString()
Then
MsgBox("Processing is done
successfully")
txt_password.Text =
dr(1).ToString()
Exit While
Else
MsgBox("Security question and
Security answer is wrong")
End If
End While
Else
MsgBox("Username not found or Error
occured while processing, please check the criteria")
End If
Catch ex As Exception
MsgBox("Error Occur!")
MsgBox(ex.ToString())
Finally
con.Close()
End Try
End If
dr.Close()
Catch ex As Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
Finally
con.Close()
End Try
Else
MsgBox("Wrong Priveledge or Error occured while
processing, please check the criteria")
End If
End Sub
Sub btn_refresh()
txt_password.Text = ""
txtbox_Sanswer.Text = ""
txtbox_username.Text = ""
End Sub
Imports System.Data.SqlClient
Public Class changepassword_form
Sub change_pass()
Try
fconnect()
con.Open()
cmd = New SqlCommand("UPDATE tb_login SET
password= '" & txtbox_confirmpassword.Text & "' WHERE role= '"
& cbox_selectcriteria.Text & "' ", con)
cmd.ExecuteNonQuery()
MsgBox("Password has been changed!")
Catch ex As Exception
MsgBox("Error Occur!")
MsgBox(ex.ToString())
Finally
con.Close()
End Try
End Sub
Sub UsernamePassword()
Try
fconnect()
con.Open()
cmd = New SqlCommand("SELECT * from tb_login ",
con)
dr = cmd.ExecuteReader
If (dr.HasRows) Then
While (dr.Read())
If (txtbox_username.Text =
dr(0).ToString() And txtbox_currentpassword.Text =
dr(1).ToString() And txtbox_confirmpassword.Text =
txtbox_newpassword.Text) Then
change_pass()
End If
End While
End If
dr.Close()
Catch ex As Exception
MsgBox("Error occured while connecting to the
database!")
MsgBox(ex.ToString())
Finally
con.Close()
End Try
End Sub
Sub cancel1()
txtbox_username.Text = ""
txtbox_currentpassword.Text = ""
txtbox_newpassword.Text = ""
txtbox_confirmpassword.Text = ""
End Sub
End Sub
End Sub
Private Sub BackToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
BackToolStripMenuItem.Click
forgot_password.Show()
Me.Hide()
End Sub
7. Main(Home) Form:
End Sub
End Sub
End Sub
End Class
Imports System.Data.SqlClient
Public Class Add_new_employee
'To save a new employee the DB the table called
'tb_employee'
Sub save_newaccount()
Try
fconnect()
con.Open()
cmd = New SqlCommand("INSERT INTO tb_employee
Values ('" & txt_empname.Text & "','" & txt_parentsname.Text &
"','" & dob.Value.ToString("MM/dd/yyyy") & "','" &
cbox_sex.Text & "','" & cbox_marrital.Text & "'," &
txt_contact.Text & ",'" & txt_address.Text & "','" &
txt_qualification.Text & "','" & txt_branchname.Text & "','" &
doj.Value.ToString("MM/dd/yyyy") & "','" & cbox_empstatus.Text
& "', " & 0.0 & " )", con)
cmd.ExecuteNonQuery()
MsgBox("New Employee save!",
MsgBoxStyle.Information)
Catch ex As Exception
MsgBox("An error occured while trying to save!",
MsgBoxStyle.Information)
MsgBox(ex.ToString())
Finally
con.Close()
End Try
End Sub
'To put in the DataGridView
Sub dgy_employee()
dgv_employee.Rows.Clear()
dgv_employee.Columns.Clear()
'Creating Columns in Datagridview
dgv_employee.Columns.Add("Emp_Id", "Employee ID")
dgv_employee.Columns.Add("Emp_Name", "Employee Name")
dgv_employee.Columns.Add("Emp_Parentsname",
"Father/Mother")
dgv_employee.Columns.Add("Dob", "DOB")
dgv_employee.Columns.Add("Sex", "Sex")
dgv_employee.Columns.Add("Marrital_Status", "Marrital
Status")
dgv_employee.Columns.Add("Contact_No", "Contact")
dgv_employee.Columns.Add("Address", "Address")
dgv_employee.Columns.Add("Qualification",
"Qualification")
dgv_employee.Columns.Add("Branch_Name", "Branch Name")
dgv_employee.Columns.Add("Doj", "Date of Join")
dgv_employee.Columns.Add("Emp_Status", "Employee
Status")
While (dr.Read())
dgv_employee.Rows.Add(1)
dgv_employee(0, rowNo).Value =
dr(0).ToString()
dgv_employee(1, rowNo).Value =
dr(1).ToString()
dgv_employee(2, rowNo).Value =
dr(2).ToString()
dgv_employee(3, rowNo).Value =
dr(3).ToString()
dgv_employee(4, rowNo).Value =
dr(4).ToString()
dgv_employee(5, rowNo).Value =
dr(5).ToString()
dgv_employee(6, rowNo).Value =
dr(6).ToString()
dgv_employee(7, rowNo).Value =
dr(7).ToString()
dgv_employee(8, rowNo).Value =
dr(8).ToString()
dgv_employee(9, rowNo).Value =
dr(9).ToString()
dgv_employee(10, rowNo).Value =
dr(10).ToString()
dgv_employee(11, rowNo).Value =
dr(11).ToString()
rowNo = rowNo + 1
End While
End If
Catch ex As Exception
MsgBox("An error occured while conneting to tha
Database.")
MsgBox(ex.ToString())
Finally
con.Close()
End Try
End Sub
'To refresh
Sub emp_refresh()
txt_empname.Text = ""
txt_parentsname.Text = ""
cbox_sex.Text = ""
cbox_marrital.Text = ""
txt_contact.Text = ""
txt_address.Text = ""
txt_qualification.Text = ""
txt_branchname.Text = ""
cbox_empstatus.Text = ""
End Sub
End Sub
Imports System.Data.SqlClient
Public Class Delete_Update_Employee
'To ger Emp_ID from the Database
Sub get_empId()
Try
fconnect()
con.Open()
cmd = New SqlCommand("SELECT * FROM tb_employee",
con)
dr = cmd.ExecuteReader()
If (dr.HasRows) Then
While (dr.Read())
cbox_empid.Items.Add(dr(0).ToString())
End While
End If
Catch ex As Exception
MsgBox("Error occured while trying to get the
Employee ID from the database!")
MsgBox(ex.ToString())
Finally
con.Close()
End Try
End Sub
'To put in the DataGridView
Sub dgy_employee()
dgv_employee.Rows.Clear()
dgv_employee.Columns.Clear()
'Creating Columns in Datagridview
dgv_employee.Columns.Add("Emp_Id", "Employee ID")
dgv_employee.Columns.Add("Emp_Name", "Employee Name")
dgv_employee.Columns.Add("Emp_Parentsname",
"Father/Mother")
dgv_employee.Columns.Add("Dob", "DOB")
dgv_employee.Columns.Add("Sex", "Sex")
dgv_employee.Columns.Add("Marrital_Status", "Marrital
Status")
dgv_employee.Columns.Add("Contact_No", "Contact")
dgv_employee.Columns.Add("Address", "Address")
dgv_employee.Columns.Add("Qualification",
"Qualification")
dgv_employee.Columns.Add("Branch_Name", "Branch Name")
dgv_employee.Columns.Add("Doj", "Date of Join")
dgv_employee.Columns.Add("Emp_Status", "Employee
Status")
Dim rowNo As Integer = 0
Try
fconnect()
con.Open()
cmd = New SqlCommand("SELECT * FROM tb_employee
WHERE Emp_Id='" & cbox_empid.Text & "'", con)
dr = cmd.ExecuteReader()
If (dr.HasRows) Then
While (dr.Read())
dgv_employee.Rows.Add(1)
dgv_employee(0, rowNo).Value =
dr(0).ToString()
dgv_employee(1, rowNo).Value =
dr(1).ToString()
dgv_employee(2, rowNo).Value =
dr(2).ToString()
dgv_employee(3, rowNo).Value =
dr(3).ToString()
dgv_employee(4, rowNo).Value =
dr(4).ToString()
dgv_employee(5, rowNo).Value =
dr(5).ToString()
dgv_employee(6, rowNo).Value =
dr(6).ToString()
dgv_employee(7, rowNo).Value =
dr(7).ToString()
dgv_employee(8, rowNo).Value =
dr(8).ToString()
dgv_employee(9, rowNo).Value =
dr(9).ToString()
dgv_employee(10, rowNo).Value =
dr(10).ToString()
dgv_employee(11, rowNo).Value =
dr(11).ToString()
rowNo = rowNo + 1
End While
End If
Catch ex As Exception
MsgBox("An error occured while conneting to tha
Database.")
MsgBox(ex.ToString())
Finally
con.Close()
End Try
End Sub
'To retrive the Emplyee from database
Sub search_emp()
Try
fconnect()
con.Open()
cmd = New SqlCommand("SELECT * FROM tb_employee
WHERE Emp_Id='" + cbox_empid.Text + "'", con)
dr = cmd.ExecuteReader()
If (dr.HasRows) Then
While (dr.Read())
txt_empname.Text = dr(1).ToString()
txt_parentsname.Text = dr(2).ToString()
dob.Text = dr(3).ToString()
cbox_sex.Text = dr(4).ToString()
cbox_marrital.Text = dr(5).ToString()
txt_contact.Text = dr(6).ToString()
txt_address.Text = dr(7).ToString()
txt_qualification.Text = dr(8).ToString()
txt_branchname.Text = dr(9).ToString()
doj.Text = dr(10).ToString()
cbox_empstatus.Text = dr(11).ToString()
End While
End If
dr.Close()
Catch ex As Exception
Finally
con.Close()
End Try
End Sub
'To refresh
Sub emp_refresh()
txt_empname.Text = ""
txt_parentsname.Text = ""
cbox_sex.Text = ""
cbox_marrital.Text = ""
txt_contact.Text = ""
txt_address.Text = ""
txt_qualification.Text = ""
txt_branchname.Text = ""
cbox_empstatus.Text = ""
End Sub
'To Delete an account on its ID
Sub delete_emp()
Try
fconnect()
con.Open()
cmd = New SqlCommand("DELETE FROM account_detail
WHERE Emp_Id='" + cbox_empid.Text + "'", con)
cmd.ExecuteNonQuery()
MsgBox("The Employee has been deleted!",
MsgBoxStyle.Information)
Catch ex As Exception
MsgBox("Unable to delete the account from tha
Database", MsgBoxStyle.Information)
MsgBox(ex.ToString())
Finally
con.Close()
End Try
End Sub
'To Update Employee.
Sub updatenewaccount()
Try
fconnect()
con.Open()
cmd = New SqlCommand("UPDATE tb_employee SET
Emp_Name = '" + txt_empname.Text + "', Emp_Parentsname = '" +
txt_parentsname.Text + "', DOB = '" +
dob.Value.ToString("MM/dd/yyyy hh:mm:ss tt") + "',Sex = '" +
cbox_sex.Text + "',Marrital_Status = '" + cbox_marrital.Text +
"',Contact_No = '" + txt_contact.Text + "',Address = '" +
txt_address.Text + "',Qualification = '" +
txt_qualification.Text + "',Branch_Name = '" +
txt_branchname.Text + "',DOJ = '" +
doj.Value.ToString("MM/dd/yyyy hh:mm:ss tt") + "',Emp_Status =
'" + cbox_empstatus.Text + "' WHERE Emp_Id = '" +
cbox_empid.Text + "'", con)
MsgBox("Account Update successfully!")
cmd.ExecuteNonQuery()
Catch ex As Exception
MsgBox("An error occured while Upadating!")
MsgBox(ex.ToString())
Finally
con.Close()
End Try
End Sub
End Sub
Imports System.Data.SqlClient
Public Class Set_Salary
'Get Employee ID from the database.
Sub get_empID()
Try
fconnect()
con.Open()
cmd = New SqlCommand("SELECT * FROM tb_employee",
con)
dr = cmd.ExecuteReader()
If (dr.HasRows) Then
While (dr.Read())
cbox_empID.Items.Add(dr(0).ToString())
End While
End If
Catch ex As Exception
MsgBox("Error occured while trying to connect the
database!")
MsgBox(ex.ToString())
Finally
con.Close()
End Try
End Sub
'To get the detail from the database
Sub get_details()
Try
fconnect()
con.Open()
cmd = New SqlCommand("SELECT * FROM tb_employee
WHERE Emp_Id=" + cbox_empID.Text + " ", con)
dr = cmd.ExecuteReader()
If (dr.HasRows) Then
While (dr.Read())
txt_empname.Text = dr(1).ToString()
txt_parentsname.Text =dr(2).ToString()
txt_dob.Text = dr(3).ToString()
txt_sex.Text = dr(4).ToString()
txt_marrital.Text = dr(5).ToString()
txt_contact.Text = dr(6).ToString()
txt_address.Text = dr(7).ToString
txt_qualification.Text=d(8).ToString()
txt_branchname.Text = dr(9).ToString()
txt_doj.Text = dr(10).ToString()
txt_empstatus.Text = dr(11).ToString()
End While
End If
dr.Close()
Catch ex As Exception
Finally
con.Close()
End Try
End Sub
'To Set Salary
Sub Set_Salary()
Try
fconnect()
con.Open()
cmd = New SqlCommand("UPDATE tb_employee SET
Basic_Salary= " + txt_salary.Text + " WHERE Emp_Id= " +
cbox_empID.Text + " ", con)
cmd.ExecuteNonQuery()
MsgBox("Set salary Sucessfully!")
Catch ex As Exception
MsgBox("Error occur while Trying to set salary!")
MsgBox(ex.ToString())
Finally
con.Close()
End Try
End Sub
Private Sub Set_Salary_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
get_empID()
group_setsal.Visible = False
End Sub
End Class
Imports System.Data.SqlClient
Public Class View_Update_salary
'Get Employee ID from the database.
Sub get_empID()
Try
fconnect()
con.Open()
cmd = New SqlCommand("SELECT * FROM tb_employee",
con)
dr = cmd.ExecuteReader()
If (dr.HasRows) Then
While (dr.Read())
cbox_empID.Items.Add(dr(0).ToString())
End While
End If
Catch ex As Exception
MsgBox("Error occured while trying to connect the
database!")
MsgBox(ex.ToString())
Finally
con.Close()
End Try
End Sub
'To get the detail from the database
Sub get_details()
Try
fconnect()
con.Open()
cmd = New SqlCommand("SELECT * FROM tb_employee
WHERE Emp_Id=" + cbox_empID.Text + " ", con)
dr = cmd.ExecuteReader()
If (dr.HasRows) Then
While (dr.Read())
txt_empname.Text = dr(1).ToString()
txt_branchname.Text = dr(9).ToString()
txt_doj.Text = dr(10).ToString()
txt_empstatus.Text = dr(11).ToString()
txt_salary.Text = dr(12).ToString()
End While
End If
dr.Close()
Catch ex As Exception
Finally
con.Close()
End Try
End Sub
Sub dgy_emp()
dgv_emp.Rows.Clear()
dgv_emp.Columns.Clear()
'Creating Columns in Datagridview
dgv_emp.Columns.Add("Emp_Id", "Emp ID")
dgv_emp.Columns.Add("Emp_Name", "Name")
dgv_emp.Columns.Add("Branch_Name", "Branch Name")
dgv_emp.Columns.Add("DOJ", "Date of Join")
dgv_emp.Columns.Add("Emp_Status", "Status")
dgv_emp.Columns.Add("Basic_Salary", "Salary")
Dim rowNo As Integer = 0
Try
fconnect()
con.Open()
cmd = New SqlCommand("SELECT * FROM tb_employee
WHERE Emp_Id=" & cbox_empID.Text & " ", con)
dr = cmd.ExecuteReader()
If (dr.HasRows) Then
While (dr.Read())
dgv_emp.Rows.Add(1)
dgv_emp(0, rowNo).Value = dr(0).ToString()
dgv_emp(1, rowNo).Value = dr(1).ToString()
dgv_emp(2, rowNo).Value = dr(9).ToString()
dgv_emp(3, rowNo).Value = dr(10).ToString()
dgv_emp(4, rowNo).Value = dr(11).ToString()
dgv_emp(5, rowNo).Value = dr(12).ToString()
rowNo = rowNo + 1
End While
End If
Catch ex As Exception
MsgBox("An error occured while conneting to tha
Database.")
MsgBox(ex.ToString())
Finally
con.Close()
End Try
End Sub
Sub update_salary()
Try
fconnect()
con.Open()
cmd = New SqlCommand("UPDATE tb_employee SET
Basic_Salary = " + txt_newsalary.Text + " WHERE Emp_Id= " +
cbox_empID.Text + " ", con)
cmd.ExecuteNonQuery()
MsgBox("Update salary Sucessfully!")
Catch ex As Exception
MsgBox("Error occur while Trying to Update!")
MsgBox(ex.ToString())
Finally
con.Close()
End Try
End Sub
Sub emp_refresh()
txt_branchname.Text = ""
txt_doj.Text = ""
txt_salary.Text = ""
txt_empstatus.Text = ""
txt_newsalary.Text = ""
txt_empstatus.Text = ""
txt_empname.Text = ""
End Sub
Private Sub View_Update_salary_Load(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
MyBase.Load
get_empID()
gbox_setsal.Visible = False
End Sub
Imports System.Data.SqlClient
Public Class add_newaccount
Dim firstname As String
Dim middlename As String
Dim lastname As String
Dim branchname As String
Dim accounttype As String
Dim birthday As String
Dim sex As String
Dim city As String
Dim state As String
Dim pincode As String
Dim email As String
Dim mobileno As String
Dim telno As String
Dim occupation As String
Dim coresadd As String
Dim peradd As String
cbox_accounttype.Items.Add(dr(1).ToString())
End While
End If
Catch ex As Exception
MsgBox("Error occured while retrieving the Account
Types from the database!")
MsgBox(ex.ToString())
Finally
con.Close()
End Try
End Sub
'Get Customer ID from the database
Sub getCustomerID()
Try
fconnect()
con.Open()
cmd = New SqlCommand("SELECT * FROM
tb_newaccount", con)
dr = cmd.ExecuteReader()
If (dr.HasRows) Then
While (dr.Read())
cbox_custID.Items.Add(dr(0).ToString())
End While
End If
Catch ex As Exception
MsgBox("Error occured while trying to get the
Customer ID from the database!")
MsgBox(ex.ToString())
Finally
con.Close()
End Try
End Sub
dgv_accountdetail.Columns.Add("Correspondence_address",
"Correspondent Address")
dgv_accountdetail.Columns.Add("Permanent_address",
"Permanent Address")
Dim rowNo As Integer = 0
Try
fconnect()
con.Open()
cmd = New SqlCommand("SELECT * FROM
tb_newaccount", con)
dr = cmd.ExecuteReader()
If (dr.HasRows) Then
While (dr.Read())
dgv_accountdetail.Rows.Add(1)
dgv_accountdetail(0, rowNo).Value =
dr(0).ToString()
dgv_accountdetail(1, rowNo).Value =
dr(1).ToString()
dgv_accountdetail(2, rowNo).Value =
dr(2).ToString()
dgv_accountdetail(3, rowNo).Value =
dr(3).ToString()
dgv_accountdetail(4, rowNo).Value =
dr(4).ToString()
dgv_accountdetail(5, rowNo).Value =
dr(5).ToString()
dgv_accountdetail(6, rowNo).Value =
dr(6).ToString()
dgv_accountdetail(7, rowNo).Value =
dr(7).ToString()
dgv_accountdetail(8, rowNo).Value =
dr(8).ToString()
dgv_accountdetail(9, rowNo).Value =
dr(9).ToString()
dgv_accountdetail(10, rowNo).Value
=dr(10).ToString()
dgv_accountdetail(11, rowNo).Value
=dr(11).ToString()
dgv_accountdetail(12, rowNo).Value =
dr(12).ToString()
dgv_accountdetail(13, rowNo).Value =
dr(13).ToString()
dgv_accountdetail(14, rowNo).Value =
dr(14).ToString()
dgv_accountdetail(15, rowNo).Value =
dr(15).ToString()
dgv_accountdetail(16, rowNo).Value =
dr(16).ToString()
rowNo = rowNo + 1
End While
End If
Catch ex As Exception
MsgBox("An error occured while conneting to tha
Database.")
MsgBox(ex.ToString())
Finally
con.Close()
End Try
End Sub
Imports System.Data.SqlClient
Public Class Account_detail
'Get Customer ID from the database
Sub getCustomerID()
Try
fconnect()
con.Open()
cmd = New SqlCommand("SELECT * FROM
tb_newaccount", con)
dr = cmd.ExecuteReader()
If (dr.HasRows) Then
While (dr.Read())
cbox_custID.Items.Add(dr(0).ToString())
End While
End If
Catch ex As Exception
MsgBox("Error occured while trying to get the
Customer ID from the database!")
MsgBox(ex.ToString())
Finally
con.Close()
End Try
End Sub
'To get Account No from database
Sub getaccID()
Try
fconnect()
con.Open()
cmd = New SqlCommand("SELECT * FROM
account_detail", con)
dr = cmd.ExecuteReader()
If (dr.HasRows) Then
While (dr.Read())
cbox_accID.Items.Add(dr(0).ToString())
End While
End If
Catch ex As Exception
MsgBox("Error occured while trying to get the
Customer ID from the database!")
MsgBox(ex.ToString())
Finally
con.Close()
End Try
End Sub
End While
End If
dr.Close()
Catch ex As Exception
Finally
con.Close()
End Try
End Sub
'To save a new account the DB the table called
'account_detail'
Sub save_account()
Try
fconnect()
con.Open()
cmd = New SqlCommand("INSERT INTO account_detail
Values ('" & cbox_custID.Text & "','" & txt_branchname.Text &
"','" & txt_acctype.Text & "','" &
acc_opendate.Value.ToString("MM/dd/yyyy hh:mm:ss tt") & "','"
& txt_openbal.Text & "','" & txt_closebal.Text & "','" &
txt_finalbal.Text & "')", con)
cmd.ExecuteNonQuery()
MsgBox("New account save!",
MsgBoxStyle.Information)
Catch ex As Exception
MsgBox("An error occured while trying to save!",
MsgBoxStyle.Information)
MsgBox(ex.ToString())
Finally
con.Close()
End Try
End Sub
'To Delete an account on its ID
Sub delete_account()
Try
fconnect()
con.Open()
cmd = New SqlCommand("DELETE FROM account_detail
WHERE Account_number='" + cbox_accID.Text + "'", con)
cmd.ExecuteNonQuery()
MsgBox("The account has been deleted!",
MsgBoxStyle.Information)
Catch ex As Exception
MsgBox("Unable to delete the account from tha
Database", MsgBoxStyle.Information)
MsgBox(ex.ToString())
Finally
con.Close()
End Try
End Sub
Sub dgy_accountdetail()
dgv_accountdetail.Rows.Clear()
dgv_accountdetail.Columns.Clear()
'Creating Columns in Datagridview
dgv_accountdetail.Columns.Add("Account_number",
"Account No")
dgv_accountdetail.Columns.Add("Customer_ID", "Customer
ID")
dgv_accountdetail.Columns.Add("Banch_name",
"Branchname")
dgv_accountdetail.Columns.Add("Account_type", "Account
type")
dgv_accountdetail.Columns.Add("Account_opendate",
"Date")
dgv_accountdetail.Columns.Add("Opening_balance",
"Opening Balance")
dgv_accountdetail.Columns.Add("Closing_blance",
"Closing Balance")
dgv_accountdetail.Columns.Add("Final_balance", "Final
Balance")
rowNo = rowNo + 1
End While
End If
Catch ex As Exception
MsgBox("An error occured while conneting to tha
Database.")
MsgBox(ex.ToString())
Finally
con.Close()
End Try
End Sub
End Sub
End Sub
End Class
14. Deposit Form:
Imports System.Data.SqlClient
Public Class deposit_form
End Try
End Sub
'To get the Actual Balance from the Database
Sub get_actualbal()
Try
fconnect()
con.Open()
cmd = New SqlCommand("SELECT * FROM account_detail
WHERE Account_number='" + cbox_accountno.Text + "'", con)
dr = cmd.ExecuteReader()
If (dr.HasRows) Then
While (dr.Read())
txt_actualbal.Text = dr(7).ToString()
End While
End If
dr.Close()
Catch ex As Exception
Finally
con.Close()
End Try
End Sub
'To save/Deposite in the table called 'tb_accountdetail'
Sub deposite()
Try
fconnect()
con.Open()
cmd = New SqlCommand("UPDATE account_detail SET
Final_balance = " & txt_finalbal.Text & " WHERE
Account_number= " & cbox_accountno.Text & "", con)
cmd.ExecuteNonQuery()
MsgBox("Deposite Successfully !",
MsgBoxStyle.Information)
Catch ex As Exception
MsgBox("An error occured while trying to save!",
MsgBoxStyle.Information)
MsgBox(ex.ToString())
Finally
con.Close()
End Try
End Sub
Try
actualBal = Convert.ToDecimal(txt_actualbal.Text)
Catch ex As Exception
actualBal = 0
End Try
Try
depositAmt =
Convert.ToDecimal(txt_depositamt.Text)
Catch ex As Exception
depositAmt = 0
End Try
End Try
End Sub
'To get the Actual Balance from the Database
Sub get_actualbal()
' Dim lb_actualamnt As Decimal
Try
fconnect()
con.Open()
cmd = New SqlCommand("SELECT * FROM account_detail
WHERE Account_number=" & cbox_accID.Text & "", con)
dr = cmd.ExecuteReader()
If (dr.HasRows) Then
While (dr.Read())
lb_actualamnt.Text = dr(7).ToString()
End While
End If
dr.Close()
Catch ex As Exception
Finally
con.Close()
End Try
End Sub
'To save/Deposite in the table called 'tb_acoountbalance'
Sub withdrawl()
Try
fconnect()
con.Open()
cmd = New SqlCommand("UPDATE account_detail SET
Final_balance = " & txt_finalbal.Text & " WHERE
Account_number= " & cbox_accID.Text & "", con)
cmd.ExecuteNonQuery()
MsgBox("Withdraw Successfully !",
MsgBoxStyle.Information)
Catch ex As Exception
MsgBox("An error occured while trying to
Withdraw!", MsgBoxStyle.Information)
MsgBox(ex.ToString())
Finally
con.Close()
End Try
End Sub
Try
actualBal = Convert.ToDecimal(lb_actualamnt.Text)
Catch ex As Exception
actualBal = 0
End Try
Try
withrawlAmt =
Convert.ToDecimal(txt_withdrwlamount.Text)
Catch ex As Exception
withrawlAmt = 0
End Try
Imports System.Data.SqlClient
Public Class Transfer_account
'Get the Account Number from the database.
Sub get_credit_accountID()
Try
fconnect()
con.Open()
cmd = New SqlCommand("SELECT * FROM
account_detail", con)
dr = cmd.ExecuteReader()
If (dr.HasRows) Then
While (dr.Read())
cbox_credaccno.Items.Add(dr(0).ToString())
End While
End If
Catch ex As Exception
MsgBox("Error occured while retrieving the Account
Types from the database!")
MsgBox(ex.ToString())
Finally
con.Close()
End Try
End Sub
End Try
End Sub
'To get the Balance from Database
Sub debit_bal()
Try
fconnect()
con.Open()
cmd = New SqlCommand("SELECT * FROM account_detail
WHERE Account_number='" + cbox_debaccno.Text + "'", con)
dr = cmd.ExecuteReader()
If (dr.HasRows) Then
While (dr.Read())
txt_debbal.Text = dr(7).ToString()
End While
End If
dr.Close()
Catch ex As Exception
Finally
con.Close()
End Try
End Sub
'To deduce the Debitor account
Sub debit_transfer()
Dim debitbal As Decimal
Dim amount As Decimal
debitbal = Convert.ToDecimal(txt_debbal.Text)
amount = Convert.ToDecimal(txt_transfer_amt.Text)
debitbal = debitbal - amount
Try
fconnect()
con.Open()
cmd = New SqlCommand("UPDATE account_detail SET
Final_balance = " & debitbal & " WHERE Account_number= " &
cbox_debaccno.Text & " ", con)
cmd.ExecuteNonQuery()
Catch ex As Exception
Finally
con.Close()
End Try
End Sub
Sub credit_tranfer()
Dim amount As Decimal
Dim creditbal As Decimal
Dim creditNewbal As Decimal
Try
fconnect()
con.Open()
cmd = New SqlCommand("SELECT Final_balance FROM
account_detail WHERE Account_number=" + cbox_credaccno.Text +
" ", con)
dr = cmd.ExecuteReader()
If (dr.HasRows) Then
While (dr.Read())
creditbal =
Convert.ToDecimal(dr(0).ToString())
End While
End If
dr.Close()
Catch ex As Exception
MsgBox("Error Occur")
MsgBox(ex.ToString())
Finally
con.Close()
End Try
amount = Convert.ToDecimal(txt_transfer_amt.Text)
creditNewbal = creditbal + amount
Try
fconnect()
con.Open()
cmd = New SqlCommand("UPDATE account_detail SET
Final_balance = " & creditNewbal & " WHERE Account_number= " &
cbox_credaccno.Text & " ", con)
cmd.ExecuteNonQuery()
Catch ex As Exception
MsgBox("Error occur while trying to Transfer")
MsgBox(ex.ToString())
Finally
con.Close()
End Try
End Sub
End Sub
End If
End Sub
End Try
End Sub
'To get the Branch name
Sub getbranchname()
Try
fconnect()
con.Open()
cmd = New SqlCommand("SELECT * FROM account_detail
WHERE Account_number=" + cbox_accid.Text + " ", con)
dr = cmd.ExecuteReader()
If (dr.HasRows) Then
While (dr.Read())
txt_branchname.Text = dr(2).ToString()
End While
End If
dr.Close()
Catch ex As Exception
Finally
con.Close()
End Try
End Sub
Sub refresh_loan()
cbox_accid.Text = ""
cbox_loantype.Text = ""
txt_branchname.Text = ""
txt_currentloan.Text = ""
txt_finalbal.Text = ""
txt_loanreturn.Text = ""
txt_loansacntion.Text = ""
txt_rit.Text = ""
txt_peroid.Text = ""
End Sub
'To save a Loanform the DB the table called 'tb_loan'
Sub loan_sanction()
Try
fconnect()
con.Open()
cmd = New SqlCommand("INSERT INTO tb_loan Values
(" & cbox_accid.Text & ",'" & cbox_loantype.Text & "','" &
isue_date.Value.ToString("MM/dd/yyyy hh:mm:ss tt") & "','" &
due_date.Value.ToString("MM/dd/yyyy hh:mm:ss tt") & "'," &
txt_peroid.Text & "," & txt_loansacntion.Text & "," &
txt_rit.Text & "," & txt_loanreturn.Text & "," &
txt_currentloan.Text & "," & txt_finalbal.Text & ")", con)
cmd.ExecuteNonQuery()
MsgBox("Sanction Successfully!",
MsgBoxStyle.Information)
Catch ex As Exception
MsgBox("An error occured while trying to
sanction!", MsgBoxStyle.Information)
MsgBox(ex.ToString())
Finally
con.Close()
End Try
End Sub
Imports System.Data.SqlClient
Public Class Loan_payment
'Get Loan ID from the database.
Sub get_loanID()
Try
fconnect()
con.Open()
cmd = New SqlCommand("SELECT * FROM tb_loan", con)
dr = cmd.ExecuteReader()
If (dr.HasRows) Then
While (dr.Read())
cbox_loanid.Items.Add(dr(0).ToString())
End While
End If
Catch ex As Exception
MsgBox("Error occured while trying to connect the
database!")
MsgBox(ex.ToString())
Finally
con.Close()
End Try
End Sub
'To get the detail from the database
Sub get_details()
Try
fconnect()
con.Open()
cmd = New SqlCommand("SELECT * FROM tb_loan WHERE
Loan_Id=" + cbox_loanid.Text + " ", con)
dr = cmd.ExecuteReader()
If (dr.HasRows) Then
While (dr.Read())
txt_accno.Text = dr(1).ToString()
txt_loantype.Text = dr(2).ToString()
txt_loansanction.Text = dr(6).ToString()
txt_loanperoid.Text = dr(5).ToString()
txt_totaltobereturn.Text =
dr(8).ToString()
txt_tobereturn.Text = dr(9).ToString()
End While
End If
dr.Close()
Catch ex As Exception
Finally
con.Close()
End Try
End Sub
'To deposit loan
Sub loan_deposite()
Try
fconnect()
con.Open()
cmd = New SqlCommand("UPDATE tb_loan SET
current_loanmt= " + txt_balance.Text + ", final_bal= " +
txt_balance.Text + " WHERE Loan_Id= " + cbox_loanid.Text + "
", con)
cmd.ExecuteNonQuery()
MsgBox("Deposite Sucessfully!")
Catch ex As Exception
MsgBox("Error occur while trying to connect the
atabase!")
MsgBox(ex.ToString())
Finally
con.Close()
End Try
End Sub
Sub loan_refresh()
txt_accno.Text = ""
txt_loanperoid.Text = ""
txt_depositamt.Text = ""
txt_loantype.Text = ""
txt_totaltobereturn.Text = ""
txt_loansanction.Text = ""
txt_balance.Text = ""
txt_tobereturn.Text = ""
End Sub
End Sub
Try
amttoreturn =
Convert.ToDecimal(txt_tobereturn.Text)
Catch ex As Exception
amttoreturn = 0
End Try
Try
depositAmt =
Convert.ToDecimal(txt_depositamt.Text)
Catch ex As Exception
depositAmt = 0
End Try
Imports System.Data.SqlClient
Imports System.Drawing.Printing
Imports System.Drawing
Public Class view_report
While (dr.Read())
dgv_accountdetail.Rows.Add(1)
dgv_accountdetail(0, rowNo).Value =
dr(0).ToString()
dgv_accountdetail(1, rowNo).Value =
dr(1).ToString()
dgv_accountdetail(2, rowNo).Value =
dr(2).ToString()
dgv_accountdetail(3, rowNo).Value =
dr(3).ToString()
dgv_accountdetail(4, rowNo).Value =
dr(4).ToString()
dgv_accountdetail(5, rowNo).Value =
dr(5).ToString()
dgv_accountdetail(6, rowNo).Value =
dr(6).ToString()
dgv_accountdetail(7, rowNo).Value =
dr(7).ToString()
rowNo = rowNo + 1
MsgBox("Search Sucessfully!")
End While
End If
Catch ex As Exception
MsgBox("An error occured while conneting to tha
Database.")
MsgBox(ex.ToString())
Finally
con.Close()
End Try
End Sub
'To put in the DataGridView for view by Account ID
Sub dgy_accountIDdetail()
dgv_accountdetail.Rows.Clear()
dgv_accountdetail.Columns.Clear()
'Creating Columns in Datagridview
dgv_accountdetail.Columns.Add("Account_number",
"Account No")
dgv_accountdetail.Columns.Add("Customer_ID", "Customer
ID")
dgv_accountdetail.Columns.Add("Banch_name",
"Branchname")
dgv_accountdetail.Columns.Add("Account_type", "Account
type")
dgv_accountdetail.Columns.Add("Account_opendate",
"Date")
dgv_accountdetail.Columns.Add("Opening_balance",
"Opening Balance")
dgv_accountdetail.Columns.Add("Closing_blance",
"Closing Balance")
dgv_accountdetail.Columns.Add("Final_balance", "Final
Balance")
rowNo = rowNo + 1
MsgBox("Search Sucessfully!")
End While
End If
Catch ex As Exception
MsgBox("An error occured while conneting to tha
Database.")
MsgBox(ex.ToString())
Finally
con.Close()
End Try
End Sub
'To put in the DataGridView for view by All
Sub dgy_accountAlldetail()
dgv_accountdetail.Rows.Clear()
dgv_accountdetail.Columns.Clear()
'Creating Columns in Datagridview
dgv_accountdetail.Columns.Add("Account_number",
"Account No")
dgv_accountdetail.Columns.Add("Customer_ID", "Customer
ID")
dgv_accountdetail.Columns.Add("Banch_name",
"Branchname")
dgv_accountdetail.Columns.Add("Account_type", "Account
type")
dgv_accountdetail.Columns.Add("Account_opendate",
"Date")
dgv_accountdetail.Columns.Add("Opening_balance",
"Opening Balance")
dgv_accountdetail.Columns.Add("Closing_blance",
"Closing Balance")
dgv_accountdetail.Columns.Add("Final_balance", "Final
Balance")
While (dr.Read())
dgv_accountdetail.Rows.Add(1)
dgv_accountdetail(0, rowNo).Value =
dr(0).ToString()
dgv_accountdetail(1, rowNo).Value =
dr(1).ToString()
dgv_accountdetail(2, rowNo).Value =
dr(2).ToString()
dgv_accountdetail(3, rowNo).Value =
dr(3).ToString()
dgv_accountdetail(4, rowNo).Value =
dr(4).ToString()
dgv_accountdetail(5, rowNo).Value =
dr(5).ToString()
dgv_accountdetail(6, rowNo).Value =
dr(6).ToString()
dgv_accountdetail(7, rowNo).Value =
dr(7).ToString()
rowNo = rowNo + 1
MsgBox("Search Sucessfully!")
End While
End If
Catch ex As Exception
MsgBox("An error occured while conneting to tha
Database.")
MsgBox(ex.ToString())
Finally
con.Close()
End Try
End Sub
'To put the Employee report in the DataGridView for view
by All
Sub employee_all()
dgv_accountdetail.Rows.Clear()
dgv_accountdetail.Columns.Clear()
'Creating Columns in Datagridview
dgv_accountdetail.Columns.Add("Emp_Id", "Employee ID")
dgv_accountdetail.Columns.Add("Emp_Name", "Employee
Name")
dgv_accountdetail.Columns.Add("Dob", "DOB")
dgv_accountdetail.Columns.Add("Sex", "Sex")
dgv_accountdetail.Columns.Add("Contact_No", "Contact")
dgv_accountdetail.Columns.Add("Address", "Address")
dgv_accountdetail.Columns.Add("Qualification",
"Qualification")
dgv_accountdetail.Columns.Add("Branch_Name", "Branch
Name")
dgv_accountdetail.Columns.Add("Doj", "Date of Join")
dgv_accountdetail.Columns.Add("Emp_Status", "Employee
Status")
dgv_accountdetail.Columns.Add("Basic_Salary",
"Salary")
While (dr.Read())
dgv_accountdetail.Rows.Add(1)
dgv_accountdetail(0, rowNo).Value =
dr(0).ToString()
dgv_accountdetail(1, rowNo).Value =
dr(1).ToString()
dgv_accountdetail(2, rowNo).Value =
dr(3).ToString()
dgv_accountdetail(3, rowNo).Value =
dr(4).ToString()
dgv_accountdetail(4, rowNo).Value =
dr(6).ToString()
dgv_accountdetail(5, rowNo).Value =
dr(7).ToString()
dgv_accountdetail(6, rowNo).Value =
dr(8).ToString()
dgv_accountdetail(7, rowNo).Value =
dr(9).ToString()
dgv_accountdetail(8, rowNo).Value =
dr(10).ToString()
dgv_accountdetail(9, rowNo).Value =
dr(11).ToString()
dgv_accountdetail(10, rowNo).Value =
dr(12).ToString()
rowNo = rowNo + 1
MsgBox("Search Sucessfully!")
End While
End If
Catch ex As Exception
MsgBox("An error occured while conneting to tha
Database.")
MsgBox(ex.ToString())
Finally
con.Close()
End Try
End Sub
'To put the Employee report in the DataGridView for view
by ID
Sub employee_ID()
dgv_accountdetail.Rows.Clear()
dgv_accountdetail.Columns.Clear()
'Creating Columns in Datagridview
dgv_accountdetail.Columns.Add("Emp_Id", "Employee ID")
dgv_accountdetail.Columns.Add("Emp_Name", "Employee
Name")
dgv_accountdetail.Columns.Add("Dob", "DOB")
dgv_accountdetail.Columns.Add("Sex", "Sex")
dgv_accountdetail.Columns.Add("Contact_No", "Contact")
dgv_accountdetail.Columns.Add("Address", "Address")
dgv_accountdetail.Columns.Add("Qualification",
"Qualification")
dgv_accountdetail.Columns.Add("Branch_Name", "Branch
Name")
dgv_accountdetail.Columns.Add("Doj", "Date of Join")
dgv_accountdetail.Columns.Add("Emp_Status", "Employee
Status")
dgv_accountdetail.Columns.Add("Basic_Salary",
"Salary")
While (dr.Read())
dgv_accountdetail.Rows.Add(1)
dgv_accountdetail(0, rowNo).Value =
dr(0).ToString()
dgv_accountdetail(1, rowNo).Value =
dr(1).ToString()
dgv_accountdetail(2, rowNo).Value =
dr(3).ToString()
dgv_accountdetail(3, rowNo).Value =
dr(4).ToString()
dgv_accountdetail(4, rowNo).Value =
dr(6).ToString()
dgv_accountdetail(5, rowNo).Value =
dr(7).ToString()
dgv_accountdetail(6, rowNo).Value =
dr(8).ToString()
dgv_accountdetail(7, rowNo).Value =
dr(9).ToString()
dgv_accountdetail(8, rowNo).Value =
dr(10).ToString()
dgv_accountdetail(9, rowNo).Value =
dr(11).ToString()
dgv_accountdetail(10, rowNo).Value =
dr(12).ToString()
rowNo = rowNo + 1
MsgBox("Search Sucessfully!")
End While
End If
Catch ex As Exception
MsgBox("An error occured while conneting to tha
Database.")
MsgBox(ex.ToString())
Finally
con.Close()
End Try
End Sub
'To put the Employee report in the DataGridView for view
by Employee name
Sub employee_name()
dgv_accountdetail.Rows.Clear()
dgv_accountdetail.Columns.Clear()
'Creating Columns in Datagridview
dgv_accountdetail.Columns.Add("Emp_Id", "Employee ID")
dgv_accountdetail.Columns.Add("Emp_Name", "Employee
Name")
dgv_accountdetail.Columns.Add("Dob", "DOB")
dgv_accountdetail.Columns.Add("Sex", "Sex")
dgv_accountdetail.Columns.Add("Contact_No", "Contact")
dgv_accountdetail.Columns.Add("Address", "Address")
dgv_accountdetail.Columns.Add("Qualification",
"Qualification")
dgv_accountdetail.Columns.Add("Branch_Name", "Branch
Name")
dgv_accountdetail.Columns.Add("Doj", "Date of Join")
dgv_accountdetail.Columns.Add("Emp_Status", "Employee
Status")
dgv_accountdetail.Columns.Add("Basic_Salary",
"Salary")
While (dr.Read())
dgv_accountdetail.Rows.Add(1)
dgv_accountdetail(0, rowNo).Value =
dr(0).ToString()
dgv_accountdetail(1, rowNo).Value =
dr(1).ToString()
dgv_accountdetail(2, rowNo).Value =
dr(3).ToString()
dgv_accountdetail(3, rowNo).Value =
dr(4).ToString()
dgv_accountdetail(4, rowNo).Value =
dr(6).ToString()
dgv_accountdetail(5, rowNo).Value =
dr(7).ToString()
dgv_accountdetail(6, rowNo).Value =
dr(8).ToString()
dgv_accountdetail(7, rowNo).Value =
dr(9).ToString()
dgv_accountdetail(8, rowNo).Value =
dr(10).ToString()
dgv_accountdetail(9, rowNo).Value =
dr(11).ToString()
dgv_accountdetail(10, rowNo).Value =
dr(12).ToString()
rowNo = rowNo + 1
MsgBox("Search Sucessfully!")
End While
End If
Catch ex As Exception
MsgBox("An error occured while conneting to tha
Database.")
MsgBox(ex.ToString())
Finally
con.Close()
End Try
End Sub
End Sub
'To get the Employee ID from the Database
Sub get_empID()
Try
fconnect()
con.Open()
cmd = New SqlCommand("SELECT * FROM tb_employee",
con)
dr = cmd.ExecuteReader()
If (dr.HasRows) Then
While (dr.Read())
cbox_empID.Items.Add(dr(0).ToString())
End While
End If
Catch ex As Exception
MsgBox("Error cccour while trying to connect the
database")
MsgBox(ex.ToString())
Finally
con.Close()
End Try
End Sub
'To get the Employee Name from the Database
Sub get_empname()
Try
fconnect()
con.Open()
cmd = New SqlCommand("SELECT * FROM tb_employee",
con)
dr = cmd.ExecuteReader()
If (dr.HasRows) Then
While (dr.Read())
cbox_name.Items.Add(dr(1).ToString())
End While
End If
Catch ex As Exception
MsgBox("Error cccour while trying to connect the
database")
MsgBox(ex.ToString())
Finally
con.Close()
End Try
End Sub
'Print the report.
Sub printReport()
Dim paperSize As New PaperSize("Custom", 210, 300)
Dim font As New Font("Courier New", 12)
printDiag.Document = printDoc
printDiag.Document.DefaultPageSettings.PaperSize =
paperSize
printDoc.DefaultPageSettings.PaperSize.Height = 400
printDoc.DefaultPageSettings.PaperSize.Width = 200
End Sub
Private Sub view_report_Load(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
MyBase.Load
get_accID()
get_cusID()
get_empID()
get_empname()
customer.Visible = False
employee.Visible = False
End Sub
End Sub
End If
End Sub
Else
End If
Catch ex As Exception
'MsgBox("An error occured while printing the
report!")
'MsgBox(ex.ToString())
End Try
End Sub
End Class
E.TESTING AND DEBUGGING
INTRODUCTION:-
The implementation phase of software development is concerned
with translating design specification into source code. The
preliminary goal of implementation is to write source code and
internal documentation so that conformance of the code to its
specifications can be easily verified, and so that debugging,
testing and modifications are eased. This goal can be achieved
by making the source code as clear and straight forward as
possible. Simplicity, clarity and elegance are the hallmark of
good programs, obscurity, cleverness, and complexity are
indications of inadequate design and misdirected thinking.
1. Error
The term error is used in two ways. It refers to the
difference between the actual output of software and the
correct output, in this interpretation, error is essential a
measure of the difference between actual and ideal. Error is
also to used to refer to human action that result in software
containing a defect or fault.
2. Fault
Fault is a condition that causes to fail in performing its
required function. A fault is a basic reason for software
malfunction and is synonymous with the commonly used term Bug.
3. Failure
Failure is the inability of a system or component to perform a
required function according to its specifications. A software
failure occurs if the behavior of the software is the
different from the specified behavior. Failure may be caused
due to functional or performance reasons.
a. Unit Testing
The term unit testing comprises the sets of tests
performed by an individual programmer prior to
integration of the unit into a larger system.
A program unit is usually small enough that the
programmer who developed it can test it in great detail,
and certainly in greater detail than will be possible
when the unit is integrated into an evolving software
product. In the unit testing the programs are tested
separately, independent of each other. Since the check is
done at the program level, it is also called program
teasing.
b. Module Testing
A module and encapsulates related component. So can be
tested without other system module.
c. Subsystem Testing
Subsystem testing may be independently design and
implemented common problems are sub-system interface
mistake in this checking we concentrate on it.
1) Functional Test
Functional test cases involve exercising the code with Nominal
input values for which expected results are known; as well as
boundary values (minimum values, maximum values and values on
and just outside the functional boundaries) and special
values.
2) Performance Test
Performance testing determines the amount of execution time
spent in various parts of the unit, program throughput,
response time, and device utilization by the program unit. A
certain amount of avoid expending too much effort on fine-
tuning of a program unit that contributes little to the
overall performance of the entire system. Performance testing
is most productive at the subsystem and system levels.
3) Stress Test
Stress test are those designed to intentionally break the
unit. A great deal can be learned about the strengths and
limitations of a program by examining the manner in which a
program unit breaks.
4) Structure Test
Structure tests are concerned with exercising the internal
logic of a program and traversing particular execution paths.
Some authors refer collectively to functional performance and
stress testing as “black box” testing. While structure testing
is referred to as “white box” or “glass box” testing. The
major activities in structural testing are deciding which path
to exercise, deriving test date to exercise those paths,
determining the test coverage criterion to be used, executing
the test, and measuring the test coverage achieved when the
test cases are exercised.
DEBUGGING
Defect testing is intended to find areas where the program
does not confirm to its specifications. Tests are designed to
reveal the presence of defect in the system. When defect have
been found in the program. There must be discovered and
removed. This is called “Debugging”.
WEBSITES: -
1. WWW.VBTUTORIALS.COM
2. WWW.VBSOURCECODE.COM
3. WWW.LOGICATWORK.INFO