You are on page 1of 50

WEB BASED BLOOD BANK MANAGEMENT SYSTEM

Abstract

The project titled “Blood Bank Management System” is mainly used for maintaining the
stock record of the blood. In today’s system first it is manual system and also it when person
requires the particular type of blood and if that type is not available in that blood bank then it is
time consuming to arrange the blood from other blood bank it may affect the patient health
because time is very important in accidental cases. So in web based blood donation system is
best for checking whether particular type of blood is available in stack or not and also it gives the
location weather that available. Additionally this application contains any person who is
interested in donating the blood can register him in the same way if any organization wants to
register itself with this site that can also register. Admin is the main authority who can do
addition, deletion, and modification if required. In this system the user can easily find the
available blood group and the donor’s history. The admin can maintain the donor’s details like
blood group, location, last donated date, etc.

1
1. INTRODUCTION

Web based Blood Bank system can be used for computerizing process
of storing the information about the donors. This is the technology to provide online availability
of the Blood Bank system. This technology and the methods used to provide an efficient service
to the patient to get the particular blood group immediately. It helps to overcome all the
problems, by integrating the system that is store the donor’s details, blood bank details and
update the status frequently. It also developed programs to display information of blood bank
details to the admin. The main objective of this process is to find the donor according to the
location which is nearer by the blood bank. In this system the user can easily find the available
blood group and the donor’s history. The admin can maintain the donor’s details like blood
group, location, last donated date, etc. The main purpose of this system is the admin easily
retrieve the donor’s information based on the patient current location and the admin
communicate the donor. The advantage of the process is if the donor currently not available the
admin easily search and refer the possible reached blood bank for donating blood.
Blood donation system maintains the database of stock in centralized server
system. All the blood bank update the regular stock on web server and when someone require
any type of blood that person can easily check whether the blood is available and also cost. It
will helpful for maintaining the database as well as cost so that no one will get more cost for the
blood bag. Each hospital maintains the record of patient and record of blood bank so it is easily
available. The main objective of this process is to find the blood bank according to the location
which is nearer by the place. In this system the user can easily find the available blood group and
the blood bank details and donor’s details. The admin can maintain the blood bank details like
blood group, location, last donated date, etc. The main benefit of the web based system is to
maintain the record and simplicity for the person for checking the availability of blood. Manual
process is very time consuming process so by using web based system we can improve the
clarity as well as simplicity of the work.

2
2. System Analysis

2.1 EXISTING SYSTEM

In previous system first it is manual system and also it when person requires the
particular type of blood and if that type of blood is not available in that blood bank. Then time
consuming to arrange the blood from other blood bank. So the patient was affected the health
because time is very important in accidental cases. In additionally store the information of the
donor and updating the details. These details are all stored in special records. The existing
system is the manual system in which the user first visits the hospital and checks for availability
of the particular blood group. In this existing process if blood is required for a patient, the blood
bank will check whether blood is available to them if not they search for donor in files. This
process is time consuming and requires more amount of time. The blood bank is not able to
immediately contact with the donor because of the manual work of the reports. The main
drawback of the existing system is not comfortable to comparing the details as well as getting the
performance report in frequently.

DISADVANTAGE:

 The system consumes more manpower to store the details.


 It is not providing the proper information about the donor and blood bank
information.
 This is not a user friendly process.
 The maintenance of the details is difficult process.
 There is possible to making mistakes in the man handling information.
 Manual process is very time consuming process
 The patient health was heavily affected.

3
2.2 PROPOSED SYSTEM
The proposed system will carry out the defects in the previous systems. The
main disappointments of previous systems are over come in this project. The performance are
faster and easy accessible to the blood bank detail when required blood. The proposed system
is a web based application and maintains a centralized repository of all related information.
There is possible to view the details of the donor which is based on the patient location. This
proposed system has the mechanism to the user will get the details like available blood, send
request. The system maintains the database of stock in centralized server system. All the
blood bank update the regular stock on web server and when someone require any type of
blood that person can easily check whether the blood is available and also cost. It will helpful
for maintaining the database as well as cost so that no one will get more cost for the blood
bag. Each hospital maintains the record of patient and record of blood bank so it is easily
available. The main benefit of the web based system is to maintain the record and simplicity
for the person for checking the availability of blood.

ADVANTAGES:

 The system will maintain the record and easily available the resource.
 Reduce the paper work and checking availability and keeping online record of
stock and money required for blood.
 It reduces the time.
 This process is efficient to the blood bank and the user.
 It is easy to handle and feasible to the administration.
 This system reduces the time consuming to store the details and reduce the
manpower.
 This system uses to the user can easily find the required blood group detail and
getting information about the blood bank.
 Managing the blood bank details is easy and effective without any lose of
information.
 There is possible for cost reduction and space reduction to the blood bank.
4
3. PROJECT DESCRIPTION

3.1 PROGRAM DESIGN

Program design is the activity of progressing from a specification of some required


program to a description of the program itself. Most phase models of the software life cycle
recognize program design as one of the phases. The input to this phase is a specification of what
the program is required to do. During the phase the design decisions are made as to how the
program will meet these requirements, and the output of the phase is a description of the
program in some form that provides a suitable basis for subsequent implementation.

MODULES:

A module is a separate unit of software or hardware. Typical characteristics of modular


components include portability, which allows them to be used in a variety of systems, and
interoperability, which allows them to function with the components of other systems. The term
was first used in architecture.

There are two main modules such as,

 Admin module
 Login
 Update blood bank details
 Donors details

 User module

 Register
 Login
 View blood bank details

5
Admin Module

 Login

In this module, the authenticate person only for login the system using user name and
password. The admin can perform following operation such as blood details, donars details and
blood bank details. These details are stored in the database.

 Update blood bank details

In this module, admin can add blood bank details in the system. The details such
as blood group name, hospital name, place and update available blood bank details are stored in
the database. The system can automatically display on available and unavailable blood bank
details. The Blood details maintain all details about blood donors, all blood groups and number
packages available for specified blood group.

 Donors details

Admin can update donor’s details in system. The donor’s details such as donor name,
place, blood group name and hospital name. The details are stored in the system. And the user
can easily search the particular person by selecting the respective blood group.

User Module
 Register Page:
The registration page is useful for the new user to register themselves by
giving their valid details such as e-mail id, user name, Phone number, etc. The user has to
fill all the details else message is displayed to the user. Once all the fields are filled the
user clicks the Register button, which submits the data to the database. Here it checks the
user table, whether the email-id is already exists, if yes error message is displayed else
store the details to the user table. If all details are correct the users view the main page.

6
 Login Page
The login page is used for logging in the site to buy the products for existing
user. To buy product the user must first login to the site. After filling all the fields the user
can click the 'Submit' button to sign in. It checks the user table as, whether the username
and password already exist, if yes allows the user to add the product to the cart else
displays the error message. Also the user should fill all the fields, if not it shows error
message. If all details are correct the user views the main page.

 View blood bank details

User can login system and view various blood bank details in the website. User can
search respective blood group of the nearest place in the system and collect respective blood
group in the hospital. And the user can access from any place to know about the blood details
and collect the blood from the particular area.

7
4. SYSTEM REQUIREMENTS

4.1 Hardware Specification

• CPU type                   :    Intel Pentium 4

• Clock speed               :    3.0 GHz

• Ram size                    :    512 MB

• Hard disk capacity     :    40 GB

• Monitor type              :    15 Inch color monitor

• Keyboard type           :     internet keyboard

4.2 Software Specification

• Operating System :  Windows XP, Windows 7

• Language          :  Asp.net with C#

• IDE : Microsoft Visual Studio 2010

• Back End : SQL Server 2008

4.3 SOFTWARE DESCRIPTION

4.3.1 FRONT END

.NET

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

Microsoft started development of .NET Framework in the late 1990s, originally under the
name of Next Generation Windows Services (NGWS). By late 2000, the first beta versions
of .NET 1.0 were released.

Version 3.0 of .NET Framework is included with Windows Server 2008 and Windows


Vista. Version 3.5 is included with Windows 7 and Windows Server 2008 R2, and can also be
installed on Windows XP and Windows Server 2003.[2] On 12 April 2010, .NET Framework 4
was released alongside Visual Studio 2010.

.NET Framework family also includes two versions for mobile or embedded device use.


A reduced version of the framework,.NET Compact Framework, is available on Windows
CE platforms, including Windows Mobile devices such as smart phones. Additionally, .NET
Micro Framework is targeted at severely resource-constrained devices.

Interoperability
Because computer systems commonly require interaction between newer and older
applications, .NET Framework provides means to access functionality implemented in newer and
older programs that execute outside .NET environment. Access to COM components is provided
inSystem.Runtime.InteropServices and System.EnterpriseServices namespace framework; access
to other functionality is achieved using the P/Invoke feature.

9
Common Language Runtime engine
Common Language Runtime (CLR) serves as the execution engine of .NET
Framework. All .NET programs execute under the supervision of CLR, guaranteeing certain
properties and behaviors in the areas of memory management, security, and exception handling.

Language independence
.NET Framework introduces 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 Framework supports the exchange of types and object instances
between libraries and applications written using any conforming .NET language.

Framework Class Library


Framework Class Library (FCL) is a library of functionality available to all languages
using .NET Framework. FCL provides classes that encapsulate a number of common functions,
including file reading and writing, graphic rendering, database interaction, XML document
manipulation, and so on. It consists of classes, interfaces of reusable types that integrate CLR.
Simplified deployment
.NET Framework includes design features and tools which help manage
the installation of computer software to ensure that it does not interfere with previously installed
software, and that it conforms to security requirements.
Security
The design addresses some of the vulnerabilities, such as buffer overflows, which have
been exploited by malicious software. Additionally, .NET provides a common security model for
all applications.
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 (see Silver light and §
Alternative implementations). Microsoft submitted the specifications for CLI (which includes the
10
core class libraries, CTS, and the Common Intermediate Language), C#, and C++/CLI to
both ECMA and ISO, making them available as official standards. 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.

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

Security

.NET has its own security mechanism with two general features: Code Access Security (CAS),
and validation and verification. CAS is based on evidence that is associated with a specific
assembly. Typically the evidence is the source of the assembly. CAS uses evidence to determine
the permissions granted to the code. Other code can demand that calling code is granted a
specified permission. The demand causes CLR to perform a call stack walk: every assembly of
each method in the call stack is checked for the required permission; if any assembly is not
granted the permission a security exception is thrown.

11
Class library

Namespaces in the FCL

System

System.Diagnostics

System.Globalization

System.Resources

System.Text

System.Runtime.Serialization

System.Data

.NET Framework includes a set of standard class libraries. The class library is organized in a
hierarchy of namespaces. These class libraries implement a large number of common functions,
such as file reading and writing, graphic rendering, database interaction, and XML document
manipulation, among others. .NET class libraries are available to all CLI compliant
languages. .NET Framework class library is divided into two parts: FCL and Base Class
Library (BCL).

FCL includes a small subset of the entire class library and is the core set of classes that serve as
the basic API of CLR.. FCL classes are available in .NET Framework as well as its alternative
implementations including .NET Compact Framework, Microsoft Silver light and Mono.

BCL is a superset of FCL and refers to the entire class library that ship with .NET Framework. It
includes an expanded set of libraries, including Windows Forms, ADO.NET,  ASP.NET, 
Language Integrated Query, Windows Presentation Foundation, Windows Communication
Foundation among others. BCL is much larger in scope than standard libraries for languages
like C++, and comparable in scope to standard libraries of Java.

Memory management

CLR frees the developer from the burden of managing memory it handles memory management
itself by detecting when memory can be safely freed. Instantiations of .NET types (objects) are
allocated from the managed heap; a pool of memory managed by CLR. As long as there exists a

12
reference to an object, which might be either a direct reference to an object or via a graph of
objects, the object is considered to be in use.

Some alternative implementations of parts of the framework are listed here.

 .NET Micro Framework is a .NET platform for extremely resource-constrained


devices. It includes a small version of CLR and supports development in C# (though some
developers were able to use VB.NET,[23] albeit with an amount of hacking, and with limited
functionalities) and debugging (in an emulator or on hardware GUI framework loosely based
on Windows Presentation Foundation, and additional libraries specific to embedded
applications.
 Mono is an implementation of CLI and FCL, and provides additional
functionality. It also includes C# and VB.NET compilers.
 Portable.NET (part of Dot GNU) provides an implementation of CLI, portions of
FCL, and a C# compiler. It supports a variety of CPUs and operating systems.
 Microsoft Shared Source Common Language Infrastructure is a non-
free implementation of CLR. However, the last version only runs on Microsoft Windows XP
SP2, and was not updated since 2006, therefore it does not contain all features of version 2.0
of .NET Framework.
 Cross Net is an implementation of CLI and portions of FCL. It is free software
using the open source MIT License.
SQL SERVER

Microsoft SQL Server is a relational database management system developed by Microsoft. As a


database, it is a software product whose primary function is to store and retrieve data as
requested by other software applications, be it those on the same computer or those running on
another computer across a network (including the Internet). There are at least a dozen different
editions of Microsoft SQL Server aimed at different audiences and for workloads ranging from
small single-machine applications to large Internet-facing applications with many concurrent
users. Its primary query languages are T-SQL and ANSI SQL.

Genesis

13
Prior to version 7.0 the code base for MS SQL Server was sold by Sybase SQL Server to
Microsoft, and was Microsoft's entry to the enterprise-level database market, competing
against Oracle, IBM, and, later, Sybase. Microsoft, Sybase and Ashton-Tate originally worked
together to create and market the first version named SQL Server 1.0 for OS/2 (about 1989)
which was essentially the same as Sybase SQL Server 3.0 on Unix, VMS, etc. Microsoft SQL
Server 4.2 was shipped around 1992 (available bundled with IBM OS/2 version 1.3). Later
Microsoft SQL Server 4.21 for Windows NT was released at the same time as Windows NT 3.1.
Microsoft SQL Server v6.0 was the first version designed for NT, and did not include any
direction from Sybase.

About the time Windows NT was released in July 1993, Sybase and Microsoft parted ways and
each pursued its own design and marketing schemes. Microsoft negotiated exclusive rights to all
versions of SQL Server written for Microsoft operating systems. Until 1994, Microsoft's SQL
Server carried three Sybase copyright notices as an indication of its origin.

SQL Server 7.0 and SQL Server 2000 included modifications and extensions to the Sybase code
base, adding support for the IA-64 architecture. By SQL Server 2005 the legacy Sybase code had
been completely rewritten.

Since the release of SQL Server 2000, advances have been made in performance, the client IDE
tools, and several complementary systems that are packaged with SQL Server 2005.

These include:

 an extract-transform-load (ETL) tool (SQL Server Integration Services or SSIS)


 a Reporting Server
 an OLAP and data mining server (Analysis Services)
 several messaging technologies, specifically Service Broker and Notification
Services

SQL Server 2005

SQL Server 2005 (formerly codenamed "Yukon") released in October 2005. It included native
support for managing XML data, in addition to relational data. For this purpose, it defined
14
an xml data type that could be used either as a data type in database columns or as literals in
queries. XML columns can be associated with XSD schemas; XML data being stored is verified
against the schema. XML is converted to an internal binary data type before being stored in the
database. Specialized indexing methods were made available for XML data. XML data is
queried using XQuery; SQL Server 2005 added some extensions to the T-SQL language to allow
embedding XQuery queries in T-SQL. In addition, it also defines a new extension to XQuery,
called XML DML that allows query-based modifications to XML data. SQL Server 2005 also
allows a database server to be exposed over web services using Tabular Data Stream (TDS)
packets encapsulated within SOAP (protocol) requests. When the data is accessed over web
services, results are returned as XML.

Common Language Runtime (CLR) integration was introduced with this version, enabling one to
write SQL code as Managed Code by the CLR. For relational data, T-SQL has been augmented
with error handling features (try/catch) and support for recursive queries with CTEs (Common
Table Expressions). Permissions and access control have been made more granular and the query
processor handles concurrent execution of queries in a more efficient way. Partitions on tables
and indexes are supported natively, so scaling out a database onto a cluster is easier. SQL CLR
was introduced with SQL Server 2005 to let it integrate with the .NET Framework.

SQL Server 2005 introduced Multi-Version Concurrency Control. User facing features include
new transaction isolation level called SNAPSHOT and a variation of the READ COMMITTED
isolation level based on statement-level data snapshots.

SQL Server 2005 introduced "MARS" (Multiple Active Results Sets), a method of allowing
usage of database connections for multiple purposes.

SQL Server 2005 introduced DMVs (Dynamic Management Views), which are specialized
views and functions that return server state information that can be used to monitor the health of
a server instance, diagnose problems, and tune performance.

Service Pack 1 (SP1) of SQL Server 2005 introduced Database Mirroring, a high availability
option that provides redundancy and failover capabilities at the database level. Failover can be
performed manually or can be configured for automatic failover. Automatic failover requires a
witness partner and an operating mode of synchronous.
15
SQL Server 2008

SQL Server 2008 (formerly codenamed "Katmai")  was released on August 6, 2008 and aims to
make data management self-tuning, self organizing, and self maintaining with the development
of SQL Server Always On technologies, to provide near-zero downtime. SQL Server 2008 also
includes support for structured and semi-structured data, including digital media formats for
pictures, audio, video and other multimedia data. In current versions, such multimedia data can
be stored as BLOBs (binary large objects), but they are generic bit streams. Intrinsic awareness
of multimedia data will allow specialized functions to be performed on them. According to Paul
Flasher, senior Vice President, Server Applications, Microsoft Corp., SQL Server 2008 can be a
data storage backend for different varieties of data: XML, email, time/calendar, file, document,
spatial, etc as well as perform search, query, analysis, sharing, and synchronization across all
data types.

Other new data types include specialized date and time types and a Spatial data type for location-
dependent data. Better support for unstructured and semi-structured data is provided using the
new FILESTREAM data type, which can be used to reference any file stored on the file
system. Structured data and metadata about the file is stored in SQL Server database, whereas
the unstructured component is stored in the file system. Such files can be accessed both
viaWin32 file handling APIs as well as via SQL Server using T-SQL; doing the latter accesses
the file data as a BLOB. Backing up and restoring the database backs up or restores the
referenced files as well. SQL Server 2008 also natively supports hierarchical data, and
includes T-SQL constructs to directly deal with them, without using recursive queries.

The Full-text search functionality has been integrated with the database engine. According to a
Microsoft technical article, this simplifies management and improves performance.

Spatial data will be stored in two types. A "Flat Earth" (GEOMETRY or planar) data type
represents geospatial data which has been projected from its native, spherical, coordinate system
into a plane. A "Round Earth" data type (GEOGRAPHY) uses an ellipsoidal model in which the
Earth is defined as a single continuous entity which does not suffer from the singularities such as
16
the international dateline, poles, or map projection zone "edges". Approximately 70 methods are
available to represent spatial operations for the Open Geospatial Consortium Simple Features for
SQL, Version 1.1.

SQL Server includes better compression features, which also helps in improving scalability. It
enhanced the indexing algorithms and introduced the notion of filtered indexes. It also
includes Resource Governor that allows reserving resources for certain users or workflows. It
also includes capabilities for transparent encryption of data (TDE) as well as compression of
backups. SQL Server 2008 supports the ADO.NET Entity Framework and the reporting tools,
replication, and data definition will be built around the Entity Data Model. SQL Server
Reporting Services will gain charting capabilities from the integration of the data visualization
products from Dudes Data Visualization, Inc., which was acquired by Microsoft. On the
management side, SQL Server 2008 includes the Declarative Management Framework which
allows configuring policies and constraints, on the entire database or certain tables,
declaratively. The version of SQL Server Management Studio included with SQL Server 2008
supports IntelliSense for SQL queries against a SQL Server 2008 Database Engine. SQL Server
2008 also makes the databases available via Windows Power Shell providers and management
functionality available as Cmd lets, so that the server and all the running instances can be
managed from Windows Power Shell.

SQL Server 2008 R2

SQL Server 2008 R2 (10.50.1600.1, formerly codenamed "Kilimanjaro") was announced at Tech
Ed 2009, and was released to manufacturing on April 21, 2010. SQL Server 2008 R2 adds
certain features to SQL Server 2008 including a master data management system branded
as Master Data Services, a central management of master data entities and hierarchies. Also
Multi Server Management, a centralized console to manage multiple SQL Server 2008 instances
and services including relational databases, Reporting Services, Analysis Services & Integration
Services.SQL Server2008 R2 includes a number of new
services, including PowerPivot for Excel and SharePoint, Master Data Services, Stream

17
Insight, Report Builder3.0,  Reporting Services Add-in for SharePoint, a Data-tier function in
Visual Studio that enables packaging of tiered databases as part of an application, and a SQL
Server Utility named UC (Utility Control Point), part of AMSM (Application and Multi-Server
Management) that is used to manage multiple SQL Servers.

The first SQL Server 2008 R2 service pack (10.50.2500, Service Pack 1) was released on July
11, 2011.

The second SQL Server 2008 R2 service pack (10.50.4000, Service Pack 2) was released on July
26, 2012.

SQL Server 2014

SQL Server 2014 was released to manufacturing on March 18, 2014, and released to the general
public on April 1, 2014. Until November, 2013 there were two CTP revisions, CTP1 and CTP2.
 SQL Server 2014 provides a new in-memory capability for tables that can fit entirely in
[40]

memory (also known as Hekaton). Whilst small tables may be entirely resident in memory in all
versions of SQL Server, they also may reside on disk, so work is involved in reserving RAM,
writing evicted pages to disk, loading new pages from disk, locking the pages in RAM while
they are being operated on, and many other tasks. By treating a table as guaranteed to be entirely
resident in memory much of the 'plumbing' of disk-based databases can be avoided.[41]

For disk-based SQL Server applications, it also provides the SSD Buffer Pool Extension, which
can improve performance by using SSDs as a cache between DRAM and spinning media.

SQL Server 2014 also enhances the AlwaysOn (HADR) solution by increasing the readable
secondaries count and sustaining read operations upon secondary-primary disconnections, and it
provides new hybrid disaster recovery and backup solutions with Windows Azure, enabling
customers to use existing skills with the on-premises version of SQL Server to take advantage of
Microsoft's global datacenters. In addition, it takes advantage of new Windows Server 2012 and
Windows Server 2012 R2 capabilities for database application scalability in a physical or virtual
environment.

18
Datacenter
SQL Server 2008 R2 Datacenter is the full-featured edition of SQL Server and is designed for
datacenters that need the high levels of application support and scalability. It supports 256
logical processors and virtually unlimited memory. Comes with Stream Insight Premium
edition. The Datacenter edition has been retired in SQL Server 2012, all its features are available
in SQL Server 2012 Enterprise Edition.

Enterprise
SQL Server Enterprise Edition includes both the core database engine and add-on services, with
a range of tools for creating and managing a SQL Server cluster. It can manage databases as
large as 524 petabytes and address 2 terabytes of memory and supports 8 physical processors.
SQL Server 2012 Enterprise Edition supports 160 physical processors 
Standard
SQL Server Standard edition includes the core database engine, along with the stand-alone
services. It differs from Enterprise edition in that it supports fewer active instances (number of
nodes in a cluster) and does not include some high-availability functions such as hot-add
memory (allowing memory to be added while the server is still running), and parallel indexes.
Web
SQL Server Web Edition is a low-TCO option for Web hosting.

Business Intelligence
Introduced in SQL Server 2012 and focusing on Self Service and Corporate Business
Intelligence. It includes the Standard Edition capabilities and Business Intelligence tools:
PowerPivot, Power View, the BI Semantic Model, Master Data Services, Data Quality Services
and xVelocity in-memory analytics.

Workgroup
SQL Server Workgroup Edition includes the core database functionality but does not include the
additional services. Note that this edition has been retired in SQL Server 2012.
19
Developer
SQL Server Developer Edition includes the same features as SQL Server 2012 Enterprise
Edition, but is limited by the license to be only used as a development and test system, and not as
production server. This edition is available to download by students free of charge as a part
of Microsoft's DreamSpark program.
Embedded (SSEE)
SQL Server 2005 Embedded Edition is a specially configured named instance of the SQL Server
Express database engine which can be accessed only by certain Windows Services.
Evaluation
SQL Server Evaluation Edition, also known as the Trial Edition, has all the features of the
Enterprise Edition, but is limited to 180 days, after which the tools will continue to run, but the
server services will stop.
Fast Track
SQL Server Fast Track is specifically for enterprise-scale data warehousing storage and business
intelligence processing, and runs on reference-architecture hardware that is optimized for Fast
Track.

LocalDB
Introduced in SQL Server Express 2012, LocalDB is a minimal, on-demand, version of SQL
Server that is designed for application developers. It can also be used as an embedded database.

SQL Server also allows stored procedures to be defined. Stored procedures are parameterized T-
SQL queries, that are stored in the server itself (and not issued by the client application as is the
case with general queries). Stored procedures can accept values sent by the client as input
parameters, and send back results as output parameters. They can call defined functions, and
other stored procedures, including the same stored procedure (up to a set number of times). They
can be selectively. Unlike other queries, stored procedures have an associated name, which is
used at runtime to resolve into the actual queries. Also because the code need not be sent from

20
the client every time (as it can be accessed by name), it reduces network traffic and somewhat
improves performance. Execution plans for stored procedures are also cached as necessary.

SQL CLR
Main article: SQL CLR

Microsoft SQL Server 2005 includes a component named SQL CLR ("Common


Language Runtime") via which it integrates with .NET Framework. Unlike most other
applications that use .NET Framework, SQL Server itself hosts the .NET Framework runtime,
i.e., memory; threading and resource management requirements of .NET Framework are satisfied
by SQLOS itself, rather than the underlying Windows operating system. SQLOS provides
deadlock detection and resolution services for .NET code as well. With SQL CLR, stored
procedures and triggers can be written in any managed .NET language,
including C# and VB.NET. Managed code can also be used to define UDT's (user defined types),
which can persist in the database. Managed code is compiled to CLI assemblies and after being
verified for type safety, registered at the database. After that, they can be invoked like any other
procedure.[61] However, only a subset of the Base Class Library is available, when running code
under SQL CLR. Most APIs relating to user interface functionality are not available.

When writing code for SQL CLR, data stored in SQL Server databases can be accessed
using the ADO.NET APIs like any other managed application that accesses SQL Server data.
However, doing that creates a new database session, different from the one in which the code is
executing. To avoid this, SQL Server provides some enhancements to the ADO.NET provider
that allows the connection to be redirected to the same session which already hosts the running
code. SQL Server also provides several other enhancements to the ADO.NET API, including
classes to work with tabular data or a single row of data as well as classes to work with internal
metadata about the data stored in the database. It also provides access to the XML features in
SQL Server, including XQuery support. These enhancements are also available in T-SQL
Procedures in consequence of the introduction of the new XML Datatype (query, value, nodes
functions).

Services

21
SQL Server also includes an assortment of add-on services. While these are not essential
for the operation of the database system, they provide value added services on top of the core
database management system. These services either run as a part of some SQL Server
component or out-of-process as Windows Service and presents their own API to control and
interact with them.

Service Broker

Used inside an instance, programming environment. For cross instance applications,


Service Broker communicates over TCP/IP and allows the different components to be
synchronized together, via exchange of messages. The Service Broker, which runs as a part of
the database engine, provides a reliable messaging and message queuing platform for SQL
Server applications.

Replication Services

SQL Server Replication Services are used by SQL Server to replicate and synchronize
database objects, either in entirety or a subset of the objects present, across replication agents,
which might be other database servers across the network, or database caches on the client side.
Replication follows a publisher/subscriber model, i.e., the changes are sent out by one database
server ("publisher") and are received by others ("subscribers"). SQL Server supports three
different types of replication:

Transaction replication
transaction made to the publisher database (master database) is synced out to subscribers, who
update their databases with the transaction. Transactional replication synchronizes databases in
near real time.

Merge replication
Changes made at both the publisher and subscriber databases are tracked, and periodically the
changes are synchronized bi-directionally between the publisher and the subscribers. If the same
data has been modified differently in both the publisher and the subscriber databases,
synchronization will result in a conflict which has to be resolved - either manually or by using

22
pre-defined policies. Row guide needs to be configured on a column if merge replication is
configured.

5. SYSTEM DESIGN
5.1 DATA FLOW DIAGRAM

LEVEL 0

The Level 0 DFD shows how the system is divided into 'sub-systems' (processes), each of
which deals with one or more of the data flows to or from an external agent, and which together
provide all of the functionality of the system as a whole. It also identifies internal data stores that
must be present in order for the system to do its job, and shows the flow of data between the
various parts of the system.

DFD LEVEL-0

View and Update Details Perform the blood bank function


Blood Bank System

Admin User

Confirmation Confirmation

Database

23
Figure 1.1 Data Flow Diagram Level 0

DFD LEVEL-1

The next stage is to create the Level 1 Data Flow Diagram. This highlights the main
functions carried out by the system. As a rule, to describe the system was using between two and
seven functions - two being a simple system and seven being a complicated system. This enables
us to keep the model manageable on screen or paper.

Provide username& password

Admin Update blood bank details


Database

Donor’s details

Figure 1.2 Data Flow Diagram Level 1

24
DFD LEVEL-2

A Data Flow Diagram (DFD) tracks processes and their data paths within the business or
system boundary under investigation. A DFD defines each domain boundary and illustrates the
logical movement and transformation of data within the defined boundary. The diagram shows
'what' input data enters the domain, 'what' logical processes the domain applies to that data, and
'what' output data leaves the domain. Essentially, a DFD is a tool for process modeling and one
of the oldest

Provide username& password


User

Search blood group View blood bank Donor details

Database

Figure 1.3 Data Flow Diagram Level 2


25
5.2 ARCHITECTURAL DIAGRAM

A system architecture or systems architecture is the conceptual model that defines the
structure, behavior, and more views of a system. An architecture description is a formal
description and representation of a system, organized in a way that supports reasoning about the
structures and behaviors of the system. System architecture can comprise system components,
the externally visible properties of those components, the relationships (e.g. the behavior)
between them. It can provide a plan from which products can be procured, and systems
developed, that will work together to implement the overall system. There have been efforts to
formalize languages to describe system architecture; collectively these are called architecture
description languages (ADLs).

Various organizations define systems architecture in different ways, including:

 An allocated arrangement of physical elements which provides the design solution for a
consumer product or life-cycle process intended to satisfy the requirements of the
functional architecture and the requirements baseline.
 Architecture comprises the most important, pervasive, top-level, strategic inventions,
decisions, and their associated rationales about the overall structure (i.e., essential
elements and their relationships) and associated characteristics and behavior.
 If documented, it may include information such as a detailed inventory of current
hardware, software and networking capabilities; a description of long-range plans and
priorities for future purchases, and a plan for upgrading and/or replacing dated equipment
and software
 The composite of the design architectures for products and their life-cycle processes.

26
Blood Bank System

Admin User

Login Registration

Update Blood Bank details


Login

Search blood group

Add donor’s details


Database

View blood bank details

View user details

FIGURE 1.4 ARCHITECTURAL DIAGRAMS

27
5.3 DATABASE DESIGN

5.3.1 Table: Blood details

Field Type Key

Blood bank Nvarchar(50) Checked


name

Iso code Nvarchar(50) Checked

Land line no Nvarchar(50) Checked

Mobileno Nvarchar(50) Checked

Address Nvarchar(50) Checked

Location Nvarchar(50) Checked

Blood group Nvarchar(50) Checked

Unit Nvarchar(50) Checked

28
5.3.2 Table: Donor registration

Field Type key


Donor name Nvarchar(50) Checked
Father name Nvarchar(50) Checked
Gender Nvarchar(50) Checked
Age Nvarchar(50) Checked
Email Nvarchar(50) Checked
Mobile no Nvarchar(50) Checked
Address Nvarchar(50) Checked
Location Nvarchar(50) Checked
Blood group Nvarchar(50) Checked

5.3.3 Table: Registration

Field Type key


Name Nvarchar(50) Checked
Father name Nvarchar(50) Checked
Gender Nvarchar(50) Checked
Age Nvarchar(50) Checked
Email Nvarchar(50) Checked
Mobile no Nvarchar(50) Checked
Address Nvarchar(50) Checked
Location Nvarchar(50) Checked
Blood group Nvarchar(50) Checked
Username Nvarchar(50) Checked
Password Nvarchar(50) Checked

29
6. IMPLEMENTATION AND TESTING

6.1 System implementation

System testing is a critical aspect of Software Quality Assurance and represents the
ultimate review of specification, design and coding. Testing is a process of executing a program
with the intent of finding an error. A good test is one that has a probability of finding an as yet
undiscovered error. The purpose of testing is to identify and correct bugs in the developed
system. Nothing is complete without testing. Testing is the vital to the success of the system. In
the code testing the logic of the developed system is tested. For this every module of the program
is executed to find an error. To perform specification test, the examination of the specifications
stating what the program should do and how it should perform under various conditions.

6.2 Unit testing

Unit testing, also known as component testing refers to tests that verify the functionality
of a specific section of code, usually at the function level. In an object-oriented environment, this
is usually at the class level, and the minimal unit tests include the constructors and destructors.

These types of tests are usually written by developers as they work on code (white-box
style), to ensure that the specific function is working as expected. One function might have
multiple tests, to catch corner cases or other branches in the code. Unit testing alone cannot
verify the functionality of a piece of software, but rather is used to ensure that the building
blocks of the software work independently from each other.

Unit testing is a software development process that involves synchronized application of


a broad spectrum of defect prevention and detection strategies in order to reduce software
development risks, time, and costs. It is performed by the software developer or engineer during
the construction phase of the software development lifecycle. Rather than replace traditional QA
focuses, it augments it. Unit testing aims to eliminate construction errors before code is promoted
30
to QA; this strategy is intended to increase the quality of the resulting software as well as the
efficiency of the overall development and QA process.

6.3 Integration testing

Integration testing is any type of software testing that seeks to verify the interfaces
between components against a software design. Software components may be integrated in an
iterative way or all together ("big bang"). Normally the former is considered a better practice
since it allows interface issues to be located more quickly and fixed.

Integration testing works to expose defects in the interfaces and interaction between
integrated components (modules). Progressively larger groups of tested software components
corresponding to elements of the architectural design are integrated and tested until the software
works as a system.

6.4 System testing

System testing, or end-to-end testing, tests a completely integrated system to verify that it meets
its requirements. For example, a system test might involve testing a logon interface, then creating
and editing an entry, plus sending or printing results, followed by summary processing or
deletion (or archiving) of entries, then logoff.

In addition, the software testing should ensure that the program, as well as working as expected,
does not also destroy or partially corrupt its operating environment or cause other processes
within that environment to become inoperative (this includes not corrupting shared memory, not
consuming or locking up excessive resources and leaving any parallel processes unharmed by its
presence).

6.5 Software performance testing


Performance testing is generally executed to determine how a system or sub-system
performs in terms of responsiveness and stability under a particular workload. It can also serve
to investigate, measure, validate or verify other quality attributes of the system, such as
scalability, reliability and resource usage

31
7. CONCLUSION

The project title is “Web based Blood Bank Management System” is a web
based application. This system is easy to maintain the stock of the blood and also provide the
easy way for making available blood to anywhere. Person can easily check the availability so
that there is no shortage of blood and by checking whether it is available they can buy from that
blood bank and also it reduce the time . This Blood Bank system is serving as a useful approach
to maintain patient details and the donor’s in the Blood Bank. It will be a medium for the Blood
Bank for proper management of the blood bank details as well as the donor details in an effective
way. This project gave a clear understanding of the key drives that affect the demand for the
report system.

32
8. REFERENCE

Book Reference

Following books and eBooks are used to complete this project reports.

1.Advanced .NET Remoting 2nd Edition (Ingo Rammer and Mario Szpuszta, Apress, March
2005)

2. Advanced .NET Remoting in VB.NET (Ingo Rammer, Apress, July 2002)

3.ASP to ASP.NET Migration Handbook (Christian Nagel et al, Wrox, January 2003)

4. Beginning Visual C# (Christian Nagel et al, Wrox, September 2001)

5.Data-Centric .NET Programming (Christian Nagel et al, Wrox, December 2001)

6. Professional .NET Network Programming 2nd Edition (Christian Nagel et al, Wrox, September
2004)

33
9. APPENDIX

9.1 Sample Code

9.1.1 Login page


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Home : System.Web.UI.Page


{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button2_Click(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{

}
protected void Button2_Click1(object sender, EventArgs e)
{

if (TextBox1.Text == "admin" & TextBox2.Text == "admin")


{
34
Response.Redirect("AdminHome.aspx");
}
else
{
Response.Write("<script language=javascript>alert('Plz Give correct
Password!')</script>");

}
}
protected void Button1_Click1(object sender, EventArgs e)
{
TextBox1.Text = "";
TextBox2.Text = "";
}
}

9.1.2 User information details


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;

public partial class AdminHome : System.Web.UI.Page


{

35
SqlConnection con = new SqlConnection(@"Data Source=.\
SQLEXPRESS;AttachDbFilename=D:\sangeeth 2015 Project\Priya\Blood Bank\App_Data\
Blood.mdf;Integrated Security=True;User Instance=True");
SqlCommand cmd;

protected void Page_Load(object sender, EventArgs e)


{
cmd = new SqlCommand("select
Name,FatherName,Gender,Age,MobileNo,Email,Address,Bloodgroup,UserName from regtb",
con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();

}
}

9.1.3 Donor information page


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
public partial class DonorInfo : System.Web.UI.Page
{

36
SqlConnection con = new SqlConnection(@"Data Source=.\
SQLEXPRESS;AttachDbFilename=D:\sangeeth 2015 Project\Priya\Blood Bank\App_Data\
Blood.mdf;Integrated Security=True;User Instance=True");
SqlCommand cmd;

protected void Page_Load(object sender, EventArgs e)


{
cmd = new SqlCommand("select * from Donortb", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();
}
}

9.1.4 Blood bank registration page


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;

public partial class BloodBank : System.Web.UI.Page


{

37
SqlConnection con = new SqlConnection(@"Data Source=.\
SQLEXPRESS;AttachDbFilename=D:\sangeeth 2015 Project\Priya\Blood Bank\App_Data\
Blood.mdf;Integrated Security=True;User Instance=True");
SqlCommand cmd;

protected void Page_Load(object sender, EventArgs e)


{
con.Open();
cmd = new SqlCommand("select distinct BloodBankName from Bloodtb", con);
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
DropDownList2.Items.Add(dr["BloodBankName"].ToString());
}
con.Close();
}
protected void Button1_Click(object sender, EventArgs e)
{
cmd = new SqlCommand("insert into Bloodtb
Values(@BloodBankName,@IsoCode,@LandlineNo,@MobileNO,@Address,@Location,@Blo
odGroup,@Unit)", con);
cmd.Parameters.AddWithValue("@BloodBankName", TextBox1.Text);
cmd.Parameters.AddWithValue("@IsoCode", TextBox2.Text);
cmd.Parameters.AddWithValue("@LandlineNo", TextBox3.Text);
cmd.Parameters.AddWithValue("@MobileNo", TextBox4.Text);
cmd.Parameters.AddWithValue("@Address", TextBox5.Text);
cmd.Parameters.AddWithValue("@Location", TextBox6.Text);
cmd.Parameters.AddWithValue("@BloodGroup", TextBox8.Text);
cmd.Parameters.AddWithValue("@Unit", TextBox7.Text);
con.Open();

38
cmd.ExecuteNonQuery();
con.Close();
Response.Write("<script language=javascript>alert('Register Successfully!')</script>");
}
protected void Button2_Click(object sender, EventArgs e)
{
TextBox1.Text = "";
TextBox2.Text = "";
TextBox3.Text = "";
TextBox4.Text = "";
TextBox5.Text = "";
TextBox6.Text = "";
TextBox7.Text = "";
TextBox8.Text = "";
}
protected void Button5_Click(object sender, EventArgs e)
{
//con.Open();
//cmd = new SqlCommand("select * from Bloodtb where BloodBankName='" +
DropDownList2.Text + "' and BloodGroup='" + DropDownList1.Text + "'", con);
//SqlDataReader dr = cmd.ExecuteReader();
//if (dr.Read())
//{
// TextBox1.Text = dr["BloodBankName"].ToString();
// TextBox2.Text = dr["IsoCode"].ToString();
// TextBox3.Text = dr["LandlineNo"].ToString();
// TextBox4.Text = dr["MobileNo"].ToString();
// TextBox5.Text = dr["Address"].ToString();
// TextBox6.Text = dr["Location"].ToString();
// TextBox7.Text = dr["Unit"].ToString();

39
}
/ //else
//{
// Response.Write("<script language=javascript>alert('No Record Found!')</script>");

//}

}
protected void Button4_Click(object sender, EventArgs e)
{
//con.Open();
//cmd = new SqlCommand("delete from Bloodtb where BloodBankName='" +
DropDownList2.Text + "' and BloodGroup='" + DropDownList1.Text + "'", con);
//cmd.ExecuteNonQuery();
//con.Close();
//Response.Write("<script language=javascript>alert('Record Deleted!')</script>");
}
protected void Button3_Click(object sender, EventArgs e)
{
//con.Open();
//cmd = new SqlCommand("Update Bloodtb set Unit='" + TextBox7.Text + "' where
BloodBankName='" + DropDownList2.Text + "' and BloodGroup='" + DropDownList1.Text +
"'", con);
//cmd.ExecuteNonQuery();
//con.Close();
//Response.Write("<script language=javascript>alert('Record Updated!')</script>");
}
}

9.1.5 Blood bank information


40
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;

public partial class BloodBankInfo : System.Web.UI.Page


{

SqlConnection con = new SqlConnection(@"Data Source=.\


SQLEXPRESS;AttachDbFilename=D:\sangeeth 2015 Project\Priya\Blood Bank\App_Data\
Blood.mdf;Integrated Security=True;User Instance=True");
SqlCommand cmd;

protected void Page_Load(object sender, EventArgs e)


{
cmd = new SqlCommand("select * from Bloodtb", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();

41
9.1.6 New user registration page
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;

public partial class NewUser : System.Web.UI.Page


{

SqlConnection con = new SqlConnection(@"Data Source=.\


SQLEXPRESS;AttachDbFilename=D:\sangeeth 2015 Project\Priya\Blood Bank\App_Data\
Blood.mdf;Integrated Security=True;User Instance=True");
SqlCommand cmd;

protected void Page_Load(object sender, EventArgs e)


{

}
protected void Button2_Click(object sender, EventArgs e)
{
TextBox1.Text = "";
TextBox2.Text = "";
TextBox3.Text = "";
TextBox4.Text = "";
TextBox5.Text = "";

42
TextBox6.Text = "";
TextBox6.Text = "";
TextBox7.Text = "";
TextBox8.Text = "";
TextBox9.Text = "";
TextBox10.Text = "";

}
protected void Button1_Click(object sender, EventArgs e)
{
cmd = new SqlCommand("insert into regtb
values(@Name,@FatherName,@Gender,@Age,@MobileNo,@Email,@Address,@Bloodgroup,
@UserName,@Password,@Location)", con);
cmd.Parameters.AddWithValue("@Name", TextBox1.Text);
cmd.Parameters.AddWithValue("@FatherName", TextBox2.Text);
cmd.Parameters.AddWithValue("@Gender", RadioButtonList1.SelectedItem.Text);
cmd.Parameters.AddWithValue("@Age", TextBox3.Text);
cmd.Parameters.AddWithValue("@MobileNo", TextBox5.Text);
cmd.Parameters.AddWithValue("@Email", TextBox4.Text);
cmd.Parameters.AddWithValue("@Address", TextBox6.Text);
cmd.Parameters.AddWithValue("@Bloodgroup", TextBox7.Text);
cmd.Parameters.AddWithValue("@UserName", TextBox8.Text);
cmd.Parameters.AddWithValue("@Password", TextBox9.Text);
cmd.Parameters.AddWithValue("@Location", TextBox11.Text);
con.Open();
cmd.ExecuteNonQuery();
con.Close();
Response.Write("<script language=javascript>alert('Register Successfully!')</script>");

43
}
}

9.1.7 Donor registration page


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;

public partial class DonerReg : System.Web.UI.Page


{

SqlConnection con = new SqlConnection(@"Data Source=.\


SQLEXPRESS;AttachDbFilename=D:\sangeeth 2015 Project\Priya\Blood Bank\App_Data\
Blood.mdf;Integrated Security=True;User Instance=True");
SqlCommand cmd;

protected void Page_Load(object sender, EventArgs e)


{

}
protected void Button2_Click(object sender, EventArgs e)
{
TextBox1.Text = "";
TextBox2.Text = "";

44
TextBox3.Text = "";
TextBox4.Text = "";
TextBox5.Text = "";
TextBox6.Text = "";
TextBox6.Text = "";
TextBox7.Text = "";

}
protected void Button1_Click(object sender, EventArgs e)
{
cmd = new SqlCommand("insert into Donortb
values(@DonorName,@FatherName,@Gender,@Age,@Email,@MobileNo,@Address,@Locati
on,@Bloodgroup)", con);
cmd.Parameters.AddWithValue("@DonorName", TextBox1.Text);
cmd.Parameters.AddWithValue("@FatherName", TextBox2.Text);
cmd.Parameters.AddWithValue("@Gender", RadioButtonList1.SelectedItem.Text);
cmd.Parameters.AddWithValue("@Age", TextBox3.Text);
cmd.Parameters.AddWithValue("@MobileNo", TextBox5.Text);
cmd.Parameters.AddWithValue("@Email", TextBox4.Text);
cmd.Parameters.AddWithValue("@Address", TextBox6.Text);
cmd.Parameters.AddWithValue("@Bloodgroup", DropDownList1.Text);
cmd.Parameters.AddWithValue("@Location", TextBox7.Text);
con.Open();
cmd.ExecuteNonQuery();
con.Close();
Response.Write("<script language=javascript>alert('Register Successfully!')</script>");

}
}

45
9.1.8 User personal information

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;

public partial class UserHome : System.Web.UI.Page


{

SqlConnection con = new SqlConnection(@"Data Source=.\


SQLEXPRESS;AttachDbFilename=D:\sangeeth 2015 Project\Priya\Blood Bank\App_Data\
Blood.mdf;Integrated Security=True;User Instance=True");
SqlCommand cmd;

protected void Page_Load(object sender, EventArgs e)


{
cmd = new SqlCommand("select
Name,FatherName,Gender,Age,MobileNo,Email,Address,Bloodgroup,UserName from regtb
where UserNAme='" + Session["us"].ToString() + "' and Password='" + Session["ps"].ToString()
+ "' ", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);

46
DetailsView1.DataSource = dt;
DetailsView1.DataBind();

}
}

9.1.9 User process page

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Net;

public partial class BloodSearch : System.Web.UI.Page


{

SqlConnection con = new SqlConnection(@"Data Source=.\


SQLEXPRESS;AttachDbFilename=D:\sangeeth 2015 Project\Priya\Blood Bank\App_Data\
Blood.mdf;Integrated Security=True;User Instance=True");
SqlCommand cmd;

protected void Page_Load(object sender, EventArgs e)

47
{

}
protected void Button1_Click(object sender, EventArgs e)
{

con.Open();
cmd = new SqlCommand("select * from Bloodtb where BloodGroup='" +
DropDownList1.Text + "' and Location like '%" + TextBox1.Text + "%'", con);
SqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
{
GridView1.DataSource = dr;
GridView1.DataBind();

GridView2.DataSource = null;
GridView2.DataBind();
}
else
{
dr.Close();
cmd = new SqlCommand("select * from Donortb where Bloodgroup='" +
DropDownList1.Text + "' and Location like '%" + TextBox1.Text + "%' ", con);
SqlDataReader dr1 = cmd.ExecuteReader();
if (dr1.HasRows)
{

GridView2.DataSource = dr1;
GridView2.DataBind();
dr1.Close();

48
GridView1.DataSource = null;
GridView1.DataBind();

else
{

Response.Write("<script language=javascript>alert('No Record Found!')</script>");

}
}

}
con.Close();

}
protected void Button2_Click(object sender, EventArgs e)
{
//string s;
//s = Session["us"].ToString();

//sendmessage(GridView1.SelectedRow.Cells[4].Text, TextBox2.Text);
//Response.Write("<script language=javascript>alert('Msg send" +
GridView1.SelectedRow.Cells[4].Text + "')</script>");
}

public void sendmessage(string targetno, string message)

49
{
String query = "http://bulksms.mysmsmantra.com:8080/WebSMS/SMSAPI.jsp?
username=AnbuOculus&password=1573055468&sendername=Oculus&mobileno=" + targetno
+ "&message=" + message;
WebClient client = new WebClient();
Stream sin = client.OpenRead(query);

}
protected void Button3_Click(object sender, EventArgs e)
{
sendmessage(GridView2.SelectedRow.Cells[6].Text, TextBox3.Text);
Response.Write("<script language=javascript>alert('Msg send" +
GridView2.SelectedRow.Cells[6].Text + "')</script>");

50

You might also like