Está en la página 1de 69

Bank Management System 1

ACKNOWLEDGEMENT

BANK MANAGEMENT SYSTEM is the project of many hands from the team.
Our tribute for the successful completion of the project goes to all those who
helped through their constant guidance and encouragement.

We are very grateful to our project guide, Smt.Ashwini.B.G (MCA) lecturer,


department of computer science for his valuable guidance and constant support
during out project development.

We are thankful to our Head of the Department Prof T.S Asha (BE, M.SC), for her
encouragement and constant inspiration that enabled to complete our project.

We are also thankful to our beloved principal Dr.K Nareppa (MA, PHD), who
encouraged us to come with new and innovative ideas and for providing the
environment with all facilities for completing the project.

We extend our thanks to all teaching and non -teaching staffs of department of
computer science.
Finally, we thank one and all who helped us directly or indirectly for the
completion of our project.

Department of Computer Science, NCJ


Bank Management System 2

INTRODUCTION

Bank Management System is an Application for maintaining a persons account in


a bank. We have developed an admin Prospective System .The System provides the
access to the admin to deposit/withdraw the cash from his/her account, access to
the whole functionality of the System like creating a new account, deleting an
account, updating the loan status, viewing the transaction report, transaction details
of a particular account holder. Here the admin may be a clerk in a Co-Operative
bank. The Working of the System is quite simple and easy to access.

It contains few modules like:

Login module: In this module the admin or clerk in a bank logs in with their
respective login id.
Transaction module: In this module the admin has facilities like to
debit/credit a particular persons account, view transaction reports,
create/delete an account.

Department of Computer Science, NCJ


Bank Management System 3

Table of contents

1. Introduction
1.1 Problem Statement
1.2Domain Study

2.System Requirements

2.1Software Tools Specification


2.1 Hardware Requirements
2.1Software Requirements

3.Design Specification
3.1 Modular Design
3.2 System Design
3.2.1. E-R Diagram(.NET PROJECT)
3.2.2. Data Dictionary
3.2.3. Validations and Constraints

4. Implementation Details
4.1 Sample Code
4.2 Screen Shots

5. Testing
5.1 Test Case

Department of Computer Science, NCJ


Bank Management System 4

SYSTEM REQUIREMENT

Hardware Requirement

512MB RAM

1GB Hard Disk

Pentium Processor

Software Requirement

Windows XP Operating System

Microsoft Visual Studio 2010(Front-end Tool)

SQL Server (Back-end Tool)

Department of Computer Science, NCJ


Bank Management System 5

TOOL DESCRIPTION
Microsoft visual studio is an integrated development environment (IDE) from
Microsoft .it is used to develop computer programs for Microsoft Windows, as
well as Web Sites, Web Applications and Web services.

.NET Framework (pronounced dot net) is a software framework developed by


Microsoft that runs primarily on Microsoft Windows. It includes a large class
library known as Framework Class Library (FCL) and provides language
interoperability (each language can use code written in other languages) across
several programming languages. Programs written for .NET Framework execute in
a software environment (as contrasted to hardware environment), known as
Common Language Runtime (CLR), and an application virtual machine that
provides services such as security, memory management, and exception handling.
FCL and CLR together constitute

.NET Framework FCL provides user interface, data access, database connectivity,
cryptography, web application development, numeric algorithms, and network
communications. Programmers produce software by combining their own source
code with .NET Framework and other libraries.

.NET Framework is intended to be used by most new applications created for


Windows platform. Microsoft also produces an integrated development
environment largely for .NET software called Visual Studio.

Language independence

.NET Framework introduces a Common Type System, or CTS. CTS specification


defines all possible data types and programming constructs supported by CLR and
how they may or may not interact with each other conforming to Common
Language Infrastructure (CLI) specification. Because of this feature, .NET

Department of Computer Science, NCJ


Bank Management System 6

Framework supports the exchange of types and object instances between libraries
and applications written using any conforming .NET language.

Security

.NET has its own security mechanism with 2 general features: Code Access
Security (CAS), and validation and verification. AS is based on evidence that is
associated with a specific assembly

Portability

While Microsoft has never implemented the full framework on any system except
Microsoft Windows, it has engineered the framework to be platform-agnostic, and
cross-platform implementations are available for other operating systems
.Microsoft submitted the specifications for CLI (which includes the core class
libraries, CTS, and the Common Intermediate Language This makes it possible for
third parties to create compatible implementations of the framework and its
languages on other platforms.

Common Language Infrastructure (CLI)

The purpose of CLI is to provide a language-neutral platform for application


development and execution, including functions for exception handling, garbage
collection, security, and interoperability. By implementing the core aspects of .NET
Framework within the scope of CLI, this functionality will not be tied to a single
language but will be available across the many languages supported by the
framework. Microsoft's implementation of CLI is CLR.

Assembly (CLI)

Common Intermediate Language (CIL) code is housed in CLI assemblies. As


mandated by the specification, assemblies are stored in Portable Executable (PE)
format, common on Windows platform for all DLL and EXE files. The assembly
consists of one or more files, one of which must contain the manifest, which has
the metadata for the assembly. The complete name of an assembly (not to be
confused with the filename on disk) contains its simple text name, version number,

Department of Computer Science, NCJ


Bank Management System 7

culture, and public key token. Assemblies are considered equivalent if they share
the same complete name, excluding the revision of the version number. A private
key can also be used by the creator of the assembly for strong naming. The public
key token identifies which private key an assembly is signed with. Only the creator
of the key pair (typically .NET developer signing the assembly) can sign
assemblies that have the same strong name as a previous version assembly, since
the creator is in possession of the private key. Strong naming is required to add
assemblies to Global Assembly Cache.

SQL SERVER

SQL is used to communicate with database .According to ANSI (American


National Standards Institute), it is the standard language for relation database
management systems .SQL statements are used to perform tasks such as such as
update data on a database, or retrieve data from a database.

SQLCMD is a command line application that comes with Microsoft SQL Server,
and exposes the management features of SQL Server. It allows SQL queries to be
written and executed from the command prompt. It can also act as a scripting
language to create and run a set of SQL statements as a script. Such scripts are
stored as a .sql file, and are used either for management of databases

Microsoft Visual Studio includes native support for data programming with
Microsoft SQL Server. It can be used to write and debug code to be executed by
SQL CLR. It also includes a data designer that can be used to graphically create,
view or edit database schemas. Queries can be created either visually or using
code. SSMS 2008 onwards, provides intelligence for SQL queries as well.

T-SQL (Transact-SQL) is the Secondary means of programming and managing


SQL Server. It exposes keywords for the operations that can be performed on SQL
Server, including creating and altering database schemas, entering and editing data
in the database as well as monitoring and managing the server itself.

Department of Computer Science, NCJ


Bank Management System 8

SQL Native Client is the native client side data access library for Microsoft SQL
Server, version 2005 onwards. It natively implements support for the SQL Server
features including the Tabular Data Stream implementation, support for mirrored
SQL Server databases, full support for all data types supported by SQL Server,
asynchronous operations, query notifications, encryption support, as well as
receiving multiple result sets in a single database session. SQL Native Client is
used under the hood by SQL Server plug-ins for other data access technologies,
including ADO or OLE DB. The SQL Native Client can also be directly used,
bypassing the generic data access layers.

Department of Computer Science, NCJ


Bank Management System 9

DESIGN SPECIFICATION

Module Description

The proposed system BANK MANAGEMENT SYSTEM has the following Modules.

Login module: In this module the admin or clerk of a bank logs in with
their respective login id, if the user is admin he has right for creating a new
account or deleting an existing account.
New account: An Administrator has the permission or a role to open a new
account in our bank.

Delete account: An Administrator has the permission to delete a account in


our bank.

Debit: The Administrator can Debit the amount or look after the debit
transactions of single/multiple accounts of our bank.

Credit: The Administrator can Credit the amount or look after the Credit
transactions of single/multiple accounts of our bank.

View all Transactions: Here the Administrator can view all the transactions
of a particular user in a month.

Loan: The Administrator accepts the Loan request and then the details are
verified and the status report has been updated.

Department of Computer Science, NCJ


Bank Management System 10

TABLE DESCRIPTION

ACCOUNT DETAILS

Date Varchar(MAX)
Amount Varchar(MAX)
Transac Varchar(MAX)
Name Varchar(MAX)
Aaccno Varchar(MAX)

LOGIN

USERNAME Varchar(MAX)
PASSWORD Varchar(MAX)

USER DETAILS

name Varchar(50)
address Varchar(MAX)
Gender Nchar(10)
Age nVarchar(MAX)
Email Varchar(MAX)
Occ Varchar(50)_
Anim money
Bal money
Conphno nVarchar(50)
Photo Varchar(MAX)
accno Varchar(MAX)

Department of Computer Science, NCJ


Bank Management System 11

LOAN FORM

Loanno Int
Accno Int
Name Varchar(50)
Age Int
Address Varchar(max)
Gender Varchar(10)
Email Varchar
Annual salary Int
Office Address Varchar(max)
Working Company Varchar(50)
Department Varchar(50)
photo Varchar(max)
Loan Type Varchar(20)

Department of Computer Science, NCJ


Bank Management System 12

CODING

WELCOME FORM
using System;

Department of Computer Science, NCJ


Bank Management System 13

using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication15
{
public partial class Form1 : Form
{
Form2 f2 = new Form2();
public Form1()
{
InitializeComponent();
}
private void timer1_Tick(object sender, EventArgs e)
{
label3.Location = new Point(label3.Location.X - 5, label3.Location.Y);
if (label3.Location.X > this.Width)
{
label3.Location = new Point(0 - label3.Width, label3.Location.Y);
}

}
private void button1_Click(object sender, EventArgs e)
{
f2.Show();
}
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgse)
{
f2.Show();
this.Hide();
}
private void button1_Click_1(object sender, EventArgs e)
{
Form15 f15 = new Form15();
f15.Show();
this.Hide();
}}}
LOGIN FORM

using System;

Department of Computer Science, NCJ


Bank Management System 14

using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace WindowsFormsApplication15
{
public partial class Form2 : Form
{
SqlConnection con;
SqlCommand cmd,cmd1,cmd2;
SqlDataReader dr,dr1,dr2;
public string m1,m2,m3,m4,m5,m6,m7,m8,m9,m10,m11,m12;
Form3 f3=new Form3();
Form4 f4 = new Form4();
public Form2()
{
InitializeComponent();
}

private void timer1_Tick(object sender, EventArgs e)

label3.Location = new Point(label3.Location.X - 5, label3.Location.Y);


if (label3.Location.X > this.Width)
{
label3.Location = new Point(0 - label3.Width, label3.Location.Y);
}
}

private void button1_Click(object sender, EventArgs e)


{
con.Open();
cmd=new SqlCommand("select * from LOGIN where USERNAME='"+UN.Text+"' and
PASSWORD='"+PS.Text+"'",con);
dr=cmd.ExecuteReader();

if (dr.HasRows)
{

Department of Computer Science, NCJ


Bank Management System 15

f3.Show();
this.Hide();

}
else
{
MessageBox.Show("please enter a VALID username and password",
"INFORMATION", MessageBoxButtons.OK, MessageBoxIcon.Information);
UN.Text = "";
PS.Text = "";
UN.Focus();
}

con.Close();

private void Form2_Load(object sender, EventArgs e)


{
con=new SqlConnection("Data Source=AMEER-PC;Initial Catalog=bank;Integrated
Security=True");
}

}
}

ADMIN FORM

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication15
{
public partial class Form3 : Form
{

Form5 f5 = new Form5();


Department of Computer Science, NCJ
Bank Management System 16

public Form3()
{
InitializeComponent();
}
private void Form3_Load(object sender, EventArgs e)
{

}
private void linkLabel5_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
Form6 f6 = new Form6();
f6.Show();
this.Hide();
}

private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
Form4 f4 = new Form4();
f4.Show();
this.Hide();
}

private void linkLabel4_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
f5.Show();
this.Hide();
}

private void linkLabel6_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
Form7 f7 = new Form7();
f7.Show();
this.Hide();
}

private void linkLabel7_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
Form8 f8 = new Form8();
f8.Show();
this.Hide();
}

private void linkLabel8_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)

Department of Computer Science, NCJ


Bank Management System 17

{
Form9 f9 = new Form9();
f9.Show();
this.Hide();
}
private void linkLabel9_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{

Form10 f10= new Form10();


f10.Show();
this.Hide();
}

private void button1_Click(object sender, EventArgs e)


{
Form1 f1 = new Form1();
f1.Show();
this.Hide();
}
}
}

NEW ACCOUT FORM


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace WindowsFormsApplication15
{
public partial class Form4 : Form
{
SqlConnection con;
SqlCommand cmd,cmd1;

Department of Computer Science, NCJ


Bank Management System 18

SqlDataReader dr;
Form3 f3 = new Form3();
public string s1,s2,s3,s4,s5,s7,s8,s9,s10,s11,s12;

public Form4()
{
InitializeComponent();
}

private void Form4_Load(object sender, EventArgs e)


{

con = new SqlConnection("Data Source=AMEER-PC;Initial Catalog=bank;Integrated


Security=True");
cmd1 = new SqlCommand("select max(accno) from USERLOGIN", con);
con.Open();
object r = cmd1.ExecuteScalar();
int r1 = Convert.ToInt32(r);
r1++;
ACCNO.Text = r1.ToString();
con.Close();

}
public void data()
{
s1 = NAME.Text;
s2 = ADD.Text;
if (MALE.Checked == true)
s3 = "male";
else
s3 = "female";
s4 = dateTimePicker1.Value.ToShortDateString();
s5 = EMAIL.Text;

s7 = ComboBox1.SelectedItem.ToString();
s8 = AI.Text;
s9 = opamt.Text;
s10 = PHNO.Text;
s12 = ACCNO.Text;

Department of Computer Science, NCJ


Bank Management System 19

private void linkLabel2_LinkClicked_1(object sender, LinkLabelLinkClickedEventArgs e)


{
f3.Show();
this.Hide();
}

private void linkLabel4_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
Form5 f5 = new Form5();
f5.Show();
this.Hide();
}

private void linkLabel5_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
Form6 f6 = new Form6();
f6.Show();
this.Hide();
}

private void linkLabel6_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
Form7 f7 = new Form7();
f7.Show();
this.Hide();
}

private void linkLabel7_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
Form8 f8 = new Form8();
f8.Show();
this.Hide();
}

private void linkLabel8_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
Form9 f9 = new Form9();
f9.Show();
this.Hide();
}

Department of Computer Science, NCJ


Bank Management System 20

private void button1_Click(object sender, EventArgs e)


{

if (ADD.Text == string.Empty)
{
errorProvider3.SetError(ADD, "please enter the address");

}
if (ComboBox1.SelectedItem==string.Empty)
{
errorProvider4.SetError(ComboBox1, "please select the occupation");

if (PHNO.Text == string.Empty)
{
errorProvider6.SetError(PHNO, "please enter the contact no");

if (NAME.Text == string.Empty)
{
errorProvider1.SetError(NAME, "please enter the name");

}
else if (EMAIL.Text == string.Empty)
{
errorProvider2.SetError(EMAIL, "please enter the email id");
}
else
{
con = new SqlConnection("Data Source=AMEER-PC;Initial Catalog=bank;Integrated
Security=True");
con.Open();
data();

cmd = new SqlCommand("insert into USERLOGIN values('" + s1 + "','" + s2 + "','" +


s3 + "','" + s4 + "','" + s5 + "','" + s7 + "','" + s8 + "','" + s9 + "','" + s10 + "','" + s11 + "','" + s12 +
"')", con);
cmd.ExecuteNonQuery();

Department of Computer Science, NCJ


Bank Management System 21

MessageBox.Show("'" + s1 + "'ACCOUNT HAS BEEN SUCCESSFULLY


CREATED", "CONFIRMATION", MessageBoxButtons.OK, MessageBoxIcon.Information);
NAME.Text = "";
ADD.Text = "";
EMAIL.Text = "";

AI.Text = "";
PHNO.Text = "";
ComboBox1.Items.Clear();
opamt.Text = "";
AI.Text = "";
ACCNO.Text = "";

}
}

private void linkLabel9_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
if (openFileDialog1.ShowDialog() != System.Windows.Forms.DialogResult.Cancel)
{
pictureBox1.Image = Image.FromFile(openFileDialog1.FileName);
s11 = openFileDialog1.FileName;
photol.Visible = false;

private void NAME_KeyPress(object sender, KeyPressEventArgs e)


{
if (e.KeyChar > 47 && e.KeyChar < 58)
{
MessageBox.Show("numbers are not allowed","Error
Notification",MessageBoxButtons.RetryCancel,MessageBoxIcon.Error);
NAME.Text = "";
}

private void ComboBox1_SelectedIndexChanged(object sender, EventArgs e)

Department of Computer Science, NCJ


Bank Management System 22

{
if (ComboBox1.SelectedItem == "STUDENT")
{

label8.Visible = false;
AI.Visible = false;
opamt.Text = "500";
}
if (ComboBox1.SelectedItem == "BUSINESS")
{

label8.Visible = true;
AI.Visible = true;
opamt.Text = "1000";
}
if (ComboBox1.SelectedItem == "EMPLOYEE")
{

label8.Visible = true;
AI.Visible = true;
opamt.Text = "1000";
}

private void PHNO_KeyPress(object sender, KeyPressEventArgs e)


{
if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar) && e.KeyChar != '.')
{
e.Handled = true;
MessageBox.Show("No letters or special keys are allowed", "WARNING",
MessageBoxButtons.OK, MessageBoxIcon.Hand);
}
}

private void cp_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
if (openFileDialog1.ShowDialog() != System.Windows.Forms.DialogResult.Cancel)
{
pictureBox1.Image = Image.FromFile(openFileDialog1.FileName);
s11 = openFileDialog1.FileName;
}
}

Department of Computer Science, NCJ


Bank Management System 23

private void comboBox3_SelectedIndexChanged(object sender, EventArgs e)


{

private void linkLabel9_LinkClicked_1(object sender, LinkLabelLinkClickedEventArgs e)


{
Form10 f10 = new Form10();
f10.Show();
this.Hide();
}

}
}

CREDIT FORM
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace WindowsFormsApplication15
{
public partial class Form5 : Form
{
SqlConnection con;
SqlCommand cmd,cmd1,cmd2,cmd3;
SqlDataReader dr,dr1;
public string bal, name, trans;
public double d1, d2,d3;

public Form5()
{
InitializeComponent();
}

Department of Computer Science, NCJ


Bank Management System 24

private void timer1_Tick(object sender, EventArgs e)


{
label3.Location = new Point(label3.Location.Y +5, label3.Location.X);
if (label3.Location.Y > this.Width)
{
label3.Location = new Point(0 - label3.Width, label3.Location.X);
}

private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
Form4 f4 = new Form4();
f4.Show();
this.Hide();
}

private void Form5_Load(object sender, EventArgs e)


{
con = new SqlConnection("Data Source=AMEER-PC;Initial Catalog=bank;Integrated
Security=True");
DateTime dt = DateTime.Now;
label4.Text = dt.ToString();
}

private void linkLabel5_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
Form6 f6 = new Form6();
f6.Show();
this.Hide();
}

private void linkLabel6_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
Form7 f7 = new Form7();
f7.Show();
this.Hide();
}

private void linkLabel7_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
Form8 f8 = new Form8();

Department of Computer Science, NCJ


Bank Management System 25

f8.Show();
this.Hide();
}

private void linkLabel8_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
Form9 f9 = new Form9();
f9.Show();
this.Hide();
}

private void linkLabel4_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
Form3 f3 = new Form3();
f3.Show();
this.Hide();
}

private void button1_Click(object sender, EventArgs e)


{
trans = "credited";
con.Open();
cmd1 = new SqlCommand("update USERLOGIN set bal=bal+'" + textBox1.Text + "'
where accno='" + textBox2.Text + "'", con);
cmd1.ExecuteNonQuery();
con.Close();
d1 = double.Parse(textBox1.Text);
d2 = double.Parse(bal);
d3 = d2 + d1;
MessageBox.Show("Hi, you have credited " + textBox1.Text + "/- in " + name + "",
"information", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
textBox1.Text = "";
textBox1.Focus();
con.Close();

private void linkLabel9_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
Form10 f10 = new Form10();
f10.Show();

Department of Computer Science, NCJ


Bank Management System 26

this.Hide();
}

private void check_Click(object sender, EventArgs e)


{
if (textBox2.Text == "")
{
MessageBox.Show("fields should not be left empty during the process", "WARNING",
MessageBoxButtons.RetryCancel, MessageBoxIcon.Exclamation);
textBox1.Focus();
}
else
{
con.Open();
cmd = new SqlCommand("select * from USERLOGIN where accno='" +
textBox2.Text + "'", con);
dr = cmd.ExecuteReader();
if (dr.HasRows)
{
con.Close();
con.Open();
cmd2 = new SqlCommand("select bal,name,conphno,address,email from
USERLOGIN where accno='" + textBox2.Text + "'", con);
dr1 = cmd2.ExecuteReader();
while (dr1.Read())
{
bal = dr1[0].ToString();
name = dr1[1].ToString();
nam.Text = name;
phno.Text = dr1[2].ToString();
add.Text = dr1[3].ToString();
email.Text = dr1[4].ToString();

}
button1.Visible = true;
con.Close();
}

else
{

con.Close();

Department of Computer Science, NCJ


Bank Management System 27

MessageBox.Show("please enter a valid account number", "WARNING",


MessageBoxButtons.RetryCancel, MessageBoxIcon.Exclamation);

textBox2.Text = "";
textBox2.Focus();
}

}
}
}
}

DEBIT FORM
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace WindowsFormsApplication15
{
public partial class Form6 : Form
{
SqlConnection con;
SqlCommand cmd, cmd1, cmd2, cmd3, cmd4;
SqlDataReader dr, dr1, dr2, dr3;
public string bal, name, curbal, trans;
public double d, d1,d2,d3,abc;
public Form6()
{
InitializeComponent();
}

private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
Form4 f4 = new Form4();
f4.Show();
this.Hide();

Department of Computer Science, NCJ


Bank Management System 28

private void linkLabel4_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{

Form5 f5 = new Form5();


f5.Show();
this.Hide();

private void linkLabel6_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{

Form7 f7 = new Form7();


f7.Show();
this.Hide();
}

private void linkLabel7_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
Form8 f8 = new Form8();
f8.Show();
this.Hide();
}

private void linkLabel8_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{

Form9 f9 = new Form9();


f9.Show();
this.Hide();
}

private void linkLabel5_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
Form3 f3 = new Form3();
f3.Show();
this.Hide();

Department of Computer Science, NCJ


Bank Management System 29

private void Form6_Load(object sender, EventArgs e)


{
con = new SqlConnection("Data Source=AMEER-PC;Initial Catalog=bank;Integrated
Security=True");
DateTime dt = DateTime.Now;
label4.Text = dt.ToString();

private void button1_Click(object sender, EventArgs e)


{
trans = "Debited";
d3 = double.Parse(bal);
d2 = double.Parse(textBox1.Text);
if (d2 <=d3)
{
con.Open();
cmd1 = new SqlCommand("update USERLOGIN set bal=bal-'" + textBox1.Text + "'
where accno='" + textBox2.Text + "'", con);
cmd1.ExecuteNonQuery();
con.Close();
abc = d3 - d2;
MessageBox.Show("Hi, you have Debited " + textBox1.Text + "/- in " + name + "'S
account and the current balance is " + abc + "", "information", MessageBoxButtons.OK,
MessageBoxIcon.Asterisk);
textBox1.Text = "";
textBox1.Focus();
con.Close();
}

else
{
MessageBox.Show("you dont have enough balance to withdraw", "information",
MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
textBox1.Text = "";
textBox1.Focus();
}
}
private void linkLabel9_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
Form10 f10 = new Form10();
f10.Show();
this.Hide();

Department of Computer Science, NCJ


Bank Management System 30

private void check_Click(object sender, EventArgs e)


{
if (textBox2.Text == "")
{
MessageBox.Show("fields should not be left empty during the process", "WARNING",
MessageBoxButtons.RetryCancel, MessageBoxIcon.Exclamation);
textBox1.Focus();
}
else
{
con.Open();
cmd = new SqlCommand("select * from USERLOGIN where accno='" +
textBox2.Text + "'", con);
dr = cmd.ExecuteReader();
if (dr.HasRows)
{
con.Close();
con.Open();
cmd2 = new SqlCommand("select bal,name,conphno,address,email from
USERLOGIN where accno='" + textBox2.Text + "'", con);
dr1 = cmd2.ExecuteReader();
while (dr1.Read())
{
bal = dr1[0].ToString();
name = dr1[1].ToString();
nam.Text = name;
phno.Text = dr1[2].ToString();
add.Text = dr1[3].ToString();
email.Text = dr1[4].ToString();

}
con.Close();
button1.Visible = true;
}

else
{
con.Close();

Department of Computer Science, NCJ


Bank Management System 31

MessageBox.Show("please enter a valid account number", "WARNING",


MessageBoxButtons.RetryCancel, MessageBoxIcon.Exclamation);

textBox2.Text = "";
textBox2.Focus();
}
}

}
}

ALL TRANSACTIONS
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication15
{
public partial class Form7 : Form
{
public Form7()
{
InitializeComponent();
}

private void Form7_Load(object sender, EventArgs e)


{
// TODO: This line of code loads data into the 'bankDataSet4.transac' table. You can
move, or remove it, as needed.
this.transacTableAdapter2.Fill(this.bankDataSet4.transac);
// TODO: This line of code loads data into the 'bankDataSet3.transac' table. You can
move, or remove it, as needed.

Department of Computer Science, NCJ


Bank Management System 32

this.transacTableAdapter1.Fill(this.bankDataSet3.transac);

private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
Form4 f4 = new Form4();
f4.Show();
this.Hide();
}
private void linkLabel4_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
Form5 f5 = new Form5();
f5.Show();
this.Hide();
}

private void linkLabel5_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
Form6 f6 = new Form6();
f6.Show();
this.Hide();
}

private void linkLabel7_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
Form8 f8 = new Form8();
f8.Show();
this.Hide();
}

private void linkLabel8_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
Form9 f9 = new Form9();
f9.Show();
this.Hide();
}

private void linkLabel6_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
Form3 f3 = new Form3();
f3.Show();
this.Hide();

Department of Computer Science, NCJ


Bank Management System 33

private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)


{

private void linkLabel9_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
Form10 f10 = new Form10();
f10.Show();
this.Hide();
}

private void linkLabel10_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{

}
}
}

BALANCE ENQUIRY

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace WindowsFormsApplication15
{
public partial class Form8 : Form
{
SqlConnection con;
SqlCommand cmd, cmd1;
SqlDataReader dr, dr1;
SqlDataAdapter adpt;
DataSet ds;

Department of Computer Science, NCJ


Bank Management System 34

public Form8()
{
InitializeComponent();
}

private void linkLabel7_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
Form3 f3 = new Form3();
f3.Show();
this.Hide();
}

private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
Form4 f4 = new Form4();
f4.Show();
this.Hide();
}
private void linkLabel4_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
Form5 f5 = new Form5();
f5.Show();
this.Hide();
}

private void linkLabel5_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
Form6 f6 = new Form6();
f6.Show();
this.Hide();
}

private void linkLabel6_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
Form7 f7 = new Form7();
f7.Show();
this.Hide();
}
private void linkLabel8_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
Form9 f9 = new Form9();
f9.Show();
this.Hide();

Department of Computer Science, NCJ


Bank Management System 35

private void Form8_Load(object sender, EventArgs e)


{
accno.Focus();

private void button1_Click(object sender, EventArgs e)


{
con = new SqlConnection("Data Source=AMEER-PC;Initial Catalog=bank;Integrated
Security=True");
con.Open();
adpt = new SqlDataAdapter("select * from transac where Accno='" + accno.Text + "'",
con);
ds = new DataSet();
adpt.Fill(ds, "transac");
dataGrid1.DataSource = ds;
con.Close();
con.Open();

cmd = new SqlCommand("select name,bal,photo from USERLOGIN where accno='" +


accno.Text + "' ", con);
dr = cmd.ExecuteReader();
if (dr.HasRows)
{
while (dr.Read())
{
acchn.Text = dr[0].ToString();

accbal.Text = dr[1].ToString();
pictureBox1.ImageLocation = dr[2].ToString();

con.Close();

else

{
Department of Computer Science, NCJ
Bank Management System 36

MessageBox.Show("please enter a valid account number", "WARNING",


MessageBoxButtons.RetryCancel, MessageBoxIcon.Exclamation);
accno.Text = "";
acchn.Text = "";
accbal.Text = "";
accno.Focus();
}

private void linkLabel9_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
Form10 f10 = new Form10();
f10.Show();
this.Hide();
}

}
}

DELETE ACCOUNT
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace WindowsFormsApplication15
{
public partial class Form9 : Form
{
SqlConnection con;
SqlCommand cmd,cmd1;
SqlDataReader dr;
public Form9()
{
InitializeComponent();

Department of Computer Science, NCJ


Bank Management System 37

private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
Form4 f4 = new Form4();
f4.Show();
this.Hide();
}

private void linkLabel4_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
Form5 f5 = new Form5();
f5.Show();
this.Hide();
}

private void linkLabel5_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
Form6 f6 = new Form6();
f6.Show();
this.Hide();
}

private void linkLabel6_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
Form7 f7 = new Form7();
f7.Show();
this.Hide();
}

private void linkLabel7_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
Form8 f8 = new Form8();
f8.Show();
this.Hide();
}

private void linkLabel9_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
Form3 f3 = new Form3();
f3.Show();
this.Hide();
}

Department of Computer Science, NCJ


Bank Management System 38

private void Form9_Load(object sender, EventArgs e)


{
con = new SqlConnection("Data Source=AMEER-PC;Initial Catalog=bank;Integrated
Security=True");
}

private void button1_Click(object sender, EventArgs e)


{
con.Open();
cmd=new SqlCommand("select * from USERLOGIN where accno='" + accno.Text +"'",
con);
dr = cmd.ExecuteReader();
if (dr.HasRows)
{
con.Close();
con.Open();
cmd1 = new SqlCommand("delete from USERLOGIN where accno='" + accno.Text +
"'", con);
cmd1.ExecuteNonQuery();
MessageBox.Show("The account number "+accno.Text+" has been successfully
deleted", "INFORMATION", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
accno.Text = "";
accno.Focus();
}

else
{
MessageBox.Show("please enter a valid account number", "WARNING",
MessageBoxButtons.RetryCancel, MessageBoxIcon.Exclamation);
accno.Text = "";
accno.Focus();
}
con.Close();
}

private void panel1_Paint(object sender, PaintEventArgs e)


{

private void linkLabel8_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{

Department of Computer Science, NCJ


Bank Management System 39

Form10 f10 = new Form10();


f10.Show();
this.Hide();
}

}
}

LOAN MAIN PAGE


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace WindowsFormsApplication15
{
public partial class Form10 : Form
{
public string s1;
public Form10()
{
InitializeComponent();
}

private void Form10_Load(object sender, EventArgs e)


{

private void radioButton3_CheckedChanged(object sender, EventArgs e)


{
richTextBox1.Text = "Terms & Conditions*\t\t\t\t\t\t GOLD LOAN \t\t\t\t\t\t\t\t\t\t\n\n " +
" 1: The loan is based on the weight, purity of the Gold and adjusted market value.\n\n" + "2: The
Company will make only a preliminary verification of the Gold and the Company has the right to
further check the purity / weight of the Gold internally or by experts at any point of time if

Department of Computer Science, NCJ


Bank Management System 40

required, at the Company's sole discretion, at the cost and expense of the Loan
Applicant/Borrower. The Company shall, at its discretion, have the right to open the packets,
melt all or any portion of the Gold, at any time during the currency of the Loan.\n\n" + "3:
Notwithstanding anything mentioned herein, the Loan Applicant/Borrower shall repay the entire
dues/outstanding under the Loan including principal, interest (Dues), and other charges,
immediately on demand, if the Company observes, after verification internally or by experts, that
the whole or part of the Gold is not of the prescribed weight / purity or if the title of the Loan
Applicant/Borrower to the Gold is found defective or if the same is disputed by any other person.
The certificate issued by the Company stating the exact grams of the gold after translating the
same to 22 carat is based on the preliminary verification made at the time of granting the loan
and may be treated as provisional and not final.\n\n" + "4: Loan Applicant/Borrower is required
to repay the loan along with interest on or before the completion of loan tenure, as specified in
the pawn ticket from the date of disbursement. However, the Loan Applicant/Borrower shall
have the option to foreclose the loan at anytime during the currency of the loan by paying the
principal loan amount alongwith interest and other charges. Similarly, the Company may, at its
sole and absolute discretion, have the right to further extend the tenure of the loan for such
periods, but not exceeding one year from the date of disbursement of the loan.
Applicant/Borrower can also make part payments of principal or interest at any time during the
currency of the loan. Pre-payment charges, if any, will be mentioned in the pawn ticket.
Notwithstanding anything mentioned herein, the Company shall be entitled to recall / cancel the
Loan at any time at its discretion without assigning any reasons and thereafter the Dues shall
immediately become payable to the Company.\n\n" + "5: The postage charges, as revised from
time to time at the discretion on the Company, shall be recovered from the respective account.";
}

private void radioButton5_CheckedChanged(object sender, EventArgs e)


{
richTextBox1.Text = "";
richTextBox1.Text = "Terms & Conditions*\t\t\t\t\t\t PERSONAL LOAN
\t\t\t\t\t\t\t\t\t\t\n\n " + "1: PURPOSE:Personal Loanis granted for marriage/medical treatment/
education/ foreign travel or any other general purpose except for any speculative activities..
ELIGIBILITY:Salariedemployees, pensioners of central/state government/armed forces, self
employed businessmen and professionals with a regular source of income are eligible to avail
Personal Loan.\n\n "+ "2: The Company will make only a preliminary verification of the Gold
and the Company has the right to further check the purity / weight of the Gold internally or by
experts at any point of time if required, at the Company's sole discretion, at the cost and expense
of the Loan Applicant/Borrower. The Company shall, at its discretion, have the right to open the
packets, melt all or any portion of the Gold, at any time during the currency of the Loan.\n\n" +
"3: Notwithstanding anything mentioned herein, the Loan Applicant/Borrower shall repay the
entire dues/outstanding under the Loan including principal, interest (Dues), and other charges,
immediately on demand, if the Company observes, after verification internally or by experts, that
the whole or part of the Gold is not of the prescribed weight / purity or if the title of the Loan
Applicant/Borrower to the Gold is found defective or if the same is disputed by any other person.

Department of Computer Science, NCJ


Bank Management System 41

The certificate issued by the Company stating the exact grams of the gold after translating the
same to 22 carat is based on the preliminary verification made at the time of granting the loan
and may be treated as provisional and not final.\n\n" + "4: Loan Applicant/Borrower is required
to repay the loan along with interest on or before the completion of loan tenure, as specified in
the pawn ticket from the date of disbursement. However, the Loan Applicant/Borrower shall
have the option to foreclose the loan at anytime during the currency of the loan by paying the
principal loan amount alongwith interest and other charges. Similarly, the Company may, at its
sole and absolute discretion, have the right to further extend the tenure of the loan for such
periods, but not exceeding one year from the date of disbursement of the loan.
Applicant/Borrower can also make part payments of principal or interest at any time during the
currency of the loan. Pre-payment charges, if any, will be mentioned in the pawn ticket.
Notwithstanding anything mentioned herein, the Company shall be entitled to recall / cancel the
Loan at any time at its discretion without assigning any reasons and thereafter the Dues shall
immediately become payable to the Company.\n\n" + "5: The postage charges, as revised from
time to time at the discretion on the Company, shall be recovered from the respective account.";

private void radioButton4_CheckedChanged(object sender, EventArgs e)


{
richTextBox1.Text = "";
richTextBox1.Text = "Terms & Conditions*\t\t\t\t\t\t VEHICLE LOAN \t\t\t\t\t\t\t\t\t\t\n\n
" + " 1: Salaried employees, Professionals, Self-employed Non-Resident Indians- advance to be
granted jointly with Resident Indians (close relative) (Age of the individual borrower not to
exceed 65 years at the time of availing the advance) Companies, Partnership Firms, Proprietary
concern and other types of Corporate entities. HUFs not Eligible \n\n"+ "2: The Company will
make only a preliminary verification of the Gold and the Company has the right to further check
the purity / weight of the Gold internally or by experts at any point of time if required, at the
Company's sole discretion, at the cost and expense of the Loan Applicant/Borrower. The
Company shall, at its discretion, have the right to open the packets, melt all or any portion of the
Gold, at any time during the currency of the Loan.\n\n" + "3: Notwithstanding anything
mentioned herein, the Loan Applicant/Borrower shall repay the entire dues/outstanding under the
Loan including principal, interest (Dues), and other charges, immediately on demand, if the
Company observes, after verification internally or by experts, that the whole or part of the Gold
is not of the prescribed weight / purity or if the title of the Loan Applicant/Borrower to the Gold
is found defective or if the same is disputed by any other person. The certificate issued by the
Company stating the exact grams of the gold after translating the same to 22 carat is based on the
preliminary verification made at the time of granting the loan and may be treated as provisional
and not final.\n\n" + "4: Loan Applicant/Borrower is required to repay the loan along with
interest on or before the completion of loan tenure, as specified in the pawn ticket from the date
of disbursement. However, the Loan Applicant/Borrower shall have the option to foreclose the
loan at anytime during the currency of the loan by paying the principal loan amount alongwith

Department of Computer Science, NCJ


Bank Management System 42

interest and other charges. Similarly, the Company may, at its sole and absolute discretion, have
the right to further extend the tenure of the loan for such periods, but not exceeding one year
from the date of disbursement of the loan. Applicant/Borrower can also make part payments of
principal or interest at any time during the currency of the loan. Pre-payment charges, if any, will
be mentioned in the pawn ticket. Notwithstanding anything mentioned herein, the Company shall
be entitled to recall / cancel the Loan at any time at its discretion without assigning any reasons
and thereafter the Dues shall immediately become payable to the Company.\n\n" + "5: The
postage charges, as revised from time to time at the discretion on the Company, shall be
recovered from the respective account.";

private void button1_Click(object sender, EventArgs e)


{
Form12 f12 = new Form12();
f12.Show();
this.Hide();
}

private void linkLabel2_LinkClicked_1(object sender, LinkLabelLinkClickedEventArgs e)


{
Form11 f11 = new Form11();
f11.Show();
this.Hide();
}

private void linkLabel3_LinkClicked_1(object sender, LinkLabelLinkClickedEventArgs e)


{
Form13 f13 = new Form13();
f13.Show();
this.Hide();
}

private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
Form3 f3 = new Form3();
f3.Show();
this.Hide();
}
}
}

Department of Computer Science, NCJ


Bank Management System 43

LOAN STATUS
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace WindowsFormsApplication15
{
public partial class Form11 : Form
{
SqlCommand cmd, cmd1;
SqlConnection con;
SqlDataReader dr,dr1;
public Form11()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)


{
con.Open();
cmd = new SqlCommand("select * from Loan where appno='" + textBox1.Text + "'",
con);
dr = cmd.ExecuteReader();
if (dr.HasRows)
{
con.Close();
con.Open();
cmd1 = new SqlCommand("select status,accno,name from Loan where appno='" +
textBox1.Text + "'", con);
dr1 = cmd1.ExecuteReader();
while (dr1.Read())
{
textBox2.Text = dr1[0].ToString();
accno.Text = dr1[1].ToString();
name.Text = dr1[2].ToString();
}

Department of Computer Science, NCJ


Bank Management System 44

con.Close();
}
else
{
con.Close();
MessageBox.Show("Please enter a valid Loan no", "WARNING",
MessageBoxButtons.OK, MessageBoxIcon.Information);

textBox2.Text="";
accno.Text="";
name.Text="";
textBox1.Focus();

}
}

private void Form11_Load(object sender, EventArgs e)


{
con = new SqlConnection("Data Source=AMEER-PC;Initial Catalog=bank;Integrated
Security=True");
}

private void button2_Click(object sender, EventArgs e)


{

textBox2.Text = "";
accno.Text = "";
name.Text = "";
textBox1.Text = "";
textBox1.Focus();
}

private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
Form10 f10=new Form10();
f10.Show();
this.Hide();
}
private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
Form13 f13 = new Form13();
f13.Show();
this.Hide();
Department of Computer Science, NCJ
Bank Management System 45

}
}
}

LOAN APPLICATION FORM


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace WindowsFormsApplication15
{
public partial class Form12 : Form
{
SqlCommand cmd,cmd1,cmd2;
SqlConnection con;
SqlDataReader dr,dr2;
public string s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12="pending";
public int s13;
public Form12()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)


{
if (name.Text == string.Empty)
{
errorProvider1.SetError(name, "please enter the name");
name.Focus();

}
else if (age.Text == string.Empty)
{
errorProvider2.SetError(age, "please enter age");
age.Focus();

Department of Computer Science, NCJ


Bank Management System 46

else if (add.Text == string.Empty)


{
errorProvider2.SetError(add, "please enter address");
add.Focus();

}
else if (email.Text == string.Empty)
{
errorProvider2.SetError(email, "please enter email id");
email.Focus();

}
else if (ansal.Text == string.Empty)
{
errorProvider2.SetError(ansal, "please enter annual salary");
ansal.Focus();

}
else if (offadd.Text == string.Empty)
{
errorProvider2.SetError(offadd, "please enter office address");
offadd.Focus();

}
else if (wrkcmp.Text == string.Empty)
{
errorProvider2.SetError(wrkcmp, "please enter working company name");
wrkcmp.Focus();

}
else if (dept.Text == string.Empty)
{
errorProvider2.SetError(dept, "please enter department in which you are working");
dept.Focus();

Department of Computer Science, NCJ


Bank Management System 47

}
else if (accno.Text == string.Empty)
{
errorProvider2.SetError(accno, "please enter account number");
dept.Focus();

}
else
{
con.Open();
cmd1=new SqlCommand("select * from USERLOGIN where
accno='"+accno.Text+"'",con);
dr2 = cmd1.ExecuteReader();
if (dr2.HasRows)
{
con.Close();
con.Open();
data();
cmd = new SqlCommand("insert into Loan values('" + s1 + "','" + s2 + "','" + s3 +
"','" + s4 + "','" + s5 + "','" + s6 + "','" + s7 + "','" + s8 + "','" + s9 + "','" + s10 + "','" + s12 + "','" +
s11 + "','" + s13 + "','" + accno.Text + "')", con);
cmd.ExecuteNonQuery();
MessageBox.Show("Your Loan Request has been successfully registered",
"CONFIRMATION", MessageBoxButtons.OK, MessageBoxIcon.Information);
con.Close();
name.Text = "";
age.Text = "";
add.Text = "";
email.Text = "";
ansal.Text = "";
offadd.Text = "";
wrkcmp.Text = "";
dept.Text = "";
accno.Text = "";
name.Focus();
}
else
{
con.Close();

Department of Computer Science, NCJ


Bank Management System 48

MessageBox.Show("Please enter a valid accno", "WARNING",


MessageBoxButtons.OK, MessageBoxIcon.Information);
accno.Focus();
}

}
}

private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
if (openFileDialog1.ShowDialog() != System.Windows.Forms.DialogResult.Cancel)
{
pictureBox1.Image = Image.FromFile(openFileDialog1.FileName);
s10 = openFileDialog1.FileName;
}

}
public void data()
{
s1 = name.Text;
s2 = age.Text;
s3 = add.Text;
if (male.Checked == true)
{
s4 = "male";
}
else
{
s4 = "female";
}
s5 = email.Text;
s6 = ansal.Text;
s7 = offadd.Text;
s8 = wrkcmp.Text;
s9 = dept.Text;
if (GOLD.Checked == true)
{
s11 = "gold";
}
else if (VEHICLE.Checked == true)
{
s11 = "vehicle";

Department of Computer Science, NCJ


Bank Management System 49

}
else
{
s11 = "personal";
}
}

private void Form12_Load(object sender, EventArgs e)


{
con = new SqlConnection("Data Source=AMEER-PC;Initial Catalog=bank;Integrated
Security=True");
con.Open();
cmd1 = new SqlCommand("select max(appno) from Loan", con);
object r = cmd1.ExecuteScalar();
int r1 = Convert.ToInt32(r);
r1++;
appno.Text = r1.ToString();
s13 = int.Parse(appno.Text);
con.Close();
}

private void name_KeyPress(object sender, KeyPressEventArgs e)


{
if (e.KeyChar > 47 && e.KeyChar < 58)
{
MessageBox.Show("numbers are not allowed");
name.Text ="";
}
}

private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
Form10 f10 = new Form10();
f10.Show();
this.Hide();
}
}
}

LOAN APPROVAL
using System;
using System.Collections.Generic;

Department of Computer Science, NCJ


Bank Management System 50

using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace WindowsFormsApplication15
{
public partial class Form13 : Form
{
SqlConnection con;
SqlCommand cmd1, cmd2;
SqlDataReader dr1, dr2;
public Form13()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)


{
if (textBox1.Text == ""||textBox2.Text=="")
{
MessageBox.Show("fields should not be left empty during the process", "WARNING",
MessageBoxButtons.RetryCancel, MessageBoxIcon.Exclamation);
textBox1.Focus();
}
else
{
con.Open();
cmd1 = new SqlCommand("select * from Loan where appno='" + textBox1.Text + "'",
con);
dr1 = cmd1.ExecuteReader();
if (dr1.HasRows)
{
con.Close();
con.Open();
cmd2 = new SqlCommand("update Loan set status='" + textBox2.Text + "' where
appno='" + textBox1.Text + "'", con);
cmd2.ExecuteNonQuery();
MessageBox.Show("Sucessfully Updated", "INFORMATION",
MessageBoxButtons.OK, MessageBoxIcon.Information);

Department of Computer Science, NCJ


Bank Management System 51

textBox1.Text = "";
textBox2.Text = "";
textBox1.Focus();
}
else
{
con.Close();
MessageBox.Show("Please enter a valid Loan no", "WARNING",
MessageBoxButtons.OK, MessageBoxIcon.Information);
textBox1.Text = "";
textBox2.Text = "";
textBox1.Focus();
}
}
}

private void Form13_Load(object sender, EventArgs e)


{
con = new SqlConnection("Data Source=AMEER-PC;Initial Catalog=bank;Integrated
Security=True");
textBox1.Text = "";
}

private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
Form10 f10 = new Form10();
f10.Show();
this.Hide();
}

private void Loan_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
Form11 f11 = new Form11();
f11.Show();
this.Hide();
}
}
}

EMI CALCULATOR
using System;
using System.Collections.Generic;

Department of Computer Science, NCJ


Bank Management System 52

using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication15
{
public partial class Form15 : Form
{
public double p, interest, term,t1, emi,totalamtp,y;
public string s1,s2;
public Form15()
{
InitializeComponent();
}

private void Form15_Load(object sender, EventArgs e)


{

private void button1_Click(object sender, EventArgs e)


{

p = double.Parse(PRINCIPAL.Text);
s1 = comboBox1.SelectedItem.ToString();
interest = double.Parse(s1);
s2 = comboBox2.SelectedItem.ToString();
term = double.Parse(s2);
y=(p*interest)/100;
totalamtp = p + (y * term);
TAP.Text = totalamtp.ToString();
t1 = term * 12;
emi=totalamtp/t1;
EMI.Text = emi.ToString();
MessageBox.Show("Your estimated EMI is '"+EMI.Text+"' and per annum interest is
'"+y+"' and total amount payable is'"+totalamtp+"' ", "CONFIRMATION",
MessageBoxButtons.OK, MessageBoxIcon.Information);

Department of Computer Science, NCJ


Bank Management System 53

private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)


{

private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


{
Form1 f1 = new Form1();
f1.Show();
this.Hide();
}
}
}

Department of Computer Science, NCJ


Bank Management System 54

Snapshots

Department of Computer Science, NCJ


Bank Management System 55

Department of Computer Science, NCJ


Bank Management System 56

Department of Computer Science, NCJ


Bank Management System 57

Department of Computer Science, NCJ


Bank Management System 58

Department of Computer Science, NCJ


Bank Management System 59

Department of Computer Science, NCJ


Bank Management System 60

Department of Computer Science, NCJ


Bank Management System 61

Department of Computer Science, NCJ


Bank Management System 62

Department of Computer Science, NCJ


Bank Management System 63

Department of Computer Science, NCJ


Bank Management System 64

Department of Computer Science, NCJ


Bank Management System 65

Department of Computer Science, NCJ


Bank Management System 66

Department of Computer Science, NCJ


Bank Management System 67

Department of Computer Science, NCJ


Bank Management System 68

Department of Computer Science, NCJ


Bank Management System 69

BIBLIOGRAPHY

1. Fundamentals of database systems, Ramez Elmasri, Shamkant B.Navathe.

2. Comdex.Net

3. www.microsoft.com

4. www.codeproject.com

5. www.c-sharpcorner.com

Department of Computer Science, NCJ