Documente Academic
Documente Profesional
Documente Cultură
ABSTRACT:
Our project Hospital Management system includes registration of patients, storing their details
into the system, making appointment, searching doctors, and adding and viewing blood donors.
Our software has the facility to give a unique id for every patient and stores the details of every
patient and can retrieve the information about the doctors available. User can search availability
of a doctor and the details of a patient using the id and the blood donors available. The Hospital
Management System can be entered using a username and password. The hospital payment
can be done through online. It is accessible either by an administrator or receptionist. Only they
can add data into the database. The data can be retrieved easily. The interface is very user-
friendly. The data are well protected for personal use and makes the data processing very fast.
PROBLEM DESCRIPTION:
1. LOG IN PAGE:
2. SIGN UP PAGE:
3. PATIENT DATA ENTRY:
4. MAIN PAGE:
5. SEARCH DOCTOR:
10.PAYMENT METHODS:
DATABASES CREATED:
1. LOGIN TABLE:
2. DOCTOR TABLE:
3. PATIENT TABLE:
4. BLOOD DONOR TABLE:
5. APPOINMENT TABLE:
SOURCE CODE:
LOGINPAGE.ASPX:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Services;
using System.Windows.Forms;
namespace hospitalmanagement
{
public partial class doctormainpage : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void TextBox3_TextChanged(object sender, EventArgs e)
{
}
protected void Button2_Click(object sender, EventArgs e)
{
string username = TextBox2.Text;
string pass = TextBox3.Text;
hospitalmanagement.WebService1 obj = new hospitalmanagement.WebService1();
string output = obj.Validate(username, pass);
if (output == "login successful")
{
Response.Redirect("WebForm1.aspx");
}
else
{
MessageBox.Show("username or password is invalid!");
}
}
}
WEBSERVICE1.ASMX:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Windows.Forms;
using System.Data.OleDb;
using System.Data;
namespace hospitalmanagement
{
/// <summary>
/// Summary description for WebService1
/// </summary>
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment
the following line.
// [System.Web.Script.Services.ScriptService]
public class WebService1 : System.Web.Services.WebService
{
[WebMethod]
public string Validate(string user, string pass)
{
OleDbConnection con = new
OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data
Source=C:\\Users/HP/Documents/Visual Studio 2012/webserviceproject.accdb");
OleDbCommand cmd1 = new OleDbCommand("Select * from patientlogin where
username = @username and Password = @password", con);
cmd1.Parameters.AddWithValue("@username", user);
cmd1.Parameters.AddWithValue("@password", pass);
con.Open();
adapt.Fill(ds);
con.Close();
int count = ds.Tables[0].Rows.Count;
//If count is equal to 1, than show frmMain form
string ex="";
if (count == 1)
{
ex="login successful";
}
else
{
ex="login failed";
}
return ""+ex;
}
}
}
SIGNUP.ASPX:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
using System.Data.OleDb;
using System.Windows.Forms;
namespace hospitalmanagement
{
public partial class signupWebForm2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
else if (((txt1.Equals("") != true) || (txt2.Equals("") != true) ||
(txt3.Equals("") != true))&&(txt2==txt3))
{
hospitalmanagement.signupWebService3 obj = new
hospitalmanagement.signupWebService3();
obj.signup(txt1, txt2);
string data = txt1;
Response.Redirect("addpatientdetails.aspx?data=" +data);
}
}
}
}
PATIENTDETAILS.ASPX:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
using System.Data.OleDb;
using System.Windows.Forms;
namespace hospitalmanagement
{
public partial class addpatientdetails : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
int c = cmd.ExecuteNonQuery();
if (c == 1)
{
MessageBox.Show("patient details added successfully!");
}
con.Close();
string value = txt7;
Response.Redirect("WebForm1.aspx?value=" +value);
}
}
}
PATIENTDETAILSWEBSERVICE.ASMX:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
using System.Data.OleDb;
using System.Windows.Forms;
namespace hospitalmanagement
{
/// <summary>
/// Summary description for signupWebService3
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment
the following line.
// [System.Web.Script.Services.ScriptService]
public class signupWebService3 : System.Web.Services.WebService
{
[WebMethod]
public void signup(string txt1, string txt2)
{
OleDbConnection con = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;
Data Source=C:\\Users/HP/Documents/Visual Studio 2012/webserviceproject.accdb");
con.Open();
int c = cmd.ExecuteNonQuery();
if (c == 1)
{
MessageBox.Show("Signup :Successful");
}
con.Close();
}
}
}
MAINPAGE.ASPX:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace hospitalmanagement
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
SEARCHDOCTOR.ASPX:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
using System.Data.OleDb;
using System.Windows.Forms;
namespace hospitalmanagement
{
public partial class searchdoctorform : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
OleDbConnection con = new
OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data
Source=C:\\Users/HP/Documents/Visual Studio 2012/webserviceproject.accdb");
OleDbDataAdapter da = new OleDbDataAdapter("select DoctorName,Department from
doctortable", con);
DataSet DS = new DataSet();
da.Fill(DS);
GridView1.DataSource = DS.Tables[0].DefaultView;
GridView1.DataBind();
}
}
}
}
DISPLAYDOCTOR.ASPX:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
using System.Data.OleDb;
using System.Windows.Forms;
namespace hospitalmanagement
{
public partial class displaydoctor : System.Web.UI.Page
{
}
protected void Button4_Click(object sender, EventArgs e)
{
hospitalmanagement.WebService2 obj=new hospitalmanagement.WebService2();
string data = Request.QueryString["value"];
DataSet mydata = obj.Retrieve(data);
GridView1.DataSource = mydata.Tables[0].DefaultView;
GridView1.DataBind();
}
DISPLAYDOCTORWEBSERVICE.ASMX:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
using System.Data.OleDb;
using System.Windows.Forms;
namespace hospitalmanagement
{
/// <summary>
/// Summary description for WebService2
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment
the following line.
// [System.Web.Script.Services.ScriptService]
public class WebService2 : System.Web.Services.WebService
{
[WebMethod]
public DataSet Retrieve(string value)
{
OleDbConnection con = new
OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data
Source=C:\\Users/HP/Documents/Visual Studio 2012/webserviceproject.accdb");
OleDbCommand cmd1 = new OleDbCommand("select * from doctortable where
DoctorName=@DoctorName", con);
cmd1.Parameters.AddWithValue("@DoctorName", value);
con.Open();
OleDbDataAdapter adapt = new OleDbDataAdapter();
adapt.SelectCommand = cmd1;
DataSet ds = new DataSet();
adapt.Fill(ds);
con.Close();
return ds;
}
}
}
VIWEDONOR.ASPX:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
using System.Data.OleDb;
using System.Windows.Forms;
namespace hospitalmanagement
{
public partial class viewdonor : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
VIEWDONORWEBSERVICE.ASMX:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
using System.Data.OleDb;
using System.Windows.Forms;
namespace hospitalmanagement
{
/// <summary>
/// Summary description for viewdonorserver
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment
the following line.
// [System.Web.Script.Services.ScriptService]
public class viewdonorserver : System.Web.Services.WebService
{
[WebMethod]
public String donorsearch(String txt4,String txt5)
{
int flag = 0;
string t1 = txt4.ToUpper();
string t2 = txt5.ToLower();
OleDbConnection con = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;
Data Source=C:\\Users/HP/Documents/Visual Studio 2012/Database3.accdb");
OleDbCommand cmd = new OleDbCommand("Select * from donor where
bloodgrp=@bloodgrp and place=@place ",con);
cmd.Parameters.AddWithValue("@bloodgrp", t1);
cmd.Parameters.AddWithValue("@place", t2);
adapt.Fill(ds);
con.Close();
int count = ds.Tables[0].Rows.Count;
if (count == 1)
{
flag = 1;
}
if (flag == 1)
{
return ("AVAILABLE");
}
else
{
return ("not available");
}
}
public DataSet donordet(String txt4,String txt5)
{
String t = txt4.ToUpper();
String p = txt5.ToLower();
adapt.Fill(ds);
return ds;
}
}
}
ADDDONOR.ASPX:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace hospitalmanagement
{
public partial class adddonorform : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
ADD_DONORWEBSERVICE.ASMX:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
using System.Data.OleDb;
using System.Windows.Forms;
namespace hospitalmanagement
{
/// <summary>
/// Summary description for adddonorser
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment
the following line.
// [System.Web.Script.Services.ScriptService]
public class adddonorser : System.Web.Services.WebService
{
[WebMethod]
public void dadd(String txt1, int txt2, String txt3, String txt4, String txt5,
String txt6)
{
int c = cmd.ExecuteNonQuery();
if (c == 1)
{
MessageBox.Show("Registration Successful");
}
con.Close();
}
}
}
MAKEAPPOINTMENT.ASPX:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace hospitalmanagement
{
public partial class makeappointform : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button8_Click(object sender, EventArgs e)
{
Response.Redirect("payment.aspx");
}
MAKEAPPOINTMENTWEBSERVICE.ASMX:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
using System.Data.OleDb;
using System.Windows.Forms;
namespace hospitalmanagement
{
/// <summary>
/// Summary description for makeappointser
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment
the following line.
// [System.Web.Script.Services.ScriptService]
public class makeappointser : System.Web.Services.WebService
{
[WebMethod]
public void makeapp(String cn, String dn, string check)
{
try
{
OleDbConnection con = new OleDbConnection();
con.ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data
Source=C:\\Users/HP/Documents/Visual Studio 2012/Database2.accdb;
Persist Security Info=False;";
con.Open();
int i = cmd.ExecuteNonQuery();
if (i != 0)
{
MessageBox.Show("The Appointment is confirmed!");
}
else
{
MessageBox.Show("SOMETHING WENT WRONG WITH THE SELECTION");
}
con.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
}
PAYMENT.ASPX:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Windows.Forms;
namespace hospitalmanagement
{
public partial class payment : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void RadioButton3_CheckedChanged(object sender, EventArgs e)
{
Response.Redirect("https://www.indianbank.net.in/jsp/startIB.jsp;jsessionid=5f7cZLkS2whQy
JXK7HvhNxC8Nj16tFhJGJvYJh8mTJJ9yCnv6K7h!509900259");
}
if (nb == "SBI")
{
Response.Redirect("https://www.onlinesbi.com/");
}
if (nb == "CUB")
{
Response.Redirect("https://www.onlinecub.net/");
}
}
if (RadioButton2.Checked == true || RadioButton4.Checked == true)
{
Response.Redirect("cardform.aspx");
}
}
}
}
CARD.ASPX:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Windows.Forms;
using System.Web.UI.WebControls;
namespace hospitalmanagement
{
public partial class cardform : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
else
{
MessageBox.Show("payment successful");
Response.Redirect("makeappointform.aspx");
}
}
}
}