Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

COURSE:

DATABASE SYSTEM

PROJECT TITLE:

BLOOD DONATION MANAGEMENT SYSTEM

SUBMITTED TO:

ENGR. MUHAMMAD SHOAIB

SUBMITTED BY:

GHULAM FATIMA (012)

SIDRA YOUNAS (030)

SUNDUS ASIF (031)


“BLOOD DONATION MANAGEMENT SYSTEM”

SCOPE:

The scope of the Blood Donation Management System project encompasses the design,
implementation, and deployment of a comprehensive database system to efficiently manage blood
donations, donors, recipients, and hospitals. This project aims to streamline the process of tracking
and managing blood donations and transfusions, ensuring accuracy, security, and accessibility of
critical information. By leveraging MySQL for database management and Visual Studio for the
user interface, the system will provide a robust platform for healthcare administrators to monitor
and coordinate blood donation activities. The scope includes the creation of database tables,
relationships, user interface design, and the implementation of various queries and functionalities
to support the overall management system.

INTRODUCTION:

The Blood Donation Management System project is designed to address the need for a streamlined,
efficient, and reliable way to manage blood donations, donors, recipients, and hospitals. In many
healthcare settings, managing these elements manually can be prone to errors and inefficiencies.
This project aims to digitize and automate the process, ensuring that all relevant data is accurately
recorded, easily accessible, and securely managed. The system will facilitate the management of
donor information, blood inventory, recipient needs, and hospital requirements, thereby improving
the overall efficiency and effectiveness of blood donation programs.

OBJECTIVES:

The primary objectives of the Blood Donation Management System project are as follows:

1. To create a structured database for managing blood donation-related information, including


donor, recipient, manager, and hospital data.
2. To develop a user-friendly interface using Visual Studio that allows for efficient data entry,
retrieval, and management.
3. To ensure data integrity, accuracy, and security throughout the system.
4. To enable easy tracking of blood donations, from donor registration to recipient
transfusion.
5. To provide a reliable platform for generating reports and queries related to blood donation
activities.

SYSTEM OVERVIEW:

The Blood Donation Management System comprises a MySQL database that serves as the backend
for storing and managing all related data. The frontend is developed using Visual Studio, providing
an interface for users to interact with the system. The system includes several key components:
 Database: Manages data storage for donors, recipients, managers, and hospitals.
 User Interface: Developed in Visual Studio, allows users to input, update, and retrieve
data.
 Queries and Reports: Enables users to run specific queries and generate reports based on
the stored data.

DATABASE DESIGN:

The database design is central to the Blood Donation Management System. It involves creating
tables for managing different entities such as donors, recipients, managers, and hospitals. Each
table is defined with specific fields and relationships to ensure data integrity and accuracy. Key
tables include:

 Manager: Stores information about managers overseeing blood donation activities.


 Donor: Records details about donors, including personal information and blood type.
 Recipient: Contains information about recipients and their blood transfusion needs.
 Hospital: Lists hospitals involved in the blood donation program.

IMPLEMENTATION:

The implementation phase involves coding the MySQL database and developing the Visual Studio
application. Key tasks include:

 MySQL Database Creation: Writing SQL scripts to create tables, define relationships,
and populate initial data.
 Visual Studio Application: Developing forms and functionalities to allow users to interact
with the database, including data entry, updates, and retrieval.
 Query Implementation: Writing and integrating SQL queries to support various data
operations, such as displaying donor information and tracking blood inventory.

CONCLUSION:

The Blood Donation Management System successfully addresses the need for an efficient and
reliable platform to manage blood donations. By digitizing the process, the system ensures that
critical information is accurately recorded and easily accessible, thereby improving the overall
management of blood donation activities. The project demonstrates the effective use of database
systems in healthcare and highlights the benefits of integrating technology to enhance operational
efficiency.
“IMPLEMENTATION”

MYSQL CODE:

CREATE DATABASE BLOODDONATIONSMANAGEMENTSYSTEM;


USE BLOODDONATIONSMANAGEMENTSYSTEM;
CREATE TABLE Manager (
Mag_ID INT PRIMARY KEY,
Mg_Name VARCHAR(100),
Hos_ID INT
);
INSERT INTO Manager (Mag_ID, Mg_Name, Hos_ID) VALUES (1, 'sidra', 1);
INSERT INTO Manager (Mag_ID, Mg_Name, Hos_ID) VALUES (2, 'fatima', 2);
INSERT INTO Manager (Mag_ID, Mg_Name, Hos_ID) VALUES (3, 'sundus', 3);
INSERT INTO Manager (Mag_ID, Mg_Name, Hos_ID) VALUES (4, 'zaviyar', 4);
INSERT INTO Manager (Mag_ID, Mg_Name, Hos_ID) VALUES (5, 'mosa', 5);
SELECT * FROM Manager;

CREATE TABLE Donor (


D_ID INT PRIMARY KEY,
First_Name VARCHAR(50),
Last_Name VARCHAR(50),
Blood_Group VARCHAR(5),
Age INT,
Gender CHAR(1),
Reg_Date DATE
);
INSERT INTO Donor (D_ID, First_Name, Last_Name, Blood_Group, Age, Gender, Reg_Date) VALUES (1,
'Kinza', 'Younas', 'A+', 30, 'F', '2024-01-01');
INSERT INTO Donor (D_ID, First_Name, Last_Name, Blood_Group, Age, Gender, Reg_Date) VALUES (2,
'Mehwish', 'Ghulam', 'B+', 25, 'F', '2024-01-02');
INSERT INTO Donor (D_ID, First_Name, Last_Name, Blood_Group, Age, Gender, Reg_Date) VALUES (3,
'Musfira', 'Asif', 'O-', 28, 'F', '2024-01-03');
INSERT INTO Donor (D_ID, First_Name, Last_Name, Blood_Group, Age, Gender, Reg_Date) VALUES (4,
'Asad', 'Ahmed', 'AB+', 35, 'M', '2024-01-04');
INSERT INTO Donor (D_ID, First_Name, Last_Name, Blood_Group, Age, Gender, Reg_Date) VALUES (5,
'Danyal', 'Khan', 'A-', 32, 'M', '2024-01-05');
SELECT * FROM Donor;

CREATE TABLE Recipient (


Reci_ID INT PRIMARY KEY,
Mag_ID INT,
Age INT,
Blood_Qty INT,
Reci_Date DATE,
Gender CHAR(1),
First_Name VARCHAR(50),
Last_Name VARCHAR(50)
);
INSERT INTO Recipient (Reci_ID, Mag_ID, Age, Blood_Qty, Reci_Date, Gender, First_Name, Last_Name)
VALUES (01, 1, 30, 500, '2024-01-01', 'F', 'Humaira', 'Batool');
INSERT INTO Recipient (Reci_ID, Mag_ID, Age, Blood_Qty, Reci_Date, Gender, First_Name, Last_Name)
VALUES (02, 2, 25, 600, '2024-01-02', 'F', 'Rafia', 'Shakil');
INSERT INTO Recipient (Reci_ID, Mag_ID, Age, Blood_Qty, Reci_Date, Gender, First_Name, Last_Name)
VALUES (03, 3, 28, 700, '2024-01-03', 'F', 'Mehak', 'Zahra');
INSERT INTO Recipient (Reci_ID, Mag_ID, Age, Blood_Qty, Reci_Date, Gender, First_Name, Last_Name)
VALUES (04, 4, 35, 800, '2024-01-04', 'M', 'Waleed', 'Hassan');
INSERT INTO Recipient (Reci_ID, Mag_ID, Age, Blood_Qty, Reci_Date, Gender, First_Name, Last_Name)
VALUES (05, 5, 32, 900, '2024-01-05', 'M', 'Uzair', 'Khawar');
SELECT * FROM Recipient;

CREATE TABLE Hospital (


Hos_ID INT PRIMARY KEY,
Hos_Name VARCHAR(100)
);
INSERT INTO Hospital (Hos_ID, Hos_Name) VALUES (111, 'City General Hospital');
INSERT INTO Hospital (Hos_ID, Hos_Name) VALUES (222,'Central Military Hospital');
INSERT INTO Hospital (Hos_ID, Hos_Name) VALUES (333,'Military Hospital');
INSERT INTO Hospital (Hos_ID, Hos_Name) VALUES (444,'Rawalpindi Institute of Cardiology');
INSERT INTO Hospital (Hos_ID, Hos_Name) VALUES (555, 'PIMS Hospital');

SELECT * FROM Hospital;


commit;
VISUAL STUDIO CODE:
using MySql.Data.MySqlClient;
namespace BLOODDONATIONMANAGEMENT
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)


{
try
{
string connstring =
"server=localhost;uid=root;pwd=1234;database=BLOODDONATIONSMANAGEMENTSYSTEM";
using (MySqlConnection con = new MySqlConnection(connstring))
{
con.Open();
//query for displaying data from Maanger
string ManagerSql = "SELECT * FROM Manager";
MySqlCommand ManagerCmd = new MySqlCommand(ManagerSql, con);
MySqlDataReader ManagerReader = ManagerCmd.ExecuteReader();
while(ManagerReader.Read())
{
MessageBox.Show("Mag_ID " + ManagerReader["Mag_ID"] +
"Mg_Name " + ManagerReader["Mg_Name"] +
"Hos_ID " + ManagerReader["Hos_ID"]);
}
ManagerReader.Close();
//query for displaying data from Donor
string DonorSql = "SELECT * FROM Donor";
MySqlCommand DonorCmd = new MySqlCommand(DonorSql, con);
MySqlDataReader DonorReader = DonorCmd.ExecuteReader();
while (DonorReader.Read())
{
MessageBox.Show("D_ID " + DonorReader["D_ID"] +
"First_Name " + DonorReader["First_Name"] +
"Last_Name " + DonorReader["Last_Name"]+
"Blood_Group " + DonorReader["Blood_Group"] +
"Age " + DonorReader["Age"] +
"Gender " + DonorReader["Gender"] +
"Reg_Date " + DonorReader["Reg_Date"]
);
}
DonorReader.Close();

//query for displaying data from Recipient


string RecipientSql = "SELECT * FROM Recipient";
MySqlCommand RecipientCmd = new MySqlCommand(RecipientSql, con);
MySqlDataReader RecipientReader = RecipientCmd.ExecuteReader();
while (RecipientReader.Read())
{
MessageBox.Show("Reci_ID " + RecipientReader["Reci_ID"] +
"Mag_ID " + RecipientReader["Mag_ID"] +
"Age " + RecipientReader["Age"] +
"Blood_Qty " + RecipientReader["Blood_Qty"] +
"Reci_Date " + RecipientReader["Reci_Date"] +
"Gender " + RecipientReader["Gender"] +
"First_Name " + RecipientReader["First_Name"]+
"Last_Name " + RecipientReader["Last_Name"]
);
}
RecipientReader.Close();

//query for displaying data from Hospital


string HospitalSql = "SELECT * FROM Hospital";
MySqlCommand HospitalCmd = new MySqlCommand(HospitalSql, con);
MySqlDataReader HospitalReader = HospitalCmd.ExecuteReader();
while (HospitalReader.Read())
{
MessageBox.Show("Hos_ID " + HospitalReader["Hos_ID"] +
"Hos_Name " + HospitalReader["Hos_Name"]
);
}
HospitalReader.Close();
}
}catch (Exception ex) {MessageBox.Show(ex.ToString()); }

}
}
}

CONNECTION BUTTON THROUGH WHICH WE ARE


CONNECTING OUR DATABASE TABLES FROM MYSQL TO
VISUAL STUDIO 2022:
SHOWING DATABASE TABLES ON COMMAND PROMPT:

You might also like