Professional Documents
Culture Documents
H.O.D(CSE/IT)
1|Page
Preface
Major Project is an integral part of B.Tech and each and every student has to create
the Major Project in the final year while studying in Institute.
This is concerned about our practical Major Project during final year of B.Tech
course. We have taken our Practical Major Project in True Blood Pump(Blood
Donation Website). During this Major Project, we got to learn many new things
about the technology and its practical implementation. This Major Project proved to
be a milestone in our knowledge of present environment. Every say and every
moment was an experience in itself, an experience which theoretical study cant
provide
2|Page
Acknowledgement
We wish to express our heartiest gratitude to Col (Dr.) J S Virk, retd. (Director/
Principal) JCDMCOE, Sirsa for their constant encouragement, constructive
suggestions, thought provoking decisions and giving us full opportunity to practically
handle the system without whose supervision this could not be possible.
We also take the privilege to pay our deepest appreciation and heartiest thanks to ER.
Lekha Bhambhu (HOD CSE/IT) whose constant guidance is unbounded source of
inspiration for us. We own a great debt of gratitude towards our honorable Mrs.
Manju Godara (A.P.) whose invaluable expert suggestions at crucial junctures set our
thinking on right track.
I take this opportunity to express my sincere thanks and deep gratitude to all these
people who extended their wholehearted cooperation and have helped me in
completing this project work successfully
Finally, I would like to thank my active friends for help they did to complete this
project.
3|Page
4|Page
(Jatin Sharma)
(Anil Prayag)
Certificate
_______________________________________________________
It is to certified that Mr. Jatin Sharma & Anil Paryag, students of Bachelor of
Technology(Information Technology), under class roll no. 1111252005 & 1111252004
for the session 2011-2015, has completed the project entitled TRUE BLOOD
PUMP under my supervision. The project is, in my opinion, worthy for consideration
for the award of Bachelor in Information Technology in accordance with the rules and
regulations of Guru Jambheswar University,Hisar.
I wish her/him all the success in his/her all endeavors.
Mrs. Manju Godara
Assistant professor
Department of Information technology
Jan Nayak Ch. Devi Lal Memorial College of Engineering,Sirsa
5|Page
Index
SNO.
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
6|Page
TITLE
Front Page
Preface
Acknowledgement
Student Declaration
Certificate
Index
Introduction to platform
SDLC
Introduction of project
Project Detail
Modules Detail
Coding
Screenshots
Conclusion
Future Scope
References
PAGE NO.
1
2
3
4
5
6
7-17
18-25
26-27
28-39
40-42
43-78
79-95
96
97
98
Introduction to Platform
Introduction to .NET:
.NET provides a simple object-oriented model to access most of the Windows
application programming interfaces (APIs). It also provides mechanisms by which
you can use the existing native code. In addition, it significantly extends the
development platform by providing tools and technologies to develop Internet-based
distributed applications.
The .NET Platform
The Microsoft .NET platform is described as follows, consists of four components:
.NET enterprise servers. The Microsoft .NET enterprise servers make up the
Microsoft .NET server infrastructure for deploying, managing, and operating
XML Web services and traditional applications. Examples of enterprise
servers are Microsoft SQL Server 2000 and Microsoft Commerce
Server 2000.
.NET foundation services. A core set of building block services that execute
standard tasks and act as a basis for developers to build upon. These
foundation services are known as Microsoft .NET My Services and provide
many features and functions. Most of the foundation services are hosted
(outsourced) services. An example of a currently available Web service is
Microsoft .NET Passport.
7|Page
8|Page
Advantages of .NET
The .NET Framework provides the following advantages:
A consistent, object-oriented programming environment.
A code-execution environment that:
o Promotes safe execution of code.
o Eliminates the performance problems of scripted or interpreted
environments.
o Minimizes software deployment and versioning conflicts.
A consistent experience for both developers and users across various types of
Windows-based and Web-based applications on multiple devices.
Communication built on the industry standards to ensure that code based on
the .NET Framework can integrate with any other code.
.NET is based on open Internet standards, which include Hypertext Transfer Protocol
(HTTP), Extensible Markup Language (XML), and Simple Object Access Protocol
(SOAP).
9|Page
10 | P a g e
(CLR components)
11 | P a g e
Introduction to ASP.NET:
ASP.Net is a web development platform, which provides a programming model, a
comprehensive software infrastructure and various services required to build up
robust web application for PC, as well as mobile devices.
ASP.Net works on top of the HTTP protocol and uses the HTTP commands and
policies to set a browser-to-server two-way communication and cooperation.
ASP.Net is a part of Microsoft .Net platform. ASP.Net applications are complied
codes, written using the extensible and reusable components or objects present in .Net
framework. These codes can use the entire hierarchy of classes in .Net framework.
The ASP.Net application codes could be written in either of the following languages:
C#
Jscript
J#
ASP.Net is used to produce interactive, data-driven web applications over the internet.
It consists of a large number of controls like text boxes, buttons and labels for
assembling, configuring and manipulating code to create HTML pages.
ASP.Net Web Forms Model:
ASP.Net web forms extend the event-driven model of interaction to the web
applications. The browser submits a web form to the web server and the server returns
a full markup page or HTML page in response.
All client side user activities are forwarded to the server for stateful processing. The
server processes the output of the client actions and triggers the reactions.
Now, HTTP is a stateless protocol. ASP.Net framework helps in storing the
information regarding the state of the application, which consists of:
Page state
Session state
The page state is the state of the client, i.e., the content of various input fields in the
web form. The session state is the collective obtained from various pages the user
visited and worked with, i.e., the overall session state. To clear the concept, let us take
up an example of a shopping cart as follows.
User adds items to a shopping cart. Items are selected from a page, say the items page,
and the total collected items and price are shown in a different page, say the cart page.
Only HTTP cannot keep track of all the information coming from various pages.
ASP.Net session state and server side infrastructure keeps track of the information
collected globally over a session.
12 | P a g e
The ASP.Net runtime carries the page state to and from the server across page
requests while generating the ASP.Net runtime codes and incorporates the state of the
server side components in hidden fields.
This way the server becomes aware of the overall application state and operates in a
two-tiered connected way.
ASP.Net Component Model:
The ASP.Net component model provides various building blocks of ASP.Net pages.
Basically it is an object model, which describes:
Server side counterparts of almost all HTML elements or tags, like <form>
and <input>.
13 | P a g e
Introduction to ADO.NET:
ADO.NET is an object-oriented set of libraries that allows you to interact with data
sources. Commonly, the data source is a database, but it could also be a text file, an
Excel spreadsheet, or an XML file. For the purposes of this tutorial, we will look at
ADO.NET as a way to interact with a data base.
As you are probably aware, there are many different types of databases available. For
example, there is Microsoft SQL Server, Microsoft Access, Oracle, Borland Interbase,
and IBM DB2, just to name a few. To further refine the scope of this tutorial, all of the
examples will use SQL Server.
Data Providers
We know that ADO.NET allows us to interact with different types of data sources and
different types of databases. However, there isn't a single set of classes that allow you
to accomplish this universally. Since different data sources expose different protocols,
we need a way to communicate with the right data source using the right protocol
Some older data sources use the ODBC protocol, many newer data sources use the
OleDb protocol, and there are more data sources every day that allow you to
communicate with them directly through .NET ADO.NET class libraries.
ADO.NET provides a relatively common way to interact with data sources, but comes
in different sets of libraries for each way you can talk to a data source. These libraries
are called Data Providers and are usually named for the protocol or data source type
they allow you to interact with. Table 1 lists some well known data providers, the API
prefix they use, and the type of data source they allow you to interact with.
14 | P a g e
Table 1. ADO.NET Data Providers are class libraries that allow a common way
to interact with specific data sources or protocols. The library APIs
have prefixes that indicate which provider they support.
Provider
Name
API
prefix
ODBC Data
Odbc
Provider
OleDb
Data
OleDb
Provider
Oracle
Data
Oracle
Provider
SQL
Data
Sql
Provider
Borland Data
Bdp
Provider
15 | P a g e
ADO.NET Objects
ADO.NET includes many objects you can use to work with data. This section
introduces some of the primary objects you will use. Over the course of this tutorial,
you'll be exposed to many more ADO.NET objects from the perspective of how they
are used in a particular lesson. The objects below are the ones you must know.
Learning about them will give you an idea of the types of things you can do with data
when using ADO.NET.
The SqlConnection Object
To interact with a database, you must have a connection to it. The connection helps
identify the database server, the database name, user name, password, and other
parameters that are required for connecting to the data base. A connection object is
used by command objects so they will know which database to execute the command
on.
The SqlCommand Object
The process of interacting with a database means that you must specify the actions
you want to occur. This is done with a command object. You use a command object to
send SQL statements to the database. A command object uses a connection object to
figure out which database to communicate with. You can use a command object
alone, to execute a command directly, or assign a reference to a command object to an
SqlDataAdapter, which holds a set of commands that work on a group of data as
described below.
The SqlDataReader Object
Many data operations require that you only get a stream of data for reading. The data
reader object allows you to obtain the results of a SELECT statement from a
command object. For performance reasons, the data returned from a data reader is a
fast forward-only stream of data. This means that you can only pull the data from the
stream in a sequential manner This is good for speed, but if you need to manipulate
data, then a DataSet is a better object to work with.
The DataSet Object
DataSet objects are in-memory representations of data. They contain multiple
Datatable objects, which contain columns and rows, just like normal database tables.
You can even define relations between tables to create parent-child relationships. The
DataSet is specifically designed to help manage data in memory and to support
disconnected operations on data, when such a scenario make sense. The DataSet is an
object that is used by all of the Data Providers, which is why it does not have a Data
Provider specific prefix.
The SqlDataAdapter Object
Sometimes the data you work with is primarily read-only and you rarely need to make
changes to the underlying data source Some situations also call for caching data in
memory to minimize the number of database calls for data that does not change. The
data adapter makes it easy for you to accomplish these things by helping to manage
data in a disconnected mode. The data adapter fills a DataSet object when reading the
data and writes in a single batch when persisting changes back to the database. A data
adapter contains a reference to the connection object and opens and closes the
connection automatically when reading from or writing to the database. Additionally,
the data adapter contains command object references for SELECT, INSERT,
UPDATE, and DELETE operations on the data. You will have a data adapter defined
16 | P a g e
for each table in a DataSet and it will take care of all communication with the
database for you. All you need to do is tell the data adapter when to load from or write
to the database.
Summary
ADO.NET is the .NET technology for interacting with data sources. You have several
Data Providers, which allow communication with different data sources, depending
on the protocols they use or what the database is. Regardless, of which Data Provider
used, you'll use a similar set of objects to interact with a data source. The
SqlConnection object lets you manage a connection to a data source. SqlCommand
objects allow you to talk to a data source and send commands to it. To have fast
forward-only read access to data, use the SqlDataReader. If you want to work with
disconnected data, use a DataSet and implement reading and writing to/from the data
source with a SqlDataAdapter.
17 | P a g e
SDLC
SDLC, Software Development Life Cycle is a process used by software industry to
design, develop and test high quality softwares. The SDLC aims to produce a high
quality software that meets or exceeds customer expectations, reaches completion
within times and cost estimates.
What is SDLC?
SDLC is a process followed for a software project, within a software organization. It
consists of a detailed plan describing how to develop, maintain, replace and alter or
enhance specific software. The life cycle defines a methodology for improving the
quality of software and the overall development process.
18 | P a g e
19 | P a g e
20 | P a g e
21 | P a g e
SDLC Models
There are various software development life cycle models defined and designed
which are followed during software development process. These models are also
referred as "Software Development Process Models". Each process model follows a
Series of steps unique to its type, in order to ensure success in process of software
development.
Following are the most important and popular SDLC models followed in the
industry:
Waterfall Model
Iterative Model
Spiral Model
V-Model
22 | P a g e
Waterfall Model
The Waterfall Model was first Process Model to be introduced. It is also referred to
as a linear-sequential life cycle model. It is very simple to understand and use. In a
waterfall model, each phase must be completed before the next phase can begin and
there is no overlapping in the phases.
Waterfall model is the earliest SDLC approach that was used for software
development .
The waterfall Model illustrates the software development process in a linear
sequential flow; hence it is also referred to as a linear-sequential life cycle model.
This means that any phase in the development process begins only if the previous
phase is complete. In waterfall model phases do not overlap.
Waterfall Model design
Waterfall approach was first SDLC Model to be used widely in Software
Engineering to ensure success of the project. In "The Waterfall" approach, the whole
process of software development is divided into separate phases. In Waterfall model,
typically, the outcome of one phase acts as the input for the next phase sequentially.
Following is a diagrammatic representation of different phases of waterfall model.
23 | P a g e
System Design: The requirement specifications from first phase are studied in
this phase and system design is prepared. System Design helps in specifying
hardware and system requirements and also helps in defining overall system
architecture.
All these phases are cascaded to each other in which progress is seen as flowing
steadily downwards (like a waterfall) through the phases. The next phase is started
only after the defined set of goals are achieved for previous phase and it is signed
off, so the name "Waterfall Model". In this model phases do not overlap.
24 | P a g e
Ample resources with required expertise are available to support the product.
Disadvantage
The disadvantage of waterfall development is that it does not allow for much
reflection or revision. Once an application is in the testing stage, it is very difficult to
go back and change something that was not well-documented or thought upon in the
concept stage.
25 | P a g e
Introduction of Project
TRUE BLOOD PUMP will be an information management system which helps to
manage the records of donors and patients at a blood bank. The system will allow the
authorized blood bank officer to login using a secret password and easily manage the
records of the blood donors and the patients in need of blood.
This is a web application which allows you to access the whole information about
Blood Bank Management Software, readily scalable and adaptable to meet the
complex need of Blood Banks Who are Key Facilitator for the Healthcare Sector; it
also supports all the functionalities of Blood Bank.
The key features of the system will be the following:
Search facility for finding blood donors based of various search criteria.
Problem Definition:
Entering the details about the blood groups, members, addresses etc. and tracking the
database is complicated when the details are maintained manually. This makes the
maintenance of schedule erroneous. India's blood banking system has serious short
comings. The gap between demand and supply of blood is continuously widening.
India has an annual requirement of approximately, 5.0 million units of blood. The
actual collection is only approximately 3.50 million units. A study conducted by the
National AIDS Control Organization (NACO), regarding blood banking services in
India has revealed many shortcomings, including the decentralized nature of blood
services, a shortage of human, technological and financial resources and a deficit in
the availability of blood, especially from voluntary donors. Paradoxically, very few
blood banks are operating to their full efficiency. Even during an emergency, the onus
is on the patient's relatives to arrange for replacement of blood.
26 | P a g e
Existing System:
Limitations of the Manual system:
It is time consuming
It leads to error prone results
It consumes lot of manpower to better results
It lacks of data security
Retrieval of data takes lot of time
Percentage of accuracy is less
Reports take time to produce
Proposed Solution:
An efficient blood bank management system for a Blood Bank should be developed,
with the aim of ensuring that every patient has access to an adequate quantity of safe
blood. The management system should solve the issue of demand and wastage and
lead to self sufficiency in blood requirement. The centralized system allocates a
unique ID for each donor and it is possible to trace the status of all donors for a
particular region where the system is implemented. It should also be replicable in
other Blood Banks.
27 | P a g e
Project Details
Objective of Project:
TRUE BLOOD PUMP is aims serving for human welfare. We have all the
information, you will ever need. Many people are here for you, to help you, willing to
donate blood for you anytime. We have done the entire job, rest is yours. Search the
blood group you need.
You can help us by registering on TRUE BLOOD PUMP if you are willing to donate
your blood when needed. As a proud member of TRUE BLOOD PUMP and a
responsible human being, you can help someone in need. So donate blood in online.
Feasibility Study:
Preliminary investigation examine project feasibility, the likelihood the system will be
useful to the organization. The main objective of the feasibility study is to test the
Technical, Operational and Economical feasibility for adding new modules and
debugging old running system. All system is feasible if they are unlimited resources
and infinite time. There are aspects in the feasibility study portion of the preliminary
investigation:
Technical Feasibility
Operation Feasibility
Economical Feasibility
1. Technical Feasibility
The technical issue usually raised during the feasibility stage of the investigation
includes the following:
Do the proposed equipments have the technical capacity to hold the data required
to use the new system?
Will the proposed system provide adequate response to inquiries, regardless of the
number or location of users?
28 | P a g e
Are there technical guarantees of accuracy, reliability, ease of access and data
security?
2. Operational Feasibility
Proposed projects are beneficial only if they can be turned out into information
system. That will meet the organizations operating requirements. Operational
feasibility aspects of the project are to be taken as an important part of the project
implementation. Some of the important issues raised are to test the operational
feasibility of a project includes the following:
Will the system be used and work properly if it is being developed and
implemented?
Will there be any resistance from the user that will undermine the possible
application benefits?
.
The well-planned design would ensure the optimal utilization of the computer
resources and would help in the improvement of performance status.
3. Economic Feasibility
A system can be developed technically and that will be used if installed must still be a
good investment for the organization. In the economical feasibility, the development
cost in creating the system is evaluated against the ultimate benefit derived from the
new systems. Financial benefits must equal or exceed the costs.
The system is economically feasible. It does not require any addition hardware or
software. Since the interface for this system is developed using the existing resources
and technologies available at NIC, There is nominal expenditure and economical
feasibility for certain.
30 | P a g e
Developing the system, which meets the SRS and solving all the requirements of
the system?
Demonstrating the system and installing the system at client's location after the
acceptance testing is successful.
Submitting the required user manual describing the system interfaces to work on it
and also the documents of the system.
Conducting any user training that might be needed for using the system.
31 | P a g e
Hardware Requirements:
Software Requirements:
Operating System
IDE
Front End
Language
Database
32 | P a g e
: Windows XP/7/8
: Microsoft Visual Studio 2010
: ASP.NET
: C#.NET
: SQL Server 2008
33 | P a g e
34 | P a g e
3. A circle or a bubble represents a process that transforms incoming data flow into
outgoing data flows.
4. An open rectangle is a data store, data at rest or a temporary repository of data
Constructing a DFD:
Several rules of thumb are used in drawing DFDS:
1. Process should be named and numbered for an easy reference. Each name should
be representative of the process.
2. The direction of flow is from top to bottom and from left to right.
Data
traditionally flow from source to the 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 alternative 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 short diagonal.
3. When a process is exploded into lower level details, they are numbered.
4. The names of data stores 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 contents of data store. Each data store should
contain all the data elements that flow in and out.
35 | P a g e
Questionnaires should contain all the data elements that flow in and out.
Missing interfaces redundancies and like is then accounted for often through
interviews.
Sailent features of DFDS
1. The DFD shows flow of data, not of control loops and decision are controlled
considerations do not appear on a DFD.
2. The DFD does not indicate the time factor involved in any process whether the
dataflow take place daily, weekly, monthly or yearly.
3. The sequence of events is not brought out on the DFD.
TYPES OF DATA FLOW DIAGRAMS
1. Current Physical
2. Current Logical
3. New Logical
4. New Physical
CURRENT PHYSICAL:
In Current Physical DFD process label include the name of people or their positions
or the names of computer systems that might provide some of the overall systemprocessing label includes an identification of the technology used to process the data.
Similarly data flows and data stores are often labels with the names of the actual
physical media on which data are stored such as file folders, computer files, business
forms or computer tapes.
CURRENT LOGICAL:
The physical aspects at the system are removed as much as possible so that the current
system is reduced to its essence to the data and the processors that transform them
regardless of actual physical form.
36 | P a g e
NEW LOGICAL:
This is exactly like a current logical model if the user were completely happy with the
functionality of the current system but had problems with how it was implemented
typically through the new logical model will differ from current logical model while
having additional functions, absolute function removal and inefficient flows
recognized.
NEW PHYSICAL:
The new physical represents only the physical implementation of the new system.
37 | P a g e
38 | P a g e
Donor
get blood Request
Blood
Mgmt
System
DB
Acceptor:
Search Blood donor
Acceptor
Send blood request
Request accepted
Blood
Mgmt
System
DB
Administrator:
Maintain info(Update/Del)
Administrator
Check all info
39 | P a g e
Blood
Mgmt
System
DB
Modules Detail
In this project mainly 3 modules are there.
Admin
Donors
Acceptors
Admin: This module focuses on the both donors & acceptors. Each member in a
donor & acceptor is given a user id and password, which identifies him uniquely. The
member is given a login form. He enters the login details user id and password. The
options given to
Logout
Whenever a user wants to change his / her password he can select the change
password option. The system displays the form, which asks him for his old password
and new password. The system then compares the old password with the existing
password in the database and if they match then the password is set to the new
password in the database. The id for retrieving the details from the database is brought
through the session, which is maintained using cookies in the form. This removes the
burden on user in typing user id again and also maintains security by not allowing one
user to change password of other accidentally.
Donor: Each member in a Donor is given a user id and password, which identifies
him uniquely. The member is given a login form. he enters the login details user id
and password. The options given to a each member in a staff are
Logout
40 | P a g e
Whenever a user wants to change his / her password he can select the change
password option. The system displays the form, which asks him for his old password
and new password. The system then compares the old password with the existing
password in the database and if they match then the password is set to the new
password in the database. The employee id for retrieving the details from the database
is brought through the session, which is maintained using cookies in the form. This
removes the burden on user in typing user id again and also maintains security by not
allowing one user to change password of other accidentally.
At the end the user is able to log out from the system using the logout option.
41 | P a g e
Logout
42 | P a g e
Coding
Home.aspx
<%@Page Title=""Language="C#"MasterPageFile="~/MasterPage.master"
AutoEventWireup="true" CodeFile="Home.aspx.cs" Inherits="Home" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<style type="text/css">
.style1
{
width: 271px;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2"
Runat="Server">
<div style="text-align:center; margin-top:0px;">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:AdRotator ID="AdRotator1" runat="server" height="300px" width="1000px"
AdvertisementFile="advertise.xml" onadcreated="AdRotator1_AdCreated"/>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
</Triggers>
</asp:UpdatePanel>
<asp:Timer ID="Timer1" runat="server" Interval="2000">
</asp:Timer>
</div>
</asp:Content>
<asp:ContentID="Content4"runat="server"contentplaceholderid="ContentPlaceHol1"
>
<center style="font-style:italic; font-size:xx-large"><b><i>!!Welcome to True
Blood Pump!!</i></b></center><br /><br />
<fieldset style="border-width:thick;">
<legend style="font-size:x-large; font-weight:bolder;">Login Here</legend>
<table style="width: 430px; height: 177px" >
<tr>
<td class="style4">
<asp:Label ID="Label2" runat="server" Text="Username" placeholder="enter
username*" required="required" ></asp:Label></td>
<td class="style4"></td>
<td class="style1"><asp:TextBox ID="TextBox1"
runat="server"></asp:TextBox></td></tr>
<tr>
43 | P a g e
<td>
<asp:ImageButton ID="ImageButton3" runat="server" Height="95px"
ImageUrl="~/images/Capture.JPG" style="margin-left: 100px; marginbottom: 0px"
Width="190px" onclick="ImageButton3_Click" />
</td>
</tr>
</table>
</fieldset>
<br /><br />
</asp:Content>
Home.aspx.cs
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;
using System.Configuration;
public partial class Home : System.Web.UI.Page
{
SqlConnection cn = new
SqlConnection(ConfigurationManager.ConnectionStrings["conn"].ConnectionString);
protected void Page_Load(object sender, EventArgs e)
{
}
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
if (DropDownList1.SelectedValue == "Donor")
{
try
{
SqlCommand cmd = new SqlCommand("select Email_id,Passwd from
donoreg where Email_id=@a and Passwd=@b", cn);
cn.Open();
cmd.Parameters.AddWithValue("@a", TextBox1.Text);
cmd.Parameters.AddWithValue("@b", TextBox2.Text);
SqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
{
45 | P a g e
else
{
Label4.Text = "Login Failed";
}
}
protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
{
}
protected void ImageButton2_Click1(object sender, ImageClickEventArgs e)
{
Response.Redirect("Donorreg.aspx");
}
protected void AdRotator1_AdCreated(object sender, AdCreatedEventArgs e)
{
}
protected void ImageButton3_Click(object sender, ImageClickEventArgs e)
{
Response.Redirect("Acceptorreg.aspx");
}
}
47 | P a g e
donor.aspx
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master"
AutoEventWireup="true" CodeFile="donor.aspx.cs" Inherits="donor" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2"
Runat="Server">
<div style="text-align:center; margin-top:0px;">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:AdRotator ID="AdRotator1" runat="server" height="300px" width="1000px"
AdvertisementFile="advertise.xml" onadcreated="AdRotator1_AdCreated"/>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
</Triggers>
</asp:UpdatePanel>
<asp:Timer ID="Timer1" runat="server" Interval="2000">
</asp:Timer>
</div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<table>
<tr>
<td style="margin-left:0px;"><asp:Label ID="Label1" runat="server"
Text="Welcome:"></asp:Label><b> <asp:Label ID="Label2" runat="server"
Text="Label"></asp:Label></b></td>
<td><h4 style="margin-left:230px; margin-top:12px;">Logged-In|<a
href="Home.aspx">Logged-Out</a></h4></td>
</tr>
</table><br />
<center><table><tr>
<td><a href="whydonateblood.aspx">>>Why donate Blood?<<</a></td>
</tr></table></center><br />
<table>
<tr>
<td><b><u>BLOOD REQUESTS:-</u></b></td>
</tr>
<tr>
<td><asp:Button ID="Button1" runat="server"
Text="Click here to see blood request" onclick="Button1_Click" /></td>
</tr></table><br />
<center><table>
<tr>
<td><asp:GridView ID="GridView1" runat="server">
</asp:GridView></td>
<td><asp:Label ID="Label3" runat="server" Text=""></asp:Label></td>
</tr>
48 | P a g e
</table></center>
</asp:Content>
donor.aspx.cs
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.Configuration;
using System.Data;
public partial class donor : System.Web.UI.Page
{
SqlConnection cn = new
SqlConnection(ConfigurationManager.ConnectionStrings["conn"].ConnectionString);
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
Label2.Text = Session["textbox1"].ToString();
}
}
protected void AdRotator1_AdCreated(object sender, AdCreatedEventArgs e)
{
}
string st;
protected void Button1_Click(object sender, EventArgs e)
{
string id = Label2.Text;
SqlCommand cmd = new SqlCommand("select Blood_group from donoreg
where Email_id='"+id+"'", cn);
cn.Open();
object ss = cmd.ExecuteScalar();
string stt=ss.ToString();
SqlDataAdapter daa = new SqlDataAdapter("select * from bloodreq where
Blood_group='" + stt + "'", cn);
DataTable dt = new DataTable();
daa.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();
49 | P a g e
cn.Close();
}
}
50 | P a g e
acceptor.aspx
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master"
AutoEventWireup="true" CodeFile="acceptor.aspx.cs" Inherits="acceptor" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2"
Runat="Server">
<div style="text-align:center; margin-top:0px;">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:AdRotator ID="AdRotator1" runat="server" height="300px" width="1000px"
AdvertisementFile="advertise.xml"/>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
</Triggers>
</asp:UpdatePanel>
<asp:Timer ID="Timer1" runat="server" Interval="2000">
</asp:Timer>
</div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<table>
<tr>
<td style="margin-left:0px;"><asp:Label ID="Label1" runat="server"
Text="Welcome:"></asp:Label><b> <asp:Label ID="Label2" runat="server"
Text="Label"></asp:Label></b></td>
<td><h4 style="margin-left:270px; margin-top:12px;">Logged-In|<a
href="Home.aspx">Log-Out</a></h4></td>
</tr>
</table>
<center><table><tr>
<td><a href="whoneedsblood.aspx">>>Who needs Blood?<<</a></td>
</tr></table></center>
<table>
<tr>
<td><b>Find a blood group:-</b></td>
</tr>
</table>
<br />
<center><table>
<tr>
<td>
<center><asp:DropDownList ID="DropDownList1" runat="server"
Height="22px"
51 | P a g e
Width="172px" >
<asp:ListItem>---------------Select-----------------</asp:ListItem>
<asp:ListItem>A</asp:ListItem>
<asp:ListItem>A+</asp:ListItem>
<asp:ListItem>B</asp:ListItem>
<asp:ListItem>B+</asp:ListItem>
<asp:ListItem>O</asp:ListItem>
<asp:ListItem>O+</asp:ListItem>
<asp:ListItem>O-</asp:ListItem>
<asp:ListItem>AB</asp:ListItem>
<asp:ListItem>AB+</asp:ListItem>
</asp:DropDownList></center>
</td>
</tr>
<tr>
<td><asp:Button ID="Button1" runat="server" Text="Search"
onclick="Button1_Click"/></td>
</tr>
</table></center> <br />
<center> <table>
<tr>
<td>
<asp:GridView ID="GridView1" runat="server">
</asp:GridView>
</td>
</tr>
</table></center>
<table>
<tr>
<td>
<b>Make a blood request:-</b>
</td>
</tr>
</table>
<center><br /> <table><tr>
<td>Name</td>
<td>
</tr>
<tr>
<td><asp:Button ID="Button2" runat="server" Text="Send"
onclick="Button2_Click" /></td><td><asp:Label
ID="Label3" runat="server" Text=""></asp:Label></td>
</tr>
</table></center>
</asp:Content>
acceptor.aspx.cs
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.Configuration;
using System.Data;
public partial class acceptor : System.Web.UI.Page
{
SqlConnection cn = new
SqlConnection(ConfigurationManager.ConnectionStrings["conn"].ConnectionString);
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
Label2.Text = Session["textbox1"].ToString();
//GridView1.Visible = false;
}
cn.Open();
SqlCommand cmd = new SqlCommand("select Name,Phone_no from
acceptoreg where Email_id='"+Label2.Text+"'",cn);
SqlDataReader dr = cmd.ExecuteReader();
if (dr.Read())
{
TextBox1.Text = dr[0].ToString();
TextBox2.Text = dr[1].ToString();
}
cn.Close();
}
String bg;
protected void Button1_Click(object sender, EventArgs e)
{
if (DropDownList1.SelectedValue == "A")
{
bg = "A";
53 | P a g e
cmd.Parameters.AddWithValue("@a", TextBox1.Text);
if (DropDownList1.SelectedValue == "A")
{
bg = "A";
}
else if (DropDownList1.SelectedValue == "A+")
{
bg = "A+";
}
else if (DropDownList1.SelectedValue == "B")
{
bg = "B";
}
else if (DropDownList1.SelectedValue == "B+")
{
bg = "B+";
}
else if (DropDownList1.SelectedValue == "O")
{
bg = "O";
}
else if (DropDownList1.SelectedValue == "O+")
{
bg = "O+";
}
else if (DropDownList1.SelectedValue == "O-")
{
bg = "O-";
}
else if (DropDownList1.SelectedValue == "AB+")
{
bg = "AB+";
}
else
{
bg = "AB-";
}
cmd.Parameters.AddWithValue("@b", bg);
cmd.Parameters.AddWithValue("@c", TextBox2.Text);
cmd.Parameters.AddWithValue("@d", TextBox3.Text)
cmd.ExecuteNonQuery();
Label3.Text = "REQUEST SENT";
cn.Close();
}
catch (Exception ex)
{
Label3.Text = ex.Message;
}
}}
56 | P a g e
admin.aspx
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master"
AutoEventWireup="true" CodeFile="admin.aspx.cs" Inherits="admin" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2"
Runat="Server">
<div style="text-align:center; margin-top:0px;">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:AdRotator ID="AdRotator1" runat="server" height="300px" width="1000px"
AdvertisementFile="advertise.xml"/>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
</Triggers>
</asp:UpdatePanel>
<asp:Timer ID="Timer1" runat="server" Interval="2000">
</asp:Timer>
</div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<center style="font-style:italic; font-size:xx-large"><b><i>!!Welcome to Admin
Page!!</i></b></center>
<table>
<tr>
<td><h4 style="margin-left:450px; margin-top:12px;">Logged-In|<a
href="Home.aspx">Log-Out</a></h4></td>
</tr>
</table>
<center><table>
<tr>
<td>
<center style="font-style:normal; font-size:x-large"><b><a
href="donordetails.aspx">>>Click here to see & Update Donor
Details<<</a></b></center>
</td>
</tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr>
<td><center style="font-style:normal; font-size:x-large"><b><a
href="acceptordetails.aspx">>>Click here to see & Update Acceptor
Details<<</a></b></center></td>
</tr>
57 | P a g e
</table></center>
</asp:Content>
admin.aspx.cs
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.Configuration;
using System.Data;
public partial class admin : System.Web.UI.Page
{
SqlConnection cn = new
SqlConnection(ConfigurationManager.ConnectionStrings["conn"].ConnectionString);
string chk;
protected void Page_Load(object sender, EventArgs e)
{
//if (!Page.IsPostBack)
//{
// LoadGrid();
//}
}
}
58 | P a g e
acceptordetails.aspx
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage2.master"
AutoEventWireup="true" CodeFile="acceptordetails.aspx.cs"
Inherits="acceptordetails" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<table>
<tr>
<td><h4 style="margin-left:850px; margin-top:12px;">Logged-In|<a
href="Home.aspx">Log-Out</a></h4></td>
</tr>
</table>
<center style="font-style:italic; font-size:xx-large"><b><i><u>Acceptor
Details</u></i></b></center>
<center><table>
<tr>
<td><asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
CssClass="style2" DataKeyNames="Registeration_ID"
onrowdeleting="GridView1_RowDeleting"
onrowcancelingedit="GridView1_RowCancelingEdit"
onrowediting="GridView1_RowEditing"
onselectedindexchanged="GridView1_SelectedIndexChanged2"
onrowupdating="GridView1_RowUpdating">
<Columns>
<asp:TemplateField HeaderText="Registration_ID">
<ItemTemplate>
<asp:Label runat="server" ID="lblid" Text='<%# Eval("Registeration_ID")
%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Name">
<ItemTemplate>
<asp:Label runat="server" ID="name" Text='<%# Eval("Name")
%>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtname" Text='<%# Eval("Name") %>'
runat="server"></asp:TextBox>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Gender">
<ItemTemplate>
<asp:Label runat="server" ID="gender" Text='<%# Eval("Gender")
%>'></asp:Label>
</ItemTemplate>
59 | P a g e
<EditItemTemplate>
<asp:TextBox ID="txtgender" Text='<%# Eval("Gender") %>'
runat="server"></asp:TextBox>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="D.O.B">
<ItemTemplate>
<asp:Label runat="server" ID="dob" Text='<%# Eval("dob")
%>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtdob" Text='<%# Eval("dob") %>'
runat="server"></asp:TextBox>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Photo">
<ItemTemplate>
<asp:Image runat="server" ID="img" ImageUrl='<%# Eval("Photo") %>'
Width="90px" Height="90px"></asp:Image>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Action">
<ItemTemplate>
<asp:Button ID="btnedit" runat="server" CommandName="edit"
Text="Edit" />
<asp:Button runat="server" ID="btndelete" CommandName="delete"
Text="Delete" />
</ItemTemplate>
<EditItemTemplate>
<asp:Button runat="server" ID="btnupdate" CommandName="update"
Text="Update" />
<asp:Button runat="server" ID="btncancel" CommandName="cancel"
Text="Cancel" />
</EditItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</td>
</tr>
</table></center>
<br /><br />
<center style="font-style:italic; font-size:xx-large"><b><i><u>Blood
Request</u></i></b></center>
<center>
<table>
<tr>
<td><asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False"
DataSourceID="SqlDataSource1">
<Columns>
<asp:BoundField DataField="Name" HeaderText="Name"
SortExpression="Name" />
<asp:BoundField DataField="Blood_group" HeaderText="Blood_group"
60 | P a g e
SortExpression="Blood_group" />
<asp:BoundField DataField="Phone_no" HeaderText="Phone_no"
SortExpression="Phone_no" />
<asp:BoundField DataField="Comment" HeaderText="Comment"
SortExpression="Comment" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:tbpConnectionString %>"
SelectCommand="SELECT [Name], [Blood_group], [Phone_no], [Comment]
FROM [bloodreq]">
</asp:SqlDataSource>
</td>
</tr>
</table>
</center>
<asp:Label ID="Label1" runat="server"></asp:Label>
</asp:Content>
acceptordetails.aspx.cs
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.Configuration;
using System.Data;
public partial class acceptordetails : System.Web.UI.Page
{
SqlConnection cn = new
SqlConnection(ConfigurationManager.ConnectionStrings["conn"].ConnectionString);
string chk;
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
LoadGrid();
}
}
void LoadGrid()
{
SqlDataAdapter da = new SqlDataAdapter("select * from acceptoreg", cn);
DataTable dt = new DataTable();
da.Fill(dt);
GridView1.DataSource = dt;
61 | P a g e
GridView1.DataBind();
}
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs
e)
{
int id1 = Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Value);
SqlCommand cmd = new SqlCommand("delete from acceptoreg where
Registeration_ID='" + id1 + "'", cn);
cn.Open();
cmd.ExecuteNonQuery();
cn.Close();
LoadGrid();
}
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
try
{
GridView1.EditIndex = e.NewEditIndex;
LoadGrid();
}
catch (Exception ex)
{
Label1.Text = ex.Message;
}
}
protected void GridView1_RowCancelingEdit(object sender,
GridViewCancelEditEventArgs e)
{
GridView1.EditIndex = -1;
LoadGrid();
}
protected void GridView1_RowUpdating(object sender,
GridViewUpdateEventArgs e)
{
int id1 = Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Value);
TextBox name = (TextBox)
(GridView1.Rows[e.RowIndex].FindControl("txtname"));
TextBox gender = (TextBox)
(GridView1.Rows[e.RowIndex].FindControl("txtgender"));
TextBox dob = (TextBox)
(GridView1.Rows[e.RowIndex].FindControl("txtdob"));
SqlCommand cmd = new SqlCommand("update acceptoreg set Name='" +
name.Text + "',Gender='" + gender.Text + "' ,dob='" + dob.Text + "'where
Registeration_ID='" + id1 + "'", cn);
cn.Open();
cmd.ExecuteNonQuery();
cn.Close();
GridView1.EditIndex = -1;
LoadGrid();
}
62 | P a g e
donordetails.aspx
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage2.master"
AutoEventWireup="true" CodeFile="donordetails.aspx.cs" Inherits="donordetails"
%>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<table>
<tr>
<td><h4 style="margin-left:850px; margin-top:12px;">Logged-In|<a
href="Home.aspx">Log-Out</a></h4></td>
</tr>
</table>
<center style="font-style:italic; font-size:xx-large"><b><i><u>Donor
Details</u></i></b></center>
<center><table>
<tr>
<td><asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
CssClass="style2" DataKeyNames="Registeration_ID"
onrowdeleting="GridView1_RowDeleting"
onrowcancelingedit="GridView1_RowCancelingEdit"
onrowediting="GridView1_RowEditing"
onselectedindexchanged="GridView1_SelectedIndexChanged2"
onrowupdating="GridView1_RowUpdating">
<Columns>
<asp:TemplateField HeaderText="Registration_ID">
<ItemTemplate>
<asp:Label runat="server" ID="lblid" Text='<%# Eval("Registeration_ID")
%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Name">
<ItemTemplate>
<asp:Label runat="server" ID="name" Text='<%# Eval("Name")
%>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtname" Text='<%# Eval("Name") %>'
runat="server"></asp:TextBox>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Gender">
<ItemTemplate>
<asp:Label runat="server" ID="gender" Text='<%# Eval("Gender")
%>'></asp:Label>
</ItemTemplate>
63 | P a g e
<EditItemTemplate>
<asp:TextBox ID="txtgender" Text='<%# Eval("Gender") %>'
runat="server"></asp:TextBox>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="D.O.B">
<ItemTemplate>
<asp:Label runat="server" ID="dob" Text='<%# Eval("dob")
%>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtdob" Text='<%# Eval("dob") %>'
runat="server"></asp:TextBox>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Blood_group">
<ItemTemplate>
<asp:Label runat="server" ID="bgp" Text='<%# Eval("Blood_group")
%>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtbgp" Text='<%# Eval("Blood_group") %>'
runat="server"></asp:TextBox>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Photo">
<ItemTemplate>
<asp:Image runat="server" ID="img" ImageUrl='<%# Eval("Photo") %>'
Width="90px" Height="90px"></asp:Image>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Action">
<ItemTemplate>
<asp:Button ID="btnedit" runat="server" CommandName="edit"
Text="Edit" />
<asp:Button runat="server" ID="btndelete" CommandName="delete"
Text="Delete" />
</ItemTemplate>
<EditItemTemplate>
<asp:Button runat="server" ID="btnupdate" CommandName="update"
Text="Update" />
<asp:Button runat="server" ID="btncancel" CommandName="cancel"
Text="Cancel" />
</EditItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</td>
</tr>
</table></center>
<asp:Label ID="Label1" runat="server"></asp:Label>
64 | P a g e
</asp:Content>
donordetails.aspx.cs
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.Configuration;
using System.Data;
public partial class donordetails : System.Web.UI.Page
{
SqlConnection cn = new
SqlConnection(ConfigurationManager.ConnectionStrings["conn"].ConnectionString);
string chk;
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
LoadGrid();
}
}
void LoadGrid()
{
SqlDataAdapter da = new SqlDataAdapter("select * from donoreg", cn);
DataTable dt = new DataTable();
da.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();
}
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs
e)
{
int id1 = Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Value);
SqlCommand cmd = new SqlCommand("delete from donoreg where
Registeration_ID='" + id1 + "'", cn);
cn.Open();
cmd.ExecuteNonQuery();
cn.Close();
LoadGrid();
}
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
try
{
GridView1.EditIndex = e.NewEditIndex;
LoadGrid();
}
catch (Exception ex)
65 | P a g e
{
Label1.Text = ex.Message;
}
}
protected void GridView1_SelectedIndexChanged2(object sender, EventArgs e)
{
}
protected void GridView1_RowCancelingEdit(object sender,
GridViewCancelEditEventArgs e)
{
GridView1.EditIndex = -1;
LoadGrid();
}
protected void GridView1_RowUpdating(object sender,
GridViewUpdateEventArgs e)
{
int id1 = Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Value);
TextBox name = (TextBox)
(GridView1.Rows[e.RowIndex].FindControl("txtname"));
TextBox gender = (TextBox)
(GridView1.Rows[e.RowIndex].FindControl("txtgender"));
TextBox dob = (TextBox)
(GridView1.Rows[e.RowIndex].FindControl("txtdob"));
TextBox bgp = (TextBox)
(GridView1.Rows[e.RowIndex].FindControl("txtbgp"));
SqlCommand cmd = new SqlCommand("update donoreg set Name='" +
name.Text + "',Gender='" + gender.Text + "'
,dob='"+dob.Text+"',Blood_group='"+bgp.Text+"'where Registeration_ID='" + id1 +
"'", cn);
cn.Open();
cmd.ExecuteNonQuery();
cn.Close();
GridView1.EditIndex = -1;
LoadGrid();
}
}
66 | P a g e
Donorreg.aspx
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master"
AutoEventWireup="true" CodeFile="Donorreg.aspx.cs" Inherits="Donorreg" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<style type="text/css">
.style13
{
width: 338px;
}
.style15
{
height: 70px;
width: 182px;
}
.style16
{
width: 338px;
height: 70px;
}
.style19
{
height: 27px;
width: 182px;
}
.style20
{
width: 338px;
height: 27px;
}
.style21
{
height: 30px;
width: 182px;
}
.style22
{
width: 338px;
height: 30px;
}
.style23
{
width: 182px;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2"
Runat="Server">
<div style="text-align:center; margin-top:0px;">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
67 | P a g e
<ContentTemplate>
<asp:AdRotator ID="AdRotator1" runat="server" height="300px" width="1000px"
AdvertisementFile="advertise.xml"/>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
</Triggers>
</asp:UpdatePanel>
<asp:Timer ID="Timer1" runat="server" Interval="2000">
</asp:Timer>
</div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<script type="text/javascript" language="javascript">
function Validate1(source, args) {
var s = document.getElementById('TextBox3').value;
if (s.length == 10) {
return args.IsValid = true;
}
else {
return args.IsValid = false;
}
}
</script>
<center style="font-style:italic; font-size:xx-large"><b><i><u>Donor
Registration</u></i></b></center><br />
<center><table bgcolor="#CCCCFF" border="5">
<tr>
<td><asp:Label ID="Label1" runat="server" Text="Name"></asp:Label></td>
<td><asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="TextBox1" ErrorMessage="*"
ForeColor="Red"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td><asp:Label ID="Label2" runat="server" Text="Gender"></asp:Label></td>
<td>
<asp:RadioButton ID="RadioButton1" runat="server" Text="Male"
/>
<asp:RadioButton ID="RadioButton2" runat="server" Text="Female" />
</td>
</tr>
<tr>
<td>D.O.B</td>
<td>
68 | P a g e
69 | P a g e
</tr>
<tr>
<td>
Email-id:
</td>
<td><asp:TextBox ID="TextBox2" runat="server" ></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1"
runat="server"
ControlToValidate="TextBox2" ErrorMessage="Plz Enter a Valid Address"
ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+
([-.]\w+)*"></asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<td >Password</td>
<td>
<asp:TextBox ID="TextBox5" runat="server"
TextMode="Password"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server"
ControlToValidate="TextBox5" ErrorMessage="*"
ForeColor="Red"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>Confirm Password</td>
<td>
<asp:TextBox ID="TextBox6" runat="server"
TextMode="Password"></asp:TextBox>
<asp:CompareValidator ID="CompareValidator1" runat="server"
ControlToCompare="TextBox5" ControlToValidate="TextBox6"
ErrorMessage="Password doesn't match "></asp:CompareValidator>
</td>
</tr>
<tr>
<td>Upload Photo</td>
<td>
<asp:FileUpload ID="FileUpload1" runat="server" />
</td></tr>
<tr>
<td>
</td>
<td>
<asp:Button ID="Button1" runat="server" Text="Submit" style="marginbottom: 0px" onclick="Button1_Click" />
<asp:Button ID="Button2"
runat="server" Text="Cancel" onclick="Button2_Click"
/>
</td>
70 | P a g e
Donorreg.aspx.cs
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;
using System.Configuration;
public partial class Donorreg : System.Web.UI.Page
{
SqlConnection cn = new
SqlConnection(ConfigurationManager.ConnectionStrings["conn"].ConnectionString);
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
Calendar1.Visible = false;
LoadGrid();
}
}
void LoadGrid()
{
SqlDataAdapter da = new SqlDataAdapter("select * from donoreg", cn);
DataTable dt = new DataTable();
da.Fill(dt);
}
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
Calendar1.Visible = true;
}
protected void Calendar1_SelectionChanged(object sender, EventArgs e)
{
TextBox9.Text = Calendar1.SelectedDate.ToShortDateString();
Calendar1.Visible = false;
}
protected void CustomValidator1_ServerValidate(object source,
ServerValidateEventArgs args)
{
if (TextBox3.Text.Length < 10)
{
71 | P a g e
args.IsValid = false;
}
else
{
args.IsValid = true;
}
}
string bg;
protected void Button1_Click(object sender, EventArgs e)
{
try
{
SqlCommand cmd = new SqlCommand("insert into donoreg
values(@a,@b,@c,@d,@e,@f,@g,@h,@i)", cn);
cn.Open();
cmd.Parameters.AddWithValue("@a", TextBox1.Text);
if (RadioButton1.Checked)
{
cmd.Parameters.AddWithValue("@b", RadioButton1.Text);
}
else
{
cmd.Parameters.AddWithValue("@b", RadioButton2.Text);
}
cmd.Parameters.AddWithValue("@c", TextBox9.Text);
cmd.Parameters.AddWithValue("@d", TextBox3.Text);
cmd.Parameters.AddWithValue("@e", TextBox4.Text);
if (DropDownList1.SelectedValue == "A")
{
bg = "A";
}
else if (DropDownList1.SelectedValue == "A+")
{
bg = "A+";
}
else if (DropDownList1.SelectedValue == "B")
{
bg = "B";
}
else if (DropDownList1.SelectedValue == "B+")
{
bg = "B+";
}
else if (DropDownList1.SelectedValue == "O")
{
bg = "O";
}
else if (DropDownList1.SelectedValue == "O+")
{
bg = "O+";
72 | P a g e
}
else if (DropDownList1.SelectedValue == "O-")
{
bg = "O-";
}
else if (DropDownList1.SelectedValue == "AB+")
{
bg = "AB+";
}
else
{
bg = "AB-";
}
cmd.Parameters.AddWithValue("@f", bg);
cmd.Parameters.AddWithValue("@g", TextBox2.Text);
cmd.Parameters.AddWithValue("@h", TextBox5.Text);
string path = FileUpload1.PostedFile.FileName;
FileUpload1.SaveAs(MapPath("~/images/" + path));
cmd.Parameters.AddWithValue("@i", "~/images/" + path);
cmd.ExecuteNonQuery();
//cn.Close();
Label3.Text = "Data Saved";
cn.Close();
}
catch (Exception ex)
{
Label3.Text = ex.Message;
}
}
protected void Button2_Click(object sender, EventArgs e)
{
TextBox1.Text = String.Empty;
RadioButton1.Checked = false;
RadioButton2.Checked = false;
TextBox9.Text = String.Empty;
TextBox3.Text = String.Empty;
TextBox4.Text = String.Empty;
DropDownList1.SelectedValue = null;
TextBox2.Text = String.Empty;
TextBox5.Text = String.Empty;
TextBox6.Text = String.Empty;
RequiredFieldValidator1.Visible = false;
RequiredFieldValidator2.Visible = false;
RequiredFieldValidator3.Visible = false;
RequiredFieldValidator5.Visible = false;
Label3.Text = String.Empty;
}
}
73 | P a g e
Acceptorreg.aspx
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master"
AutoEventWireup="true" CodeFile="Acceptorreg.aspx.cs" Inherits="Acceptor" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2"
Runat="Server">
<div style="text-align:center; margin-top:0px;">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:AdRotator ID="AdRotator1" runat="server" height="300px" width="1000px"
AdvertisementFile="advertise.xml"/>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
</Triggers>
</asp:UpdatePanel>
<asp:Timer ID="Timer1" runat="server" Interval="2000">
</asp:Timer>
</div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<center style="font-style:italic; font-size:xx-large"><b><i><u>Acceptor
Registration</u></i></b></center><br />
<center><table bgcolor="#CCCCFF" border="5">
<tr>
<td><asp:Label ID="Label1" runat="server" Text="Name"></asp:Label></td>
<td><asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="TextBox1" ErrorMessage="*"
ForeColor="Red"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td><asp:Label ID="Label2" runat="server" Text="Gender"></asp:Label></td>
<td>
<asp:RadioButton ID="RadioButton1" runat="server" Text="Male"
/>
<asp:RadioButton ID="RadioButton2" runat="server" Text="Female" />
</td>
</tr>
<tr>
<td>D.O.B</td>
<td>
<asp:TextBox ID="TextBox9" runat="server"></asp:TextBox>
74 | P a g e
</tr>
<tr>
<td>Confirm Password</td>
<td>
<asp:TextBox ID="TextBox6" runat="server"
TextMode="Password"></asp:TextBox>
<asp:CompareValidator ID="CompareValidator1" runat="server"
ControlToCompare="TextBox5" ControlToValidate="TextBox6"
ErrorMessage="Password doesn't match "></asp:CompareValidator>
</td>
</tr>
<tr>
<td>Upload Photo</td>
<td>
<asp:FileUpload ID="FileUpload1" runat="server" />
</td></tr>
<tr>
<td>
</td>
<td>
<asp:Button ID="Button1" runat="server" Text="Submit" style="marginbottom: 0px" onclick="Button1_Click" />
<asp:Button ID="Button2"
runat="server" Text="Cancel" onclick="Button2_Click"
/>
</td>
<td><asp:Label ID="Label3" runat="server"></asp:Label></td>
</tr>
</table></center>
</asp:Content>
Acceptorreg.aspx.cs
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;
using System.Configuration;
public partial class Acceptor : System.Web.UI.Page
{
SqlConnection cn = new
SqlConnection(ConfigurationManager.ConnectionStrings["conn"].ConnectionString);
protected void Page_Load(object sender, EventArgs e)
76 | P a g e
{
if (!Page.IsPostBack)
{
Calendar1.Visible = false;
LoadGrid();
}
}
void LoadGrid()
{
SqlDataAdapter da = new SqlDataAdapter("select * from acceptoreg", cn);
DataTable dt = new DataTable();
da.Fill(dt);
}
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
Calendar1.Visible = true;
}
protected void Calendar1_SelectionChanged(object sender, EventArgs e)
{
TextBox9.Text = Calendar1.SelectedDate.ToShortDateString();
Calendar1.Visible = false;
}
protected void Button2_Click(object sender, EventArgs e)
{
TextBox1.Text = String.Empty;
RadioButton1.Checked = false;
RadioButton2.Checked = false;
TextBox9.Text = String.Empty;
TextBox3.Text = String.Empty;
TextBox4.Text = String.Empty;
TextBox2.Text = String.Empty;
TextBox5.Text = String.Empty;
TextBox6.Text = String.Empty;
RequiredFieldValidator1.Visible = false;
RequiredFieldValidator2.Visible = false;
RequiredFieldValidator5.Visible = false;
Label3.Text = String.Empty;
}
protected void Button1_Click(object sender, EventArgs e)
{
try
{
SqlCommand cmd = new SqlCommand("insert into acceptoreg
values(@a,@b,@c,@d,@e,@f,@g,@h)", cn);
cn.Open();
cmd.Parameters.AddWithValue("@a", TextBox1.Text);
if (RadioButton1.Checked)
{
cmd.Parameters.AddWithValue("@b", RadioButton1.Text);
}
77 | P a g e
else
{
cmd.Parameters.AddWithValue("@b", RadioButton2.Text);
}
cmd.Parameters.AddWithValue("@c", TextBox9.Text);
cmd.Parameters.AddWithValue("@d", TextBox3.Text);
cmd.Parameters.AddWithValue("@e", TextBox4.Text);
cmd.Parameters.AddWithValue("@f", TextBox2.Text);
cmd.Parameters.AddWithValue("@g", TextBox5.Text);
string path = FileUpload1.PostedFile.FileName;
FileUpload1.SaveAs(MapPath("~/images/" + path));
cmd.Parameters.AddWithValue("@h", "~/images/" + path);
cmd.ExecuteNonQuery();
Label3.Text = "Data Saved";
cn.Close();
catch (Exception ex)
{
Label3.Text = ex.Message;
}
}
}
78 | P a g e
Modules Snapshot
Home
79 | P a g e
80 | P a g e
81 | P a g e
Tips on donating
82 | P a g e
Blood Fact
83 | P a g e
AboutUs Page
84 | P a g e
ContactUs Page
85 | P a g e
Donor Registration
86 | P a g e
Acceptor Registration
87 | P a g e
Donor Page
88 | P a g e
Acceptor Page
89 | P a g e
Admin Page
90 | P a g e
91 | P a g e
92 | P a g e
Database
Donor Registration(donoreg)
93 | P a g e
Acceptor Registration(acceptoreg)
94 | P a g e
Blood Request(bloodreq)
95 | P a g e
Conclusion
An efficient blood bank management system for a Blood Bank should be developed,
with the aim of ensuring that every patient has access to an adequate quantity of safe
blood. The management system should solve the issue of demand and wastage; and
lead to self sufficiency in blood requirement. The centralized system allocates a
unique ID for each donor and it is possible to trace the status of all donors for a
particular region where the system is implemented. It should also be replicable in
other Blood Banks.
96 | P a g e
Future Scope
Suppose in the future activities or the method associated with the Blood Donation
System. System is changed or they want some more activities to be automated, then is
such cases this project can be easily to handle and anyone can operate it. It will not
only reduce the cost of maintenance of records but it will be also improve the
efficiency of work.
97 | P a g e
Reference
BOOKS:
ONLINE REFERENCE:
www.wordpress.com
www.google.com
www.tutorialspoint.com
98 | P a g e
99 | P a g e