100% found this document useful (1 vote)
1K views

Banking Management System VB Project

This document is a project report for a Banking Management System submitted in partial fulfillment of a Bachelor of Computer Application degree. It includes sections on problem definition, description of the proposed system including objectives and modules, hardware and software requirements, and feasibility study. The proposed system aims to computerize banking transactions to improve security, reduce manual work, and make the system more efficient compared to the existing manual process. Key modules include account opening, deposit, withdrawal, loan payments, and viewing transaction details.

Uploaded by

Sudershan Thaiba
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
1K views

Banking Management System VB Project

This document is a project report for a Banking Management System submitted in partial fulfillment of a Bachelor of Computer Application degree. It includes sections on problem definition, description of the proposed system including objectives and modules, hardware and software requirements, and feasibility study. The proposed system aims to computerize banking transactions to improve security, reduce manual work, and make the system more efficient compared to the existing manual process. Key modules include account opening, deposit, withdrawal, loan payments, and viewing transaction details.

Uploaded by

Sudershan Thaiba
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 123

Project Report On

BANKING MANAGEMENT SYSTEM


Submitted by: Ronald Tluanglianthanga

In Partial Fulfillment of the Requirements for the


Award of the Degree
Of
Bachelor of Computer Application

To

Inspired by life

Sikkim Manipal University


Directorate of Distance

Shillong Centre-02791

June 2015
GUID CERTIFICATE

This is to certificate that this project entitled ‘BANKING


MANAGEMENT SYSTEM’ submitted in partial fulfillment of the degree of Bachelor
of Computer Application to Sikkim Manipal University, through its Shillong Centre.
Done by Ronald Tluanglianthanga, Registration Number – 1205027228 an authentic
work carried by him under guidance.

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

I would like to express my deep gratitude toward all those who


have helped me with my project.

Firstly, I would like to thank Mr. Gagan Jain, Director of Sikkim


Manipal University, Shillong centre for his kind co-operation and providing
project faculty. I am extremely grateful to the faculties if IT Department for
helping me.

I express my warm gratitude to Aldrin Sir, Department of IT for


his guidance, suggestion and encouragement.

I also express my sincere gratitude and heartfelt thanks to my


parents and family members for their encouragement in doing this project
and their everlasting support in uncounted ways in my whole education
career.

Finally, I would like to thank my friends and other staff for their
cooperation to complete this project.

With sincere gratitude,

(RONALD TLUANGLIANTHANGA)
Bachelor of Computer Application
6th Semester
Reg. No – 1205027228
Shillong.

Date :
DECLEARATION

I hereby declare that the project entitled ‘BANKING MANAGEMENT


SYSTEM’ application submitted in the partial fulfillment for the degree of
Bachelor of Computer Application to Sikkim Manipal University, Shillong
Centre is one of my own and similar report on this topic has not been
submitted for any examination and does not form a part of any
undergoes by me.

(RONALD TLUANGLIANTHANGA)
Bachelor of Computer Application
6th Semester
Reg. No - 1205027228
Contents

Unit- 1

A. Problem definition.

B. Description of the Application.

1. Existing System and Proposed System.


2. Architecture.
3. Objectives.
4. Modules.
5. About the application

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

1. MICROSOFT VISUAL STUDIO


2. MICROSOFT SQL SERVER 2005
3. WINDOWS 7

C. DATA FLOW DIAGRAM (DFD)

D. ENTITY-RELATION(ER):
Unit-3

A. DATA STRUCTURES AND DATABASE SPECIFICATIONS


1. ‘Login Info’ Table
2. ‘Customer Details’ Table
3. ‘Account Details’ Table
4. ‘Employee Details’ Table
5. ‘Loan Info’ Table

B. SOFTWARE DEVELOPMENT LIFE CYCLE

C. MODULES

D. CODING

E. TESTING AND DEBUGGING

F. FUTURE SCOPE OF THE PROJECT

G. BIBLIOGRAPHY AND REFERENCES


A. PROBLEM DEFINITION :

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.

Problems with Existing System :

 Lack of security of data.


 More man power.
 Time consuming.
 Consumes large volume of pare work.
 Needs manual calculations.
 No direct role for the higher officials.
 Damage of machines due to lack of attention.

To avoid all these limitations and make the working more accurately the system needs
to be computerized.
Proposed System

The aim of proposed system is to develop a system of improved facilities. The


proposed system can overcome all the limitations of the existing system. The system
provides proper security and reduces the manual work.

Advantages of 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 :

Two-Tier Architecture :- A two-tier architecture is where a client talks directly to a


server, with no intervening server. It is typically used in small environments(less than 50
users).

A common error in client/server development is to prototype and application in a


small, two-tier environment, and then scale up by simply adding more users to the server.
This approach will usually result in an ineffective system, as the server becomes
overwhelmed. To properly scale to hundreds or thousands of user, it is usually necessary to
move to three-tier architecture.
c. Objectives :

The basic objective of Banking Management System is to generalize and


simplify the day-to-day activities of the company like New Account opening, Daily
transaction, Report/statement etc. which is to be performed repeatedly on regular
basis. To provide efficient, fast, reliable, and user-friendly system is the basic motto
behind this exercise. A bank is a primer body is sources of money storage where we
can deposit the money when we not much needed and can withdraw whenever
require. In Bank, we can issue cheque or draft, which are other way of transferring the
money from one source to other.

This system is used by two types of users:


 Administrator
 User

Administrator can maintain records of customers, daily updating and


modifications, create new user account etc. Administrator must be an authorized user;
he can further change the password.

d. Modules :

 Open new account


 Modify an account
 Withdraw amount
 Deposit amount
 Loan payment

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.

e. About the application :

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. Minimum Hardware requirement :

 Processor – Pentium IV Intel Dual Core 1.0 GHz


 Ram - 512 MB
 Hard disk - 20 GB

b. Maximum Hardware requirement :

 Processor – Intel Dual Core i2.5 GHz and above


 Ram - 1 GB and above
 Hard disk - 100 GB and above
 Display Unit - 15” Color Monitor
 Keyboard - IBM PC Compatible
 Mouse - IBM PC Compatible
D. SOFTWARE REQUREMENTS :

a. Minimum Software requirement :

 Operating System - Windows XP with pack 2


 Developing Tool - Visual Studio 2005 Express Edition
 Database - Microsoft SQL Server 2005

b. Maximum Software requirement:

 OS window 7 home Basic (32 bit)


 Operating System - Windows 7 or above
 Developing Tool - Visual Studio 2008 or above with SQL server
compact Edition
 Database - Microsoft SQL Server 2005

 Front-end – VB.Net Microsoft Visual Studio 2008

 Back-end – Microsoft SQL server 2005


Unit-2

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.

The following are its features:

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:

 The costs conduct a full system investigation.


 The cost of the hardware and software.
 The benefits in the form of reduced costs or fewer costly errors.

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.

iii. BEHAVIORAL FEASIBILITY:

This includes the following questions:

 Is there sufficient support for the users?


 Will the proposed system cause harm?

The project would be beneficial because it satisfies the objectives when


developed and installed. All behavioral aspects are considered carefully and conclude
that the project is behaviorally feasible.

iv. OPERATIONAL FEASIBILITY:-

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.

vi. LEGAL FEASIBILITY:-

It determines whether the proposed system conflicts legal requirements.


Since the system is completely developed with an open source, freely available
software so legal issue will not arise from this system.

B. EQUIPMENT EVALUATION

i. MICROSOFT VISUAL STUDIO :

Visual programming aims at providing the user with an interface that is


intuitive and easy to use. In developing such an interface, the programmer employs
user-friendly features such as windows, menus, buttons and list boxes.

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:-

If the programmer needs to have a button then the visual programming


environment provides him with one. All that, the programmer does this select the
button and place it on screen at the required position.

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.

A visual programming environment automates the process of creating a user


interface. The interface provided by the visual programming environment to the
programmer designs the user interface visually instead of writing code.

In addition it also provides a means of associating code with each component. In


each case of calculator, for each button, we can specific that the code is to execute
when we click on it.

NEED FOR VISUAL PROGRAMMING:-

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.

ADVANTAGES OF VISUAL PROGRAMMING:-

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:-

The visual programming environment displays a list of available components. The


programmer picks up the required component from this list to display it. The
component can be moved, resized and even deleted, if so required. There is no
restriction on the number of controls that can be placed on a form. The interface
components provided by the visual programming environment have some code built
into them.

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.

ii. MICROSOFT SQL SERVER 2005:

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.

Advantages of Microsoft SQL:

 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: -

SQL is a standard computer language for accessing and manipulating databases.


 SQL stands for Structured Query Language.
 SQL allows you to access a database.
 SQL is an ANSI standard computer language.
 SQL can execute queries against a database.
 SQL can retrieve data from a database.
 SQL can insert new records in a database.
 SQL can delete records from a database.
 SQL can update records in a database.
 SQL is easy to learn.

SQL is an ANSI (American National Standards Institute) standard computer


language for accessing and manipulating database systems. SQL statements are used
to retrieve and update data in a database. SQL works with database programs like
MS Access, DB2, Informix, MS SQL Server, Oracle, Sybase, etc.

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).

SQL Database Tables: -

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.

Below is an example of a table called "Persons": -

Last Name First Name Address City

Hansen Ola Timoteivn 10 Sandnes

Svendson Tove Borgvn 23 Sandnes


Pettersen Kari Storgt 20 Stavanger

 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.

 A query like this: -

SELECT Last Name FROM Persons

SQL Data Manipulation Language (DML):

 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: -

 SELECT - extracts data from a database table


 UPDATE - updates data in a database table
 DELETE - deletes data from a database table
 INSERT INTO - inserts new data into a database table

SQL Data Definition Language (DDL) :


 The Data Definition Language (DDL) part of SQL permits database tables to be
created or deleted. We can also define indexes (keys), specify links between tables,
and impose constraints between database tables.

The most important DDL statements in SQL are: -

 CREATE TABLE - creates a new database table


 ALTER TABLE - alters (changes) a database table
 DROP TABLE - deletes a database table
 CREATE INDEX - creates an index (search key)
 DROP INDEX - deletes an index MS SQL SERVER 2005.

iii. WINDOWS 7:

Windows 7 is an operating system produced by Microsoft for use on personal


computers, including home and business desktops, laptops, net books, tablet PCs,
and media centre PCs. It was released to manufacturing on July 22, 2009, and
becomes generally available retail worldwide on October 22, 2009, less than three
years after the release of its predecessor, Widows Vista. Windows 7’s sever
counterpart, Windows Server 2008 R2, was released at the same time. Windows 7 is
succeeded by Windows 8.

Unlike Windows Vista’s many new features, Windows 7 was an incremental


upgrade designed to work with Vista-compatible applications and hardware.
Presentations given by Microsoft in 2008 focused on multi-touch support, an
updated Windows shell with a new taskbar, referred to internally as the Super bar, a
home networking system called Home Group, and perform improvements. Some
standard applications that have been with prior releases of Microsoft Windows,
including Windows Calendar, Windows Mail, Windows Movie maker, and Windows
photo gallery, are not included in Windows 7, most are instead offered separately at
no charge as part of the Windows Essentials suite.

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.

C. DATA FLOW DIAGRAM (DFD)

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:

 A squares defined a source or destination of data.


 An arrow identifies data flow, data in motion.
 A circle or a bubble represents the process that transforms incoming
data flow to outgoing data flow.
 An open rectangular is data store,data at rest or a temporary repository
of data.

Symbol Meaning
Represent entity set.

Represent the data stores.

Represents process

Represent the data flow.


CONSTRUCTING A DFD:

Several rules of thumb are used in drawing DFD’s:

 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.

SAILENT FEATURES OF DFD’S

 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.

RULES GOVERNING THE DFD’S

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.

ii. DATA STORE:


 Data cannot move directly from one data store to data store, a process
must move data.
 Data cannot move directly from an outside source to a data store, a
process, which receives, must move data from the source and place data
into data store.
 A data store has a noun phrase label.

iii. SOURCE OR SINK


The original and/or destination of data:

 Data cannot move directly from a source to sink it must be moved by a


process.
 A source and/or sink have a noun phrase land.

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 from a data store means retrieve or use.

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):

ER-modeling is a data modeling technique used in software engineering to produce a


conceptual data model of a information system. Diagrams created using this ER-modeling technique
are called Entity-Relationship Diagrams, or ER diagrams or ERDs. So you can say that Entity
Relationship Diagrams illustrate the logical structure of databases.

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.

Rectangle represents an entity set.

Ellipses represents an attributes.

Diamonds represent a relation.

Line link the attributes to entity set and entity set to


relation set.

There are three basic elements in ER-Diagrams:

 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.

 Relationships describe the relations between the entities.

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. DATA STRUCTURES AND DATABASE SPECIFICATIONS

1. ‘Login Info’ Table:-

2. ‘Customer Details’ Table :-


3. ‘Account Details’ Table:-

4. ‘Employee Details’ Table:-


5. ‘Loan Info’ Table:-
B. SOFTWARE DEVELOPMENT LIFE CYCLE

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:

Public Class welcome

Private Sub Button1_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles Button1.Click
login_form.Show()
End Sub

Private Sub Button3_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles Button3.Click
Dim close As Integer
close = MessageBox.Show("Are you sure You want to
exit?", "confirm", MessageBoxButtons.YesNo)
If (close = Windows.Forms.DialogResult.Yes) Then
MsgBox("Thank You For Using")
Application.Exit()
End If
End Sub

Private Sub Button2_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles Button2.Click
user_login.Show()
End Sub
End Class

3. Administrator Login Form:


Imports System.Data.SqlClient
Public Class login_form
Dim validUserPass As Boolean = False

'Check if Username and Password entered by user matches


with the database. Set TRUE or FALSE.
Private Sub validateUsernamePassword()
Try
validUserPass = False
fconnect()
con.Open()
cmd = New SqlCommand("SELECT * FROM tb_login WHERE
username='" & txt_username.Text & "' AND password='" &
txt_password.Text & "' AND role='Administrator'", con)
dr = cmd.ExecuteReader
If dr.HasRows Then
While dr.Read
If (txt_username.Text = dr(0).ToString()
And txt_password.Text = dr(1).ToString()) Then
validUserPass = True
Module1.loginRole = "Administrator"
Exit While
Else
validUserPass = False
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

Private Sub btn_login_Click_1(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
btn_login.Click
If txt_username.Text = "" Or txt_password.Text = ""
Then
MsgBox("Both Username And Password Has to be
Filled..!", MsgBoxStyle.Information)
Else
validateUsernamePassword()
If validUserPass = True Then
MsgBox("Login Sucessfully!")
home_form.Show()
Me.Hide()
ElseIf validUserPass = False Then
MsgBox("Username and Password does not
match!", MsgBoxStyle.Information)
End If
End If
End Sub

Private Sub btn_cancel_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
btn_cancel.Click
Me.Close()
End Sub

Private Sub Button1_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles Button1.Click
forgot_password.Show()
End Sub
End Class

4. User Login Form:

Imports System.Data.SqlClient
Public Class user_login
Dim validUserPass As Boolean = False

'Check if Username and Password entered by user matches


with the database. Set TRUE or FALSE.
Private Sub UsernamePassword()
Try
validUserPass = False
fconnect()
con.Open()
cmd = New SqlCommand("SELECT * from tb_login WHERE
username='" & txt_user.Text & "' AND password='" &
txt_pass.Text & "' AND role='User'", con)
dr = cmd.ExecuteReader
If dr.HasRows Then
While dr.Read
If (txt_user.Text = dr(0).ToString() And
txt_pass.Text = dr(1).ToString()) Then
validUserPass = True
Module1.loginRole = "User"
Exit While
Else
validUserPass = False
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

Private Sub btn_userlogin_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
btn_userlogin.Click
If txt_user.Text = "" Or txt_pass.Text = "" Then
MsgBox("Both Username And Password Has to be
Filled..!", MsgBoxStyle.Information)
Else
UsernamePassword()
If validUserPass = True Then
MsgBox("Login sucessfully!")
home_form.Show()
Me.Hide()
ElseIf validUserPass = False Then
MsgBox("Username and Password does not
match!", MsgBoxStyle.Information)
End If
End If

End Sub

Private Sub btn_usercancel_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
btn_usercancel.Click
Me.Close()
End Sub

Private Sub Button1_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles Button1.Click
forgot_password.Show()
End Sub
End Class

5. Forger password form:

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

ElseIf cbox_selectcriteria.Text = "Administrator" Then


Try
fconnect()
con.Open()
cmd = New SqlCommand("SELECT * from tb_login
WHERE username='" & txtbox_username.Text & "' ", con)
dr = cmd.ExecuteReader
If (dr.HasRows) 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
End If
End While
Else
MsgBox("Security question and Security
answer is wrong")

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

Private Sub btn_retrieve_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
btn_retrieve.Click
retrive()
GroupBox1.Visible = True
End Sub

Private Sub forgot_password_Load(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
MyBase.Load
For FadeIn = 0.0 To 1.1 Step 0.1
Me.Opacity = FadeIn
Me.Refresh()
Threading.Thread.Sleep(100)
Next
GroupBox1.Visible = False
End Sub

Private Sub Button2_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles Button2.Click
changepassword_form.Show()
btn_retrieve.Hide()
End Sub
Private Sub btn_backtologin_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
btn_backtologin.Click
txtbox_username.Text = ""
txtbox_Sanswer.Text = ""
btn_retrieve.Show()
GroupBox1.Hide()
End Sub

Private Sub ExitToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
ExitToolStripMenuItem.Click
Dim close As Integer
close = MessageBox.Show("Are you sure You want to
exit?", "confirm", MessageBoxButtons.YesNo)
If (close = Windows.Forms.DialogResult.Yes) Then
MsgBox("Thank You For Using")
Application.Exit()
End If
End Sub

Private Sub HToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
HToolStripMenuItem.Click
welcome.Show()
Me.Hide()
End Sub
End Class

6. Change Password Form:

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

Private Sub changepassword_form_Load(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
MyBase.Load
cbox_selectcriteria.Text = "Select the Account"
For FadeIn = 0.0 To 1.1 Step 0.1
Me.Opacity = FadeIn
Me.Refresh()
Threading.Thread.Sleep(100)
Next
End Sub

Private Sub btn_cancel_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
btn_cancel.Click
cancel1()
btn_cancel.Hide()
End Sub

Private Sub btn_refresh_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
btn_refresh.Click
cancel1()
btn_cancel.Show()
btn_change.Show()

End Sub

Private Sub ExitToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
ExitToolStripMenuItem.Click
Dim close As Integer
close = MessageBox.Show("Are you sure You want to
exit?", "confirm", MessageBoxButtons.YesNo)
If (close = Windows.Forms.DialogResult.Yes) Then
MsgBox("Thank You For Using")
Application.Exit()
End If
End Sub

Private Sub btn_change_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
btn_change.Click
If txtbox_newpassword.Text =
txtbox_confirmpassword.Text Then
UsernamePassword()
btn_change.Hide()
Else
MsgBox("Password doesnot match with Username,
Please check and Try again!")
End If

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

Private Sub HomeToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
HomeToolStripMenuItem.Click
home_form.Show()
Me.Hide()
End Sub
End Class

7. Main(Home) Form:

Public Class home_form

'Check whether Administrator/User has logged in and


show/hide appopriate controls.
Sub checkRole()
If (Module1.loginRole = "Administrator") Then
addmin_panel.Visible = True
user_panel.Visible = False
lb_login.Text = "Administrator"
lb_login.Visible = True
btn_user.Visible = False
btn_a.Visible = True
ElseIf (Module1.loginRole = "User") Then
addmin_panel.Visible = False
user_panel.Visible = True
lb_login.Text = "User"
lb_login.Visible = True
btn_user.Visible = True
btn_a.Visible = False
End If
End Sub

Private Sub Button6_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles homepage.Click
add_newaccount.Show()
End Sub

Private Sub Button1_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles Button1.Click
Add_new_employee.Show()
End Sub

Private Sub Button2_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles Button2.Click
Delete_Update_Employee.Show()
End Sub

Private Sub Button7_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles Button7.Click
deposit_form.Show()
End Sub

Private Sub Button8_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles Button8.Click
Withdraw_form.Show()
End Sub

Private Sub Button10_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles Button10.Click
Loan_form.Show()
End Sub

Private Sub Button5_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles Button5.Click
View_Update_salary.Show()
End Sub
Private Sub Button4_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Button4.Click
Set_Salary.Show()

End Sub

Private Sub Button9_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles Button9.Click
Transfer_account.Show()
End Sub

Private Sub Button3_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles Button3.Click
view_report.Show()

End Sub

Private Sub home_form_Load(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles MyBase.Load
checkRole()
lb_time.Text = DateAndTime.Now

End Sub
End Class

8. Add New Employee Form:

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")

Dim rowNo As Integer = 0


Try
fconnect()
con.Open()
cmd = New SqlCommand("SELECT * FROM tb_employee",
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 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

Private Sub btn_save_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles btn_save.Click
If txt_empname.Text = "" Then
MsgBox("Please enter Employee's Father/Mother
Name")
MsgBox("Please enter Employee Name!")
ElseIf txt_parentsname.Text = "" Then
ElseIf cbox_sex.Text = "" Then
MsgBox("Please Select the Gender/Sex of the
Employee!")
ElseIf cbox_marrital.Text = "" Then
MsgBox("Please Select the Marrital Status of
Employee")
ElseIf txt_contact.Text = "" Then
MsgBox("Please enter the Contact Number!")
ElseIf txt_address.Text = "" Then
MsgBox("Please enter the Address!")
ElseIf txt_qualification.Text = "" Then
MsgBox("Please enter The Qualification!")
ElseIf txt_branchname.Text = "" Then
MsgBox("Please enter Branch Name!")
ElseIf cbox_empstatus.Text = "" Then
MsgBox("Please enter Employee Status!")
Else
save_newaccount()
dgy_employee()
emp_refresh()
btn_save.Visible = False
End If

End Sub

Private Sub cccvv_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles btn_refresh.Click
emp_refresh()
btn_save.Visible = True
End Sub

Private Sub Add_new_employee_Load(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
MyBase.Load
For FadeIn = 0.0 To 1.1 Step 0.1
Me.Opacity = FadeIn
Me.Refresh()
Threading.Thread.Sleep(100)
Next
dgy_employee()
End Sub

Private Sub btn_back_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles btn_back.Click
home_form.Show()
Me.Hide()
End Sub
Private Sub EXITToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
EXITToolStripMenuItem.Click
Dim close As Integer
close = MessageBox.Show("Are you sure You want to
exit?", "confirm", MessageBoxButtons.YesNo)
If (close = Windows.Forms.DialogResult.Yes) Then
MsgBox("Thank You For Using")
Application.Exit()
End If
End Sub

Private Sub BACKToolStripMenuItem1_Click(ByVal sender As


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

Private Sub BACKToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
BACKToolStripMenuItem.Click
home_form.Show()
Me.Hide()
End Sub
End Class

9. Delete/ Update Employee Form:

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

Private Sub Delete_Update_Employee_Load(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
MyBase.Load
get_empId()
btn_delete.Visible = False
btn_update.Visible = False

End Sub

Private Sub btn_search_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
btn_search.Click
search_emp()
dgy_employee()
btn_delete.Show()
btn_update.Show()
End Sub

Private Sub btn_delete_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
btn_delete.Click
delete_emp()
dgy_employee()
emp_refresh()
btn_delete.Hide()
End Sub

Private Sub btn_update_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
btn_update.Click
updatenewaccount()
emp_refresh()
dgy_employee()
btn_update.Hide()
End Sub

Private Sub BACKToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
BACKToolStripMenuItem.Click
home_form.Show()
Me.Hide()
End Sub
Private Sub EXITToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
EXITToolStripMenuItem.Click
Dim close As Integer
close = MessageBox.Show("Are you sure You want to
exit?", "confirm", MessageBoxButtons.YesNo)
If (close = Windows.Forms.DialogResult.Yes) Then
MsgBox("Thank You For Using")
Application.Exit()
End If
End Sub
End Class

10. Set Salary Form:

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

Private Sub btn_info_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles btn_info.Click
get_details()
group_setsal.Visible = True
End Sub

Private Sub btn_setsalary_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
btn_setsalary.Click
Set_Salary()
group_setsal.Visible = False
End Sub

Private Sub BACKToolStripMenuItem_Click(ByVal sender As


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

Private Sub EIXTToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
EIXTToolStripMenuItem.Click
Dim close As Integer
close = MessageBox.Show("Are you sure You want to
exit?", "confirm", MessageBoxButtons.YesNo)
If (close = Windows.Forms.DialogResult.Yes) Then
MsgBox("Thank You For Using")
Application.Exit()
End If
End Sub

End Class

11. View/Update Salary Form:

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

Private Sub btn_update_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
btn_update.Click
update_salary()
dgy_emp()
emp_refresh()
btn_update.Visible = False
End Sub

Private Sub btn_info_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles btn_info.Click
dgy_emp()
get_details()
gbox_setsal.Visible = True
End Sub

Private Sub BACKToolStripMenuItem_Click(ByVal sender As


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

Private Sub EXITToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
EXITToolStripMenuItem.Click
Dim close As Integer
close = MessageBox.Show("Are you sure You want to
exit?", "confirm", MessageBoxButtons.YesNo)
If (close = Windows.Forms.DialogResult.Yes) Then
MsgBox("Thank You For Using")
Application.Exit()
End If
End Sub
End Class

12. Add New customer Details Form:

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

Dim bl_updatenewaccount As Boolean = False

'Get the Account Types from the database.


Sub getAccountTypes()
Try
fconnect()
con.Open()
cmd = New SqlCommand("SELECT * FROM
tb_accounttype", con)
dr = cmd.ExecuteReader()
If (dr.HasRows) Then
While (dr.Read())

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

'To save a new account the DB the table called


'tb_newaccount'
Sub save_newaccount()
Try
firstname = txt_firstname.Text
middlename = txt_middlename.Text
lastname = txt_lastname.Text
branchname = txt_branchname.Text
accounttype = cbox_accounttype.Text
birthday =
date_of_birth.Value.ToString("MM/dd/yyyy hh:mm:ss tt")
sex = cbox_sex.Text
city = txt_city.Text
state = txt_city.Text
pincode = txt_pincode.Text
email = txt_email.Text
mobileno = txt_mobileno.Text
telno = txt_telephoneno.Text
occupation = txt_occupation.Text
coresadd = txt_corresponadd.Text
peradd = txt_permanentadd.Text
fconnect()
con.Open()
cmd = New SqlCommand("INSERT INTO tb_newaccount
Values ('" & firstname & "','" & middlename & "','" & lastname
& "','" & branchname & "','" & accounttype & "','" & birthday
& "','" & sex & "','" & city & "','" & state & "'," & pincode
& ",'" & email & "'," & mobileno & "," & telno & ",'" &
occupation & "','" & coresadd & "','" & peradd & "')", 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 Update New account.


Sub updatenewaccount()
Try
fconnect()
con.Open()
cmd = New SqlCommand("UPDATE tb_newaccount SET
First_name = '" + txt_firstname.Text + "', Middle_name = '" +
txt_middlename.Text + "',Last_name = '" + txt_lastname.Text +
"',Branch_name = '" + txt_branchname.Text + "',Account_type =
'" + cbox_accounttype.Text + "',Date_of_birth = '" +
date_of_birth.Value.ToString("MM/dd/yyyy hh:mm:ss tt") +
"',sex = '" + cbox_sex.Text + "',City = '" + txt_city.Text +
"',State = '" + txt_city.Text + "',Pincode = '" +
txt_pincode.Text + "',E_mail = '" + txt_email.Text +
"',mobile_no = '" + txt_mobileno.Text + "',telephone = '" +
txt_telephoneno.Text + "',Occupation = '" +
txt_occupation.Text + "',Correspondence_address = '" +
txt_corresponadd.Text + "',Permanent_address = '" +
txt_permanentadd.Text + "' WHERE Customer_ID= '" +
cbox_custID.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
'To Delete an account on its ID
Sub delete_account()
Try
fconnect()
con.Open()
cmd = New SqlCommand("DELETE FROM tb_newaccount
WHERE Customer_ID='" + cbox_custID.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

'To retrive the Account from Database.


Sub retriveaccount()
Try
fconnect()
con.Open()
cmd = New SqlCommand("SELECT * FROM tb_newaccount
WHERE Customer_ID='" + cbox_custID.Text + "'", con)
dr = cmd.ExecuteReader()
If (dr.HasRows) Then
While (dr.Read())
txt_firstname.Text = dr(1).ToString()
txt_middlename.Text = dr(2).ToString()
txt_lastname.Text = dr(3).ToString()
txt_branchname.Text = dr(4).ToString()
cbox_accounttype.Text = dr(5).ToString()
date_of_birth.Text = dr(6).ToString()
cbox_sex.Text = dr(7).ToString()
txt_city.Text = dr(8).ToString()
txt_state.Text = dr(9).ToString()
txt_pincode.Text = dr(10).ToString()
txt_email.Text = dr(11).ToString()
txt_mobileno.Text = dr(12).ToString()
txt_telephoneno.Text = dr(13).ToString()
txt_occupation.Text = dr(14).ToString()
txt_corresponadd.Text = dr(15).ToString()
txt_permanentadd.Text = dr(16).ToString()
End While
End If
dr.Close()
Catch ex As Exception
Finally
con.Close()
End Try
End Sub

'To put in the DataGridView


Sub dgy_accountdetail()
dgv_accountdetail.Rows.Clear()
dgv_accountdetail.Columns.Clear()
'Creating Columns in Datagridview
dgv_accountdetail.Columns.Add("Customer_ID", "Customer
ID")
dgv_accountdetail.Columns.Add("First_name",
"Firstname")
dgv_accountdetail.Columns.Add("Middle_name",
"Middlename")
dgv_accountdetail.Columns.Add("Last_name", "Lastname")
dgv_accountdetail.Columns.Add("Banch_name",
"Branchname")
dgv_accountdetail.Columns.Add("Account_type", "Account
type")
dgv_accountdetail.Columns.Add("Date_of_birth", "DBO")
dgv_accountdetail.Columns.Add("Sex", "Sex")
dgv_accountdetail.Columns.Add("City", "City")
dgv_accountdetail.Columns.Add("State", "State")
dgv_accountdetail.Columns.Add("Pincode", "Pincode")
dgv_accountdetail.Columns.Add("E_mail", "E-mai")
dgv_accountdetail.Columns.Add("mobile_no", "Moblie")
dgv_accountdetail.Columns.Add("Telephone",
"Telephone")
dgv_accountdetail.Columns.Add("Occupation",
"Occupation")

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

Private Sub btn_save_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles btn_save.Click
If txt_firstname.Text = "" Then
MsgBox("Please enter First Name!")
ElseIf txt_middlename.Text = "" Then
MsgBox("Please enter the middle name")
ElseIf txt_lastname.Text = "" Then
MsgBox("Please enter the last name!")
ElseIf txt_branchname.Text = "" Then
MsgBox("Please enter the Branch name!")
ElseIf cbox_accounttype.Text = "" Then
MsgBox("Please enter the account type")
ElseIf date_of_birth.Text = "" Then
MsgBox("Please enter the Date of Birth!")
ElseIf cbox_accounttype.Text = "" Then
MsgBox("Please enter the Date of Birth!")
ElseIf cbox_sex.Text = "" Then
MsgBox("Please enter the status!")
ElseIf txt_city.Text = "" Then
MsgBox("Please enter the city!")
ElseIf txt_state.Text = "" Then
MsgBox("Please enter the States!")
ElseIf txt_pincode.Text = "" Then
MsgBox("Please enter the pincode !")
ElseIf txt_email.Text = "" Then
MsgBox("Please enter the Email address!")
ElseIf txt_mobileno.Text = "" Then
MsgBox("Please enter Mobile number!")
ElseIf txt_corresponadd.Text = "" Then
MsgBox("Please enter the Corresponcedent
Address!")
ElseIf txt_permanentadd.Text = "" Then
MsgBox("Please enter the permanent address !")
Else
save_newaccount()
dgy_accountdetail()
getCustomerID()
btn_save.Visible = False
End If
End Sub

Private Sub btn_update_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
btn_update.Click
btn_update.Visible = False
updatenewaccount()
dgy_accountdetail()
End Sub
Private Sub dgv_accountdetail_CellContentClick(ByVal
sender As System.Object, ByVal e As
System.Windows.Forms.DataGridViewCellEventArgs) Handles
dgv_accountdetail.CellContentClick
dgy_accountdetail()
End Sub

Private Sub add_newaccount_Load(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
MyBase.Load
btn_update.Visible = False
btn_delete.Visible = False
getCustomerID()
getAccountTypes()
Dim todsysDate As DateTime = DateTime.Now
MsgBox(todsysDate.ToString())
End Sub

Private Sub btn_search_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
btn_search.Click
btn_save.Visible = False
btn_delete.Visible = True
btn_update.Visible = True
retriveaccount()
dgy_accountdetail()
End Sub

Private Sub btn_delete_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
btn_delete.Click
btn_delete.Show()
delete_account()
dgy_accountdetail()
getCustomerID()
End Sub

Private Sub BackToolStripMenuItem_Click(ByVal sender As


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

Private Sub ExitToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
ExitToolStripMenuItem.Click
home_form.Show()
Me.Hide()
End Sub
Private Sub ExitToolStripMenuItem1_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
ExitToolStripMenuItem1.Click
Dim close As Integer
close = MessageBox.Show("Are you sure You want to
exit?", "confirm", MessageBoxButtons.YesNo)
If (close = Windows.Forms.DialogResult.Yes) Then
MsgBox("Thank You For Using")
Application.Exit()
End If
End Sub

Private Sub btn_browse_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
btn_browse.Click
OpenFileDialog.ShowDialog()
End Sub

Private Sub OpenFileDialog_FileOk(ByVal sender As


System.Object, ByVal e As
System.ComponentModel.CancelEventArgs) Handles
OpenFileDialog.FileOk
box_picture.ImageLocation = OpenFileDialog.FileName
txt_photo.Text = OpenFileDialog.FileName
End Sub

Private Sub btn_openacc_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
btn_openacc.Click
Account_detail.Show()
Me.Hide()
End Sub
End Class
13. Open account for customer Form:

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

'To get the Branch name and Account type


Sub getbranchname()
Try
fconnect()
con.Open()
cmd = New SqlCommand("SELECT * FROM tb_newaccount
WHERE Customer_ID='" + cbox_custID.Text + "'", con)
dr = cmd.ExecuteReader()
If (dr.HasRows) Then
While (dr.Read())
txt_branchname.Text = dr(4).ToString()
txt_acctype.Text = dr(5).ToString()

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")

Dim rowNo As Integer = 0


Try
fconnect()
con.Open()
cmd = New SqlCommand("SELECT * FROM
account_detail", 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()

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

Private Sub Account_detail_Load(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
MyBase.Load
For FadeIn = 0.0 To 1.1 Step 0.1
Me.Opacity = FadeIn
Me.Refresh()
Threading.Thread.Sleep(100)
Next
getCustomerID()
getaccID()
dgy_accountdetail()
Button1.Hide()

End Sub

Private Sub btn_cusinfo_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
btn_cusinfo.Click
getbranchname()
Button1.Show()
End Sub

Private Sub Button1_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles Button1.Click
save_account()
getaccID()
dgy_accountdetail()
Button1.Hide()

End Sub

Private Sub Button3_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles Button3.Click
delete_account()
getaccID()
dgy_accountdetail()
End Sub

Private Sub BackToHomeToolStripMenuItem_Click(ByVal sender


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

Private Sub BackToolStripMenuItem_Click(ByVal sender As


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

Private Sub ExitToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
ExitToolStripMenuItem.Click
Dim close As Integer
close = MessageBox.Show("Are you sure You want to
exit?", "confirm", MessageBoxButtons.YesNo)
If (close = Windows.Forms.DialogResult.Yes) Then
MsgBox("Thank You For Using")
Application.Exit()
End If
End Sub

End Class
14. Deposit Form:

Imports System.Data.SqlClient
Public Class deposit_form

'Get the Account Number from the database.


Sub get_accountID()
Try
fconnect()
con.Open()
cmd = New SqlCommand("SELECT * FROM
account_detail", con)
dr = cmd.ExecuteReader()
If (dr.HasRows) Then
While (dr.Read())
cbox_accountno.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
'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

Private Sub deposit_form_Load(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
MyBase.Load
For FadeIn = 0.0 To 1.1 Step 0.1
Me.Opacity = FadeIn
Me.Refresh()
Threading.Thread.Sleep(100)
Next
btn_deposit.Visible = False
get_accountID()
txt_depositamt.Text = ".00"
End Sub
Private Sub btn_showbal_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
btn_showbal.Click
btn_deposit.Visible = True
get_actualbal()
End Sub

Private Sub txt_depositamt_TextChanged(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
txt_depositamt.TextChanged
Dim actualBal As Decimal
Dim depositAmt As Decimal
Dim finalBal As Decimal = 0

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

finalBal = actualBal + depositAmt


txt_finalbal.Text = finalBal.ToString()
End Sub

Private Sub ExitToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
ExitToolStripMenuItem.Click
Dim close As Integer
close = MessageBox.Show("Are you sure You want to
exit?", "confirm", MessageBoxButtons.YesNo)
If (close = Windows.Forms.DialogResult.Yes) Then
MsgBox("Thank You For Using")
Application.Exit()
End If
End Sub

Private Sub BackToolStripMenuItem_Click(ByVal sender As


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

Private Sub HomeToolStripMenuItem_Click(ByVal sender As


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

Private Sub btn_deposit_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
btn_deposit.Click
deposite()
btn_deposit.Visible = False
End Sub
End Class

15. Withdraw Form:


Imports System.Data.SqlClient

Public Class Withdraw_form

'Get the Account Number from the database.


Sub get_accountID()
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 connect the
database!")
MsgBox(ex.ToString())
Finally
con.Close()

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

Private Sub btn_withdraw_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
btn_withdraw.Click
withdrawl()
btn_withdraw.Visible = False
End Sub

Private Sub Withdraw_form_Load(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
MyBase.Load
For FadeIn = 0.0 To 1.1 Step 0.1
Me.Opacity = FadeIn
Me.Refresh()
Threading.Thread.Sleep(100)
Next
btn_withdraw.Visible = False
get_accountID()
txt_withdrwlamount.Text = ".00"
End Sub

Private Sub btn_show_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles btn_show.Click
btn_withdraw.Visible = True
get_actualbal()
End Sub

Private Sub txt_withdrwlamount_TextChanged(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
txt_withdrwlamount.TextChanged
Dim actualBal As Decimal
Dim withrawlAmt As Decimal
Dim finalBal As Decimal = 0

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

finalBal = actualBal - withrawlAmt


txt_finalbal.Text = finalBal.ToString()
End Sub

Private Sub ExitToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
ExitToolStripMenuItem.Click
Dim close As Integer
close = MessageBox.Show("Are you sure You want to
exit?", "confirm", MessageBoxButtons.YesNo)
If (close = Windows.Forms.DialogResult.Yes) Then
MsgBox("Thank You For Using")
Application.Exit()
End If
End Sub

Private Sub BackToolStripMenuItem_Click(ByVal sender As


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

Private Sub HomeToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
HomeToolStripMenuItem.Click
home_form.Show()
Me.Hide()
End Sub
End Class

16. Transfer Form:

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

'Get the Account Number from the database.


Sub get_debit_accountID()
Try
fconnect()
con.Open()
cmd = New SqlCommand("SELECT * FROM
account_detail", con)
dr = cmd.ExecuteReader()
If (dr.HasRows) Then
While (dr.Read())
cbox_debaccno.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
'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

Private Sub Transfer_account_Load(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
MyBase.Load
For FadeIn = 0.0 To 1.1 Step 0.1
Me.Opacity = FadeIn
Me.Refresh()
Threading.Thread.Sleep(100)
Next
btn_transfer.Visible = False
get_credit_accountID()
get_debit_accountID()

End Sub

Private Sub btn_transfer_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
btn_transfer.Click
Dim a, b As Decimal
a = txt_debbal.Text
b = txt_transfer_amt.Text
a = Convert.ToDecimal(txt_debbal.Text)
b = Convert.ToDecimal(txt_transfer_amt.Text)
If a < b Then
MsgBox("The Amount you Enter is Greater than Debit
Account Balance, Please check and Enter again!")
Else
debit_transfer()
credit_tranfer()
MsgBox("Transfer Successfully !",
MsgBoxStyle.Information)
btn_transfer.Hide()
cbox_credaccno.Text = ""
cbox_debaccno.Text = ""
txt_transfer_amt.Text = ""
txt_debbal.Text = ""

End If

End Sub

Private Sub BACKToolStripMenuItem_Click(ByVal sender As


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

Private Sub btn_debOK_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles btn_debOK.Click
debit_bal()
btn_transfer.Visible = True
End Sub

Private Sub EXITToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
EXITToolStripMenuItem.Click
Dim close As Integer
close = MessageBox.Show("Are you sure You want to
exit?", "confirm", MessageBoxButtons.YesNo)
If (close = Windows.Forms.DialogResult.Yes) Then
MsgBox("Thank You For Using")
Application.Exit()
End If
End Sub
End Class

17. Loan Form:


Imports System.Data.SqlClient
Public Class Loan_form
'Get the Account Number from the database.
Sub get_accountID()
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 retrieving the Account
Types from the database!")
MsgBox(ex.ToString())
Finally
con.Close()

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

Private Sub Loan_form_Load(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles MyBase.Load
For FadeIn = 0.0 To 1.1 Step 0.1
Me.Opacity = FadeIn
Me.Refresh()
Threading.Thread.Sleep(100)
Next
btn_sanction.Visible = False
get_accountID()
End Sub

Private Sub btn_sanction_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
btn_sanction.Click
btn_sanction.Visible = False
loan_sanction()
refresh_loan()
End Sub

Private Sub txt_rit_Leave(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles txt_rit.Leave
txt_loanreturn.Text = (((Convert.ToInt32(txt_rit.Text)
/ (100)) * (Convert.ToInt32(txt_loansacntion.Text))) +
(Convert.ToInt32(txt_loansacntion.Text)))
End Sub

Private Sub btn_getinfo_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
btn_getinfo.Click
btn_sanction.Visible = True
getbranchname()
End Sub

Private Sub txt_loanreturn_Leave(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
txt_loanreturn.Leave
txt_currentloan.Text = txt_loanreturn.Text
End Sub

Private Sub txt_currentloan_Leave(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
txt_currentloan.Leave
txt_finalbal.Text = txt_currentloan.Text
End Sub

Private Sub BackToolStripMenuItem_Click(ByVal sender As


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

Private Sub ExitToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
ExitToolStripMenuItem.Click
Dim close As Integer
close = MessageBox.Show("Are you sure You want to
exit?", "confirm", MessageBoxButtons.YesNo)
If (close = Windows.Forms.DialogResult.Yes) Then
MsgBox("Thank You For Using")
Application.Exit()
End If
End Sub

Private Sub HomeToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
HomeToolStripMenuItem.Click
home_form.Show()
Me.Hide()
End Sub
Private Sub btn_loanpay_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
btn_loanpay.Click
Loan_payment.Show()
Me.Hide()
End Sub
End Class

18. Loan Payment Form:

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

Private Sub btn_deposite_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
btn_deposite.Click
loan_deposite()
loan_refresh()
btn_deposite.Hide()
End Sub
Private Sub Loan_payment_Load(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
MyBase.Load
For FadeIn = 0.0 To 1.1 Step 0.1
Me.Opacity = FadeIn
Me.Refresh()
Threading.Thread.Sleep(100)
Next
get_loanID()
btn_deposite.Visible = False

End Sub

Private Sub btn_getinfo_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
btn_getinfo.Click
get_details()
btn_deposite.Visible = True
End Sub

Private Sub txt_depositamt_TextChanged(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
txt_depositamt.TextChanged
Dim amttoreturn As Decimal
Dim depositAmt As Decimal
Dim finalBal As Decimal = 0

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

finalBal = amttoreturn - depositAmt


txt_balance.Text = finalBal.ToString()
End Sub

Private Sub BackToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
BackToolStripMenuItem.Click
Loan_form.Show()
Me.Hide()
End Sub
Private Sub ExitToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
ExitToolStripMenuItem.Click
Dim close As Integer
close = MessageBox.Show("Are you sure You want to
exit?", "confirm", MessageBoxButtons.YesNo)
If (close = Windows.Forms.DialogResult.Yes) Then
MsgBox("Thank You For Using")
Application.Exit()
End If
End Sub

Private Sub HomeToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
HomeToolStripMenuItem.Click
home_form.Show()
Me.Hide()
End Sub
End Class
View Report:

Imports System.Data.SqlClient
Imports System.Drawing.Printing
Imports System.Drawing
Public Class view_report

'To put in the DataGridView for view by Customer ID


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")

Dim rowNo As Integer = 0


Try
fconnect()
con.Open()
cmd = New SqlCommand("SELECT * FROM account_detail
WHERE Customer_ID = " & cbox_CusID.Text & " ", 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()

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")

Dim rowNo As Integer = 0


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())
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 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")

Dim rowNo As Integer = 0


Try
fconnect()
con.Open()
cmd = New SqlCommand("SELECT * FROM account_detail
", 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()

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")

Dim rowNo As Integer = 0


Try
fconnect()
con.Open()
cmd = New SqlCommand("SELECT * FROM tb_employee",
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(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")

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_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")

Dim rowNo As Integer = 0


Try
fconnect()
con.Open()
cmd = New SqlCommand("SELECT * FROM tb_employee
WHERE Emp_Name='" & cbox_name.Text & "' ", 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(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 get Account ID from the database


Sub get_accID()
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 retrieving the Account
Types from the database!")
MsgBox(ex.ToString())
Finally
con.Close()
End Try
End Sub
'To get the Customer ID from the database
Sub get_cusID()
Try
fconnect()
con.Open()
cmd = New SqlCommand("SELECT * FROM
account_detail", con)
dr = cmd.ExecuteReader()
If (dr.HasRows) Then
While (dr.Read())
cbox_CusID.Items.Add(dr(1).ToString())
End While
End If
Catch ex As Exception
MsgBox("Error occur while trying to connect the
Database")
MsgBox(ex.ToString())
Finally
con.Close()
End Try

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

Dim result As DialogResult = printDiag.ShowDialog()


If (result = Windows.Forms.DialogResult.OK) Then
Dim printPreview As New PrintPreviewDialog()
printPreview.Document = printDoc
result = printPreview.ShowDialog()
If (result = Windows.Forms.DialogResult.OK) Then
printDoc.Print()
End If
End If

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

Private Sub btn_debOK_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles btn_debOK.Click
If cbox_viewby.Text = "Account ID" Then
dgy_accountIDdetail()
ElseIf cbox_viewby.Text = "Customer ID" Then
dgy_accountdetail()
ElseIf cbox_viewby.Text = "All" Then
dgy_accountAlldetail()
End If

End Sub

Private Sub BACKToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
BACKToolStripMenuItem.Click
home_form.Show()
Me.Hide()
End Sub
Private Sub EXITToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
EXITToolStripMenuItem.Click
Dim close As Integer
close = MessageBox.Show("Are you sure You want to
exit?", "confirm", MessageBoxButtons.YesNo)
If (close = Windows.Forms.DialogResult.Yes) Then
MsgBox("Thank You For Using")
Application.Exit()
End If
End Sub

Private Sub cbox_debaccno_SelectedIndexChanged(ByVal


sender As System.Object, ByVal e As System.EventArgs) Handles
cbox_viewby.SelectedIndexChanged
If cbox_viewby.Text = "Account ID" Then
cbox_accID.Visible = True
cbox_CusID.Visible = False
ElseIf cbox_viewby.Text = "Customer ID" Then
cbox_CusID.Visible = True
cbox_accID.Visible = False
ElseIf cbox_viewby.Text = "All" Then
cbox_accID.Visible = False
cbox_CusID.Visible = False
Else
cbox_accID.Visible = False
cbox_CusID.Visible = False
btn_debOK.Visible = False
End If
End Sub

Private Sub cbox_empviewby_SelectedIndexChanged(ByVal


sender As System.Object, ByVal e As System.EventArgs) Handles
cbox_empviewby.SelectedIndexChanged
If cbox_empviewby.Text = "Employee ID" Then
cbox_empID.Visible = True
cbox_name.Visible = False
ElseIf cbox_empviewby.Text = "Name" Then
cbox_name.Visible = True
cbox_empID.Visible = False
ElseIf cbox_empviewby.Text = "All" Then
cbox_empID.Visible = False
cbox_name.Visible = False
End If
End Sub

Private Sub cbox_report_SelectedIndexChanged(ByVal sender


As System.Object, ByVal e As System.EventArgs) Handles
cbox_report.SelectedIndexChanged
cbox_accID.Visible = False
cbox_CusID.Visible = False
cbox_empID.Visible = False
cbox_name.Visible = False
If cbox_report.Text = "Employee" Then
employee.Visible = True
customer.Visible = False
Else
customer.Visible = True
employee.Visible = False
End If
End Sub

Private Sub btn_empOK_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles btn_empOK.Click
If cbox_empviewby.Text = "Employee ID" Then
employee_ID()

ElseIf cbox_empviewby.Text = "Name" Then


employee_name()

ElseIf cbox_empviewby.Text = "All" Then


employee_all()

End If
End Sub

Private Sub btn_print_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles btn_print.Click
printReport()
End Sub

Private Sub printDoc_PrintPage(ByVal sender As


System.Object, ByVal e As
System.Drawing.Printing.PrintPageEventArgs) Handles
printDoc.PrintPage
Try
Dim offset As Integer = 20
Dim g As Graphics = e.Graphics

Dim font As New Font("Courier New", 7)


Dim fontHeight As Single = font.GetHeight()

Dim optionSelected As String


optionSelected = cbox_report.Text
Dim underLine As String = "-----------------------
--------------------------------------------------------------
---------------------------------------------"
If optionSelected = "Customer" Then

'Draw the Headings.


g.DrawString("Customer Report", font, New
SolidBrush(Color.Black), 500, 40)
g.DrawString(underLine, font, New
SolidBrush(Color.Black), 130, 55)
g.DrawString("Account ID", font, New
SolidBrush(Color.Black), 10, 70)
g.DrawString("Customer ID", font, New
SolidBrush(Color.Black), 120, 70)
g.DrawString("Branch Name", font, New
SolidBrush(Color.Black), 250, 70)
g.DrawString("Account Type", font, New
SolidBrush(Color.Black), 400, 70)
g.DrawString("Account Open Date", font, New
SolidBrush(Color.Black), 550, 70)
g.DrawString("Opening Balance", font, New
SolidBrush(Color.Black), 730, 70)
g.DrawString("Closing Balance", font, New
SolidBrush(Color.Black), 900, 70)
g.DrawString("Final Balance", font, New
SolidBrush(Color.Black), 1050, 70)

'Draw the actual report data.


Dim x As Integer = 30
Dim y As Integer = 100
For i = 0 To dgv_accountdetail.RowCount - 1
g.DrawString(dgv_accountdetail(0,
i).Value.ToString(), font, New SolidBrush(Color.Black), x, y)
g.DrawString(dgv_accountdetail(1,
i).Value.ToString(), font, New SolidBrush(Color.Black), x +
120, y)
g.DrawString(dgv_accountdetail(2,
i).Value.ToString(), font, New SolidBrush(Color.Black), x +
220, y)
g.DrawString(dgv_accountdetail(3,
i).Value.ToString(), font, New SolidBrush(Color.Black), x +
360, y)
g.DrawString(dgv_accountdetail(4,
i).Value.ToString(), font, New SolidBrush(Color.Black), x +
520, y)
g.DrawString(dgv_accountdetail(5,
i).Value.ToString(), font, New SolidBrush(Color.Black), x +
730, y)
g.DrawString(dgv_accountdetail(6,
i).Value.ToString(), font, New SolidBrush(Color.Black), x +
910, y)
g.DrawString(dgv_accountdetail(7,
i).Value.ToString(), font, New SolidBrush(Color.Black), x +
1050, y)
y = y + offset
Next
ElseIf optionSelected = "Employee" Then
'Draw the Headings.
g.DrawString("Employee Report", font, New
SolidBrush(Color.Black), 500, 40)
g.DrawString(underLine, font, New
SolidBrush(Color.Black), 130, 55)
g.DrawString("ID", font, New
SolidBrush(Color.Black), 20, 70)
g.DrawString("Name", font, New
SolidBrush(Color.Black), 90, 70)
g.DrawString("DOB", font, New
SolidBrush(Color.Black), 230, 70)
g.DrawString("Sex", font, New
SolidBrush(Color.Black), 330, 70)
g.DrawString("Contact No", font, New
SolidBrush(Color.Black), 400, 70)
g.DrawString("Address", font, New
SolidBrush(Color.Black), 520, 70)
g.DrawString("Qualification", font, New
SolidBrush(Color.Black), 630, 70)
g.DrawString("Branch Name", font, New
SolidBrush(Color.Black), 750, 70)
g.DrawString("DOJ", font, New
SolidBrush(Color.Black), 880, 70)
g.DrawString("Status", font, New
SolidBrush(Color.Black), 1000, 70)
g.DrawString("Salary", font, New
SolidBrush(Color.Black), 1100, 70)

'Draw the actual report data.


Dim x As Integer = 20
Dim y As Integer = 100
For i = 0 To dgv_accountdetail.RowCount - 1
g.DrawString(dgv_accountdetail(0,
i).Value.ToString(), font, New SolidBrush(Color.Black), x, y)
g.DrawString(dgv_accountdetail(1,
i).Value.ToString(), font, New SolidBrush(Color.Black), x +
50, y)
g.DrawString(dgv_accountdetail(2,
i).Value.ToString(), font, New SolidBrush(Color.Black), x +
160, y)
g.DrawString(dgv_accountdetail(3,
i).Value.ToString(), font, New SolidBrush(Color.Black), x +
310, y)
g.DrawString(dgv_accountdetail(4,
i).Value.ToString(), font, New SolidBrush(Color.Black), x +
390, y)
g.DrawString(dgv_accountdetail(5,
i).Value.ToString(), font, New SolidBrush(Color.Black), x +
500, y)
g.DrawString(dgv_accountdetail(6,
i).Value.ToString(), font, New SolidBrush(Color.Black), x +
630, y)
g.DrawString(dgv_accountdetail(7,
i).Value.ToString(), font, New SolidBrush(Color.Black), x +
740, y)
g.DrawString(dgv_accountdetail(8,
i).Value.ToString(), font, New SolidBrush(Color.Black), x +
820, y)
g.DrawString(dgv_accountdetail(9,
i).Value.ToString(), font, New SolidBrush(Color.Black), x +
970, y)
g.DrawString(dgv_accountdetail(10,
i).Value.ToString(), font, New SolidBrush(Color.Black), x +
1070, y)
y = y + offset
Next

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.

Source code clarity is enhanced by structured coding


techniques, by good coding style, by, appropriate supporting
documents, by good internal comments, and by feature provided
in modern programming languages.

The implementation team should be provided with a well-defined


set of software requirement, an architectural design
specification, and a detailed design description. Each team
member must understand the objectives of implementation.
TERMS IN TESTING FUNDAMENTAL

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.

There are four categories of tests that a programmer will


typically perform on a program unit.
1) Functional test
2) Performance test
3) Stress test
4) Structure test

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”.

F. FUTURE SCOPE OF THE PROJECT

This project can be handled in future by doing various


modifications like: -
 We can go further for Online Banking.

 We can establish and start various Branches and available


help centers for Account Holder’s Queries.

 We can also deal through internet by creating web pages and


a banking website for internet dealing.

 To attract Account Holder’s we can offer various offers


during festivals months.

 We can also deal in various types of Banking Transactions.

 To have more and more customer satisfaction we will


emphasize more and more on our dealings.

G. BIBLIOGRAPHY AND REFERENCES


BOOK: -
1. Black Book on Visual Basic .Net 2003 By Steven Holzner
2. Internal Resource
3. Sikkim Manipal University Study material
4. Internal Guide

WEBSITES: -
1. WWW.VBTUTORIALS.COM

2. WWW.VBSOURCECODE.COM

3. WWW.LOGICATWORK.INFO

SEARCH ENGINES: - YAHOO, MSN, GOOGLE etc.

You might also like