Professional Documents
Culture Documents
Alogorithm:
Form Designs.
Master page
Programs:
Master Page code Design code:
<%@MasterLanguage="C#"AutoEventWireup="true"CodeFile="MasterPage.master.cs
"Inherits="MasterPa ge"%>
<htmlxmlns="http://www.w3.org/1999/xhtml">
<headrunat="server">
<title></title>
<styletype="text/css">
.style1
{
text-align: center;
}
.style2
{
font-family: Arial,Helvetica,sans-serif;
}
.style3
{
font-family: Arial,Helvetica,sans-serif; color: #990000;
}
.style4
{
color: #990000;
}
</style>
</head>
<body>
<formid="form1"runat="server">
<divstyle="height: 79px; background-color: #FFCC00;">
</div>
<divstyle="width: 202px; height: 539px; float:left; background-color: #FF00FF;"
class="style1">
<strong>MENU<br/>
<br/>
</strong><spanclass="style2">
<ahref="NewBankEntry.aspx"><strong><spanclass="style4">NewBankEntry</span></
strong></a></span
><strong><br class="style3"/>
<br/>
<brclass="style2"/>
</strong><spanclass="style2">
<ahref="NewBranchEntry.aspx"><strong><spanclass="style4">NewBranchEntry</spa
n></strong></a></ span><strong><br
class="style3"/>
<br/>
<brclass="style2"/>
</strong><spanclass="style2"><strong><spanclass="style4"><ahref="NewCustomerEn
try.aspx">NewCu stomerEntry</a></span></strong></span><br/>
<br/>
<ahref="DisplayAllRecordOfBank.aspx"><strong>Display All Record Of
Bank</strong></a><strong><br/>
</strong>
<br/>
<strong>
<ahref="DisplayBranchDetails.aspx">DisplayBranchDetails</a></strong><br/>
<br/>
<ahref="DisplayBalance.aspx">Display Balance</a></div>
<divstyle="height: 542px">
<asp:ContentPlaceHolderid="head"runat="server">
</asp:ContentPlaceHolder>
</div>
<divstyle="height: 48px; background-color: #9933FF;">
</div>
</form>
</body>
</html>
Form Designs.
New Bank Entry
New Book Entry Design Code:
<%@PageTitle=""Language="C#"MasterPageFile="~/MasterPage.master"AutoEventW
ireup="true"CodeFil e="NewBankEntry.aspx.cs"Inherits="NewBankEntry"%>
<asp:ContentID="Content1"ContentPlaceHolderID="head"Runat="Server">
<h2class="style1"style="color: #FF0000">New Bank Entry</h2>
<fieldset>
<tablestyle="width: 59%; height: 96px;"border="0"align="center">
<tr>
<tdstyle="width: 810px; text-align: right"> Bank ID</td>
<tdstyle="width: 578px">
<asp:TextBoxID="TextBox1"runat="server"Width="200px"></asp:TextBox>
</td>
</tr>
<tr>
<tdstyle="width: 810px; text-align: right">
Bank Name</td>
<tdstyle="width: 578px">
<asp:TextBoxID="TextBox2"runat="server"Width="200px"></asp:TextBox>
</td>
</tr>
<tr>
<tdstyle="width: 810px"> </td>
<tdstyle="width: 578px"> </td>
</tr>
<tr>
<tdstyle="width: 810px"> </td>
<tdstyle="width: 578px">
<asp:ButtonID="Button1"runat="server"Text="Submit"Width="100px" style="color:
#FF0000"onclick="Button1_Click"/>
</td>
</tr>
</table>
</fieldset>
</asp:Content>
Aspx code:
using System;
using System.Collections.Generic; using System.Linq;
using System.Web; using System.Web.UI;
using System.Web.UI.WebControls; using System.Data.SqlClient;
publicpartialclassNewBankEntry : System.Web.UI.Page
{
protectedvoid Page_Load(object sender, EventArgs e)
{
}
protectedvoid Button1_Click(object sender, EventArgs e)
{
SqlConnection con = newSqlConnection("Data Source=DHANANJAY-PC;Initial
Catalog=bankDB;User ID=sa;Password=123;Pooling=False");
con.Open();
string query = "insert into tbl_Bank(BankID,BankName)
values("+TextBox1.Text+",'"+TextBox2.Text+"')"; SqlCommand cmd =
newSqlCommand(query,con);
int i = cmd.ExecuteNonQuery(); if (i > 0)
{
Response.Write("<script language='javascript'>alert('insertion successful')</script>");
}
else
{
Response.Write("<script language='javascript'>alert('insertion
failed')</script>");
}
TextBox1.Text = ""; TextBox2.Text = "";
}
}
Form Designs.
New Branch Entry
New Branch Entry Design code
<%@PageTitle=""Language="C#"MasterPageFile="~/MasterPage.master"AutoEventW
ireup="true"CodeFil e="NewBranchEntry.aspx.cs"Inherits="NewBranchEntry"%>
<asp:ContentID="Content1"ContentPlaceHolderID="head"Runat="Server">
<h1> &
nbsp;  
;  
; &n bsp;
<spanstyle="color: #FF0000">New Branch Entry</span></h1>
<fieldset>
<tablestyle="width: 75%"align="center">
<tr>
<tdstyle="width: 159px; text-align: right;"> Branch ID</td>
<tdstyle="width: 474px">
<asp:TextBoxID="TextBox1"runat="server"Width="200px"Height="25px"></asp:Text
Box>
</td>
</tr>
<tr>
<tdstyle="width: 159px; text-align: right;"> Bank ID</td>
<tdstyle="width: 474px">
<asp:DropDownListID="DropDownList1"runat="server"Width="200px"Height="25px"
DataSourceID="SqlDataSource1"DataTextField="BankID"DataValueField="BankID">
<asp:ListItem>Select Bank ID</asp:ListItem>
</asp:DropDownList>
<asp:SqlDataSourceID="SqlDataSource1"runat="server" ConnectionString="<%$
ConnectionStrings:bankDBConnectionString %>" SelectCommand="SELECT
[BankID] FROM [tbl_Bank]"></asp:SqlDataSource>
</td>
</tr>
<tr>
<tdstyle="width: 159px; text-align: right;"> Branch Name</td>
<tdstyle="width: 474px">
<asp:TextBoxID="TextBox2"runat="server"Width="200px"Height="25px"></asp:Text
Box>
</td>
</tr>
<tr>
<tdstyle="width: 159px; text-align: right;"> </td>
<tdstyle="width: 474px"> </td>
</tr>
<tr>
<tdstyle="width: 159px; text-align: right;"> </td>
<tdstyle="width: 474px">
<asp:ButtonID="Button1"runat="server"Text="Submit"BackColor="Red"
Width="100px"onclick="Button1_Click"/>
</td>
</tr>
</table>
</fieldset>
</asp:Content>
Aspx code:
using System;
using System.Collections.Generic; using System.Linq;
using System.Web; using System.Web.UI;
using System.Web.UI.WebControls; using System.Data.SqlClient;
publicpartialclassNewBranchEntry : System.Web.UI.Page
{
protectedvoid Page_Load(object sender, EventArgs e)
{
}
protectedvoid Button1_Click(object sender, EventArgs e)
{
SqlConnection con = newSqlConnection("Data Source=DHANANJAY-PC;Initial
Catalog=bankDB;User ID=sa;Password=123;Pooling=False");
con.Open();
string query = "insert into tbl_Branch(BranchID,BankID,BranchName) values(" +
TextBox1.Text + ","+DropDownList1.SelectedValue+",'" + TextBox2.Text + "')";
SqlCommand cmd = newSqlCommand(query, con); int i = cmd.ExecuteNonQuery();
if (i > 0)
{
else
{
Response.Write("<script language='javascript'>alert('insertion
failed')</script>");
}
TextBox1.Text = ""; TextBox2.Text = "";
}
}
Form Designs.
New Customer Entry
New Customer Entry Design code:
<%@PageTitle=""Language="C#"MasterPageFile="~/MasterPage.master"AutoEventW
ireup="true"CodeFil e="NewCustomerEntry.aspx.cs"Inherits="NewCustomerEntry"%>
<asp:ContentID="Content1"ContentPlaceHolderID="head"Runat="Server">
<h1style="color:
#FF0000"> &n
bsp;
&nb
sp; New Customer
Entry</h1>
<fieldset>
<tablealign="center"style="width: 78%">
<tr>
<tdstyle="width: 219px; text-align: right; color: #FF0000;">
<b>Account Number:</b></td>
<tdstyle="width: 363px">
<asp:TextBoxID="TextBox_acc"runat="server"Width="200px"Height="25px"></asp:T
extBox>
</td>
</tr>
<tr>
<tdstyle="width: 219px; text-align: right; color: #FF0000;">
<b>Bank ID:</b></td>
<tdstyle="width: 363px">
<asp:DropDownListID="DropDownList_bid"runat="server"Width="200px"
Height="25px"DataSourceID="SqlDataSource1"DataTextField="BankID"
DataValueField="BankID">
</asp:DropDownList>
<asp:SqlDataSourceID="SqlDataSource1"runat="server" ConnectionString="<%$
ConnectionStrings:bankDBConnectionString %>" SelectCommand="SELECT
[BankID] FROM [tbl_Bank]"></asp:SqlDataSource>
</td>
</tr>
<tr>
<tdstyle="width: 219px; text-align: right; color: #FF0000;">
<b>Branch ID:</b></td>
<tdstyle="width: 363px">
<asp:DropDownListID="DropDownList_brachId"runat="server"Width="200px"
Height="25px"DataSourceID="SqlDataSource2"DataTextField="BranchID"
DataValueField="BranchID">
</asp:DropDownList>
<asp:SqlDataSourceID="SqlDataSource2"runat="server" ConnectionString="<%$
ConnectionStrings:bankDBConnectionString %>" SelectCommand="SELECT
[BranchID] FROM [tbl_Branch]"></asp:SqlDataSource>
</td>
</tr>
<tr>
<tdstyle="width: 219px; text-align: right; color: #FF0000;">
<b>Customer Name:</b></td>
<tdstyle="width: 363px">
<asp:TextBoxID="TextBox_custnm"runat="server"Width="200px"Height="25px"></a
sp:TextBox>
</td>
</tr>
<tr>
<tdstyle="width: 219px; text-align: right; color: #FF0000;">
<b>Address:</b></td>
<tdstyle="width: 363px">
<asp:TextBoxID="TextBox_add"runat="server"Width="200px"Height="25px"></asp:T
extBox>
</td>
</tr>
<tr>
<tdstyle="width: 219px; text-align: right; color: #FF0000;">
<b>Contact No:</b></td>
<tdstyle="width: 363px">
<asp:TextBoxID="TextBox_Con"runat="server"Width="200px"Height="25px"></asp:
TextBox>
</td>
</tr>
<tr>
<tdstyle="width: 219px; text-align: right; color: #FF0000;">
<b>Balance:</b></td>
<tdstyle="width: 363px">
<asp:TextBoxID="TextBox_bal"runat="server"Width="200px"Height="25px"></asp:T
extBox>
</td>
</tr>
<tr>
<tdstyle="width: 219px; text-align: right; color: #FF0000;"> </td>
<tdstyle="width: 363px"> </td>
</tr>
<tr>
<tdstyle="width: 219px; text-align: right; color: #FF0000;"> </td>
<tdstyle="width: 363px">
<asp:ButtonID="Button1"runat="server"BackColor="Red"Text="Submit"
Width="100px"onclick="Button1_Click"/>
</td>
</tr>
</table>
</fieldset>
</asp:Content>
Aspx Code:
using System;
using System.Collections.Generic; using System.Linq;
using System.Web; using System.Web.UI;
using System.Web.UI.WebControls; using System.Data.SqlClient;
publicpartialclassNewCustomerEntry : System.Web.UI.Page
{
protectedvoid Button1_Click(object sender, EventArgs e)
{
SqlConnection con = newSqlConnection("Data Source=DHANANJAY-PC;Initial
Catalog=bankDB;User ID=sa;Password=123;Pooling=False");
con.Open();
string query = "insert into
tbl_Account(AccountNo,BankID,BranchID,CustomerName,Address,ContactNo,Balanc
e)
values("+TextBox_acc.Text+","+DropDownList_bid.SelectedValue+","+DropDownList
_brachId.Selecte
dValue+",'"+TextBox_custnm.Text+"','"+TextBox_add.Text+"',"+TextBox_Con.Text+"
,"+TextBox_bal. Text+")";
SqlCommand cmd = newSqlCommand(query, con); int i = cmd.ExecuteNonQuery();
if (i > 0)
{
Response.Write("<script language='javascript'>alert('insertion successful')</script>");
}
else
{
Response.Write("<script language='javascript'>alert('insertion
failed')</script>");
}
TextBox_acc.Text = ""; TextBox_custnm.Text = ""; TextBox_add.Text = "";
TextBox_Con.Text = ""; TextBox_bal.Text = "";
}
}
Output:
Display all records of particular bank
Design code to Display all records of particular bank
<%@PageTitle=""Language="C#"MasterPageFile="~/MasterPage.master"AutoEventW
ireup="true"CodeFil
e="DisplayAllRecordOfBank.aspx.cs"Inherits="DisplayAllRecordOfBank"%>
<asp:ContentID="Content1"ContentPlaceHolderID="head"Runat="Server">
<h1> &
nbsp;  
; Display All Record of Particular Bank</h1>
<asp:LabelID="Label1"runat="server"
style="font-weight: 700; text-align: right; color: #FF0000" Text="Select The
Bank"></asp:Label>
:<asp:DropDownListID="DropDownList1"runat="server"AutoPostBack="True"onselectedindex
changed=" DropDownList1_SelectedIndexChanged">
</asp:DropDownList>
<br/>
<br/>
<br/>
<asp:GridViewID="GridView_details"runat="server"BackColor="White"
BorderColor="#CC9966"BorderStyle="None"BorderWidth="1px"CellPadding="4" style="text-
align: center"Width="380px">
<FooterStyleBackColor="#FFFFCC"ForeColor="#330099"/>
<HeaderStyleBackColor="#990000"Font-Bold="True"ForeColor="#FFFFCC"/>
<PagerStyleBackColor="#FFFFCC"ForeColor="#330099"HorizontalAlign="Center"/>
<RowStyleBackColor="White"ForeColor="#330099"/>
<SelectedRowStyleBackColor="#FFCC66"Font-Bold="True"ForeColor="#663399"/>
<SortedAscendingCellStyleBackColor="#FEFCEB"/>
<SortedAscendingHeaderStyleBackColor="#AF0101"/>
<SortedDescendingCellStyleBackColor="#F6F0C0"/>
<SortedDescendingHeaderStyleBackColor="#7E0000"/>
</asp:GridView>
<br/>
</asp:Content>
Aspx code:
using System;
using System.Collections.Generic; using System.Linq;
using System.Web; using System.Web.UI;
using System.Web.UI.WebControls; using System.Data.SqlClient; using System.Data;
publicpartialclassDisplayAllRecordOfBank : System.Web.UI.Page
{
SqlConnection con = newSqlConnection("Data Source=DHANANJAY-PC;Initial
Catalog=bankDB;User ID=sa;Password=123;Pooling=False");
SqlDataAdapter da;
SqlCommand cmd;
//string query;
<%@PageTitle=""Language="C#"MasterPageFile="~/MasterPage.master"AutoEventW
ireup="true"CodeFil
e="DisplayBranchDetails.aspx.cs"Inherits="DisplayBranchDetails"%>
<asp:ContentID="Content1"ContentPlaceHolderID="head"Runat="Server">
<h1>Display Branch Detail</h1>
<asp:LabelID="Label1"runat="server"Text="Select the BankName"></asp:Label>
:<asp:DropDownListID="DropDownList1"runat="server"AutoPostBack="True"
onselectedindexchanged="DropDownList1_SelectedIndexChanged">
</asp:DropDownList>
<br/>
<br/>
<asp:GridViewID="GridView1"runat="server">
</asp:GridView>
<br/>
</asp:Content>
Aspx code:
using System;
using System.Collections.Generic; using System.Linq;
using System.Web; using System.Web.UI;
using System.Web.UI.WebControls; using System.Data.SqlClient; using System.Data;
publicpartialclassDisplayBranchDetails : System.Web.UI.Page
{
SqlConnection con = newSqlConnection("Data Source=DHANANJAY-PC;Initial
Catalog=bankDB;User ID=sa;Password=123;Pooling=False");
SqlDataAdapter da;
SqlCommand cmd;
protectedvoid Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
con.Open();
string query = "select BankName from tbl_Bank "; cmd = newSqlCommand(query, con);
SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read())
{
DropDownList1.Items.Add(dr[0].ToString());
}
con.Close(); gvBankDetail();
}
}
privatevoid gvBankDetail()
{
try
{
con.Open();
string query = "select *from tbl_Bank,tbl_Branch where
tbl_Bank.BankID=tbl_Branch.BankID"; cmd = newSqlCommand(query, con);
da = newSqlDataAdapter(cmd); DataSet ds = newDataSet();
da.Fill(ds); GridView1.DataSource = ds; GridView1.DataBind(); con.Close();
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
}
protectedvoid DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{ try
{
con.Open();
string query = "select *from tbl_Bank,tbl_Branch where
tbl_Bank.BankID=tbl_Branch.BankID and tbl_Bank.BankName='" +
DropDownList1.SelectedItem + "'";
cmd = newSqlCommand(query, con); da = newSqlDataAdapter(cmd);
DataSet ds = newDataSet();
da.Fill(ds); GridView1.DataSource = ds; GridView1.DataBind(); con.Close();
}
catch (Exception ex){
Response.Write(ex.Message);
}
}
}
Display all records of a branch of particular bank
Design Code to display the balance for the entered account number
<%@PageTitle=""Language="C#"MasterPageFile="~/MasterPage.master"AutoEventW
ireup="true"CodeFil e="DisplayBalance.aspx.cs"Inherits="DisplayBalance"%>
<asp:ContentID="Content1"ContentPlaceHolderID="head"Runat="Server">
<tablestyle="width: 78%; height: 98px; vertical-align: middle; text-align: center;"
align="center">
<tr>
<tdstyle="width: 118px">
Account number </td>
<tdstyle="width: 155px">
<asp:TextBoxID="TextBox1"runat="server"Width="200px"></asp:TextBox>
</td>
<td> </td>
</tr>
<tr>
<tdstyle="width: 118px">
Bank ID</td>
<tdstyle="width: 155px">
<asp:DropDownListID="DropDownList1"runat="server"Width="200px">
</asp:DropDownList>
</td>
<td> </td>
</tr>
<tr>
<tdstyle="width: 118px">
Branch ID</td>
<tdstyle="width: 155px">
<asp:DropDownListID="DropDownList2"runat="server"Width="200px">
</asp:DropDownList>
</td>
<td> </td>
</tr>
<tr>
<tdstyle="width: 118px"> </td>
<tdstyle="width: 155px">
<asp:ButtonID="Button1"runat="server"Text="Display"Width="100px"
onclick="Button1_Click"/>
</td>
<td> </td>
</tr>
</table>
<asp:GridViewID="GridView1"runat="server">
</asp:GridView>
</asp:Content>
Aspx code:
using System;
using System.Collections.Generic; using System.Linq;
using System.Web; using System.Web.UI;
using System.Web.UI.WebControls; using System.Data.SqlClient; using System.Data;
publicpartialclassDisplayBalance : System.Web.UI.Page
{
SqlConnection con = newSqlConnection("Data Source=DHANANJAY-PC;Initial
Catalog=bankDB;User ID=sa;Password=123;Pooling=False");
SqlDataAdapter da;
SqlCommand cmd;
protectedvoid Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
con.Open();
string query = "select BankID from tbl_Bank "; cmd = newSqlCommand(query, con);
SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read())
{
DropDownList1.Items.Add(dr[0].ToString());
}
con.Close();
}
if (!IsPostBack)
{
con.Open();
string query = "select BranchID from tbl_Branch ";
}
protectedvoid Button1_Click(object sender, EventArgs e)
{
con.Open();
string query = "select *from tbl_Account where BranchID=" +
DropDownList2.SelectedValue + "and BankID=" + DropDownList1.SelectedItem + "
and AccountNo=" +TextBox1.Text+"";
con.Close();
}
Result