Sie sind auf Seite 1von 80

Project on

Hospital Management system

SUBMITTED FOR THE PARTIAL FULFILLMENT OF THE ACADEMIC REQUIREMENT FOR THE DEGREE OF BCA

Submitted By

Name Roll No.

:FAIZ AHMAD :520758650

Final Sem. Of BCA Study Center Session :02789 :2007-2010

(Shree Ram Infotech,Hazaribag)

Internal Signature

External Signature

DECLARATION
I, Faiz Ahmad, being a software trainee, studying in final semester of BCA under SIKKIM MANIPAL UNIVERSITY, am making project on the title namely Hospital Management System, under the guidance of Mr. Shyam kumar. The education center of this university is Shree ram infotech, situated in hazaribag, which is playing an important role for IT education related to software.

This project i.e. such as;

Hospital Management System solves the problem

To keep track of Book details. To maintain the staffing and expenses of Book Shop.

Thanks,

Faiz Ahmad

ACKNOWLEDGEMENT

First of all, I must thanks for my guide Mr. shyam kumar for their major involvement and also for all faculty member of BCA for their guidance in every stage. I am also thankful to the library staff of our center for their instant help in procuring the reference books from time to time.

I would also like to thank my mom and my family member for giving me a moral support and I also thankful to my friend for giving me a suggestion about this project.

Finally I am thankful to that people who are indirectly attached to this project

ABSTRACT
In the current age of computer, effort has been made to cover every aspect of human life with faster computing power of digital computers. Especially in the commercial organizations where there is huge data to process every day and interaction between different working groups of the organization for taking crucial decisions exits, there is a desire to have comprehensive information available more quickly in order to improve internal administration, planning and processing. Therefore, systematic effort to reduce the international uncertainties becomes an important driving factor for the establishment of automatic system. As the versatile and speed becomes the most important factor of any system, the need of any system came into the picture. Computerized system posses these properties and it is very useful, especially when huge data are to be processed and interaction between different working groups are necessary for taking crucial decisions. Therefore the systematic effort to reduce the information uncertainty becomes important driving factor for establishment of the computerized system. The main idea behind this system entitled Hospital Management System is to design a system, which would be a continuous source of information for the performing operation. The main and important modules developed by me for this system are given below.
Sales Record Module Purchase Record Module Expense Details Module

CONTENTS
1. Introduction 2. Objective 3. Problem Statement 4. Requirement Analysis A. Logical DFD B. Data Dictionary C. Decision Table & Trees 5. Analysis And Design a. Structure Chart b. Data Flows 6. Coding 7. Testing Procedures 8. Testing Reports 9. Documentation 10. Future Application 11. Conclusion 12. Bibliography

OBJECTIVE

In the existing system, all the office works in the Hospital Management System is running manually. The manual work process is time contraction, hence slow. Following are the main drawbacks of the existing system: The existing system is totally man dependent. So there are chances of error in processing. The basic and major drawback in the existing system is the speed of retrieval of data from file, which lead to delay. Maintenance of voluminous data is very cumbersome and laborious job. The manual works, such as calculation etc. are more error prone. There are plenty of chance of duplicity of data and information. Updating is very tedious job. The above facts, figures and drawbacks clearly indicate that there is need for computerization. After a long drawn discussion it was decided to computerize the Sales and Invoice section Since the existing system was totally manual which has a lot of complexities, shortcoming in itself and all the data was being stored in registers, file etc. and keeping in mind the above limitation of the existing system, to overcome these limitations the new computerized system was needed, so that information can be provided to the users more easily, more quickly and more accurately.
Following are the advantage of Computerized System:-

The existing system is totally computerized so there are no chances of error in processing.
It is time saving Updating is very easy job There are no chance of duplicate data and information

INTRODUCTION
I have a goal in writing this project to develop a system through which we can easily manipulate or calculate the patient bills and their record as well as doctors information easily. For completing this project I took at most eight months. In developing this project I follow all the various stages of software development process. The system which I develop is named as Hospital Management System. Following environments are used in developing the Hospital Management SystemHardware Requirements: Processor : Main memory Hard Disk : 80 GB : Dual Core 1 GB

Software Requirement: Front end : Back end : Microsoft Visual Studio 2008 (C#) Sql Server 2005 32 bit ODBC interface Windows XP or Above

Interface : Platform :

C#:- C# is the next generation of the visual basic language from Microsoft. C# has many new and improved features such as inheritance, interfaces and overloading that make it a powerful object oriented programming language.

Database: - a database is a collection of related data. The database can be of any size and of varying complexity. A database may be generated and maintained manually or it may be computerized.

PROBLEM STATEMENT

As the Hospital may have to deal with more than one Patient at a time and have to keep a track between various things related to Patient details and to maintain their beds and they have to maintain lots of register to keep all the details. As the system is manual hence its time taking and usually face problems like: How to get relevant information faster? How to provide the same information to more than one person at any particular time? It also needs two or three persons for maintaining of all these information.

Microsoft SQL Server 2005 Compact Edition (SQL Server Compact Edition) is the rebranding of Microsoft SQL Server 2005 Mobile Edition (SQL Server Mobile 3.0) without the desktop restriction. SQL Server Mobile 3.0 was released in 2005 with Microsoft Visual Studio 2005 and with SQL Server 2005. SQL Server Mobile 3.0 is supported on devices and on Tablet PCs. SQL Server Mobile 3.0 is also partially supported on desktop computers. To use SQL Server Mobile 3.0 on desktop computers, either Visual Studio 2005 or SQL Server 2005 must be installed. However, with SQL Server Compact Edition, this restriction has been removed. With SQL Server Compact Edition, you can develop and deploy applications independent of SQL Server 2005 and of Visual Studio 2005. The SQL Server Compact Edition Community Technology Preview (CTP) was released on June 12, 2006. SQL Server Compact Edition Release Candidate 1 (RC1) was released on November 7, 2006. Both the CTP version and the RC1 version of SQL Server Compact Edition were only for runtime binaries. The Release to Web (RTW) version of SQL Server Compact Edition for all packages was released on January 15, 2007. The version of SQL Server Compact Edition RTW is 3.1. The following packages were released together with the RTW version of SQL Server Compact Edition: Microsoft SQL Server 2005 Compact Edition Runtime Microsoft SQL Server 2005 Compact Edition Tools for Visual Studio 2005 Service Pack 1 (SP1) Microsoft SQL Server 2005 Compact Edition Developer Software Development Kit (SDK) Microsoft SQL Server 2005 Compact Edition Server Tools

Microsoft SQL Server 2005 Compact Edition Books Online SQL Server Compact Edition for all packages is released in the following languages: German English Spanish French Italian Japanese Korean Chinese Traditional Chinese Simplified Russian SQL Server Compact Edition will also be included with SQL Server in future service pack releases. SQL Server 2005 Service Pack 2 (SP2) will be released in the first quarter of 2007. The following are the high-level highlights for how Microsoft will service SQL Server Compact Edition: SQL Server Compact Edition is available on the Web and can be downloaded and installed. SQL Server Compact Edition will be integrated into Microsoft Update in the first quarter of 2007. SQL Server Compact Edition will be installed as part of the SQL Server 2005 SP2 installation.

DATA FLOW DIAGRAM

Zero Level DFD

Admin Users

Hospital Management System

Data Store

First Level DFD

Vallidate Users User ID/ Password User Authentication Invallid Users Patient Info

Options

Service tax

New Patient

Patient

Service Tax

Electricity

Add Doctor Doctor Info Treatment Details

Doctor

Electricity

pilgrim

REQUIREMENT ANALYSIS

The Aim of the application to be developed Hospital Management System is to provide an efficient, user friendly, computerized environment for processing of a The main components of this Hospital Management System include: -

Timely and efficient communication between Patient IN and Patient OUT, which will serve to measure the Details. Efficient and accurate Tax report is to be prepared. A system to ensure proper internal control of Income and Expense. A system to manage the Database and produce reports as per the requirement.

SOFTWARE REQUIREMENT SPECIFIICATIONS (SRS)


Software requirement specification is a set of documents that contains the concise and clear specification of the functional, performance, design and interface requirements of the proposed system

DATA DICTIONARY FOR HOSPITAL MANAGEMENT SYSTEM


Table Name:bill Purpose: this will store all information about Hospital bill.
Attribute name Name No Mcharge bcharge Ocharge total Data type Char int Int Int Int int Size 20 Description Name of Patient Bill No. Medecine Charge Bed Charge Other Charge Total

create table bill(name char(20),no int,mcharge int,bcharge int,ocharge int,total int)

Table Name: doctor Purpose: this will store all information about Hospital doctor.
Attribute name Name Id Address Dob Qualification Sex Data type Char Int Varchar varchar varchar char Size 20 20 20 20 20 20 Description Name of City Doctor id Address of doctor Date of birth Qualification of doctor Sex of doctor

create table doctor(name char(20),id varchar(20),address varchar(20),dob varchar(20),qualification varchar(20),sex char(10))

Table Name: electricity Purpose: this will store all information about electricity.
Attribute name Month Year Provider Charge units Rental total Data type Char int Char Int Int Int Int Size 20 20 20 Description Name of month Name of year Provider Charge per unit Units consumed Rental Total

create table electricity(month char(10),year integer,provider char(20),charge float,units integer,rental float,total float)

Table Name: patient Purpose: this will store all information about patient Details.
Attribute name Name Treatment Fname Pcode Age sex Data type Char Char char Int Int Char 20 Size 20 20 20 Description Name of patient Treatment Fathers name Patient code Age Sex

create table patient(name char(20),treatement varchar(20),fname char(20),pcode int,age int,sex char(10))

Table Name: servicetax Purpose: this will store all information about service Details.
Attribute name Income State Central totaotax totalprofit Data type Int Int Int Int Int Size Description Total income State govt. tax Central govt. tax Total tax Total profit

create table servicetax(income float,state float,central float,totaotax float,totalprofit float)

Table Name: treatmentdetals Purpose: this will store all information about patient treatment Details.
Attribute name Name Id Days status Data type Char Int Int Char 30 Size 20 Description Name of patient Doctor id Treatment days Patient status

create table treatmentdetals(name char(20),id int,days int,status char(10))

DECISION TABLES

Name

Type of operation are performed in the related table Insertion Deleting Updating View

Bill form

Doctor form
Electricity form In patient entry servicetax form Treatment details In patient remove Remove doctor

FEASIBILITY STUDY
The result of the feasibility study is a formal proposal. This is simply report-a formal document detailing the nature and the scope of the proposed solution. The proposals summarize what is known and what is going to be done. Three key considerations are involved in the feasibility analysis: economic, technical and operational behavior.

2.3.1 Economic Feasibility: Economic analysis is the most frequently used method for evaluating the effectiveness of a candidate system. More determine the benefits and the saving that are expressed from a candidate system and compare them costs. If benefits outweigh costs. Otherwise, further justification or alterations in the proposed system will have to be made if it is to have a chance of being approved. This is an ongoing effort that improves in accuracy at each phase of the system life cycle. 2.3.2 Technical Feasibility: Technical feasibility center around the existing computer system hardware etc. and to what extent it can support the proposed addition. For example, if the current computer is operating at 80% capacity - an arbitrary ceiling then running another application could over load the system or require additional hardware. This involves financial consideration to accommodate technical enhancements. If the budget is a serious constraint then the project is judged not feasible. 2.3.3 Operational Feasibility: It is common knowledge that computer installations have some thing to do with turnover, transfers, retraining and changes in employee job status. Therefore, it is understandable that the introduction of a candidate system requites special efforts to educate, sell, and train the staff on new ways of conducting business.

2.3.4 C h o i c e o f P l a t f o r m ?

In any organization a lot of data is generated as result of day-to-day operations. In the past, all kind of data be it business of a company. Since the task was performed manually, it was time consuming and error prone. With the advent of computer, the task of maintaining large amount of data has undergoes a sea change. Today computer system have become so user friendly that even first time users can create their own application with the help of tools such as MS-Access, Fox-Pro and SQL Server. These tools are very visual and hence user friendly. They provide a point and click environment for building applications that can interact with large amount of data.

DataBase Models :
There are three kind of database models :1. 2. 3. Single tier architecture. Two tier architecture. N- tier architecture.

Single tier Architecture :- In this kind of architecture Database and Client Application remains on One machine i.e there is no client server technology , there is no centralization of database and basically it is a stand alone system.

Two tier Architecture :- In this Kind of architecture Database and client application is on two different machines i.e. Database on one machine and Application on another machine. In this type of architecture there is client server technology and centralization of data base is there, but it has two demerrits :-

1. 2.

Security is not there, Multiple Client access is not there.

N- tier Architecture :- In this kind of architecture there is a middle-ware in between client and database. Middle ware checks the validity of the client i.e. weather client can access the database or not. Hence there is security in it as well as middle-ware allows multiple clients access.

What is Middle-Ware ? Middle-Ware is a concept , Middle Ware provides centralization of business logic i.e. instead of putting logic on each and every client machine we put logic on a centralized server hence middle ware is nothing but a server side program where all your business logic and business methods reside. It remains on server side and it has all the logical building. Middle ware provides :Multiple Client access. centralized business logic in case of distributed application. Because we are working on Distributed Application Based Project we need platform independent Language :Introduction to Java Java is a high level, third-generation programming language, like C, Fortran, Perl and many others. It is a platform for distributed computing a development and run-time environment that cointains built-in support for the World Wide Web. History of Java

Java development began at Sun Microsystem in 1991, the same year the World Wide Web was conceived. Javas creator , James Gosling did not design java for the Internet. His Objective was to create a common development environment for consumer electronic devices which was easily portable from one device to another. This effort evolved into a language , code named Oak and later renamed Java that retains much of the syntax and power of c++ , but is simpler and more platform independent.

System Analysis Concept

Introduction:-

The purpose of this document is to describe the external requirement for

Finance

Accounting System. It also describes the interfaces for the system Scope the document is used by the developers and will be the basis for validating the final delivered system. Definition, Acronym, Abbreviation: related to various types of code structures and reports. Responsibility of the developer: the developer is responsible for:-

1. Developing the system. 2. Testing the system. 3. Installing the software 4. Conducting the user training for using the system. 5. Maintaining the system after installing. System Analysis

System Analysis System Analysis is the application of the system approach to the study and solution of the problems using computer based system. An activity encompasses most of the tasks collectively called as Computer System Engineering. Analysis is a detailed study of the various operation performed by a system and their relationship within and outside of the system. This involves gathering information and using structured tool for analysis such as DFD (data flow diagram), Decision Tree etc. During analysis data are collected on the available files, decision points and transactions handled by the present system. The fact finding and information gathering for proposed system is the key part of system analysis. Information is gathered from sources both internal and external to the organization. The external sources include vendors, supplier professional journals and other similar systems. The primary internal sources include the system users, system documentation existing programs, and reports.

Analysis is the process of diagnosing situations, done with a defiant aim, with the system kept in mind to produce a report based on the findings. Analysis is a fact of finding technique where studies like the system requirement specifications, boundaries of feasibility analysis and cost benefit analysis are carried out. The requirements of both the system and the software are document and reviewed with the user.

System design:-

System design refers to the technical specification that will be applied in implementing the candidate system. This involves input/output, file and processing design. System design is a solution, a how to approach to the creation of new system. This important phase is composed of several steps. It provides the understandings and procedural details necessary for implementing the system recommended in feasibility study. Emphasis is on translating the performance requirements into design specifications. Design goes through logical and physical stages of development. Logical design reviews the present physical system; prepares input and output specification; makes edit, security, and control specifications details the implementation plan; and prepares a logical design walkthrough. The physical design means out the details of the physical system, plans the system implementation, devises a test and implementation plan, and specifies any new HOW and S/W. Process and stages of system design Process of design: The design phase focus on the detail implementation of the system recommended in the feasibility study emphasis is on translating performance specifications into design specifications. The design phase is a transition from an user oriented document (system proposal) to a document oriented to the programmers or database personal.

Logical and Physical Design: System design goes through two phases of development: Logical and physical design. A data flow diagram shows the logical flow of the system and defines the boundaries of the system. For a candidate systems it describe the inputs (source), outputs (destination), databases (data store), and procedures (data flows). All in a format that meets the users requirements. In the logical system design it specify the user needs at a level of detail that virtually determines the information flow into and out of the system and the required data resources. The design covers the following: 1. Reviews the current physical system- its data flows, file contain, volumes, frequencies, etc. 2. Prepare output specifications- that is determines the formats content, and frequency of report, including terminal specification and locations. 3. Prepare input specification-formats content, and most of the input functions. This includes determining the flow of the document from input data stores to the actual input locations. 4. Prepare edit, security, and control specifications. This includes specifying the rules for edit correction, backup procedures and the controls that insure processing and file integrity. 5. Specifies the implementation plan.

6. Prepare a logical design walkthrough of the information flow output, inputs controls, and implementation plan. 7. Reviews benefits, costs target dates, and system constraints.

Development Activities: Several development activities are carried out during structured design. They are data base design, implementation planning, system test preparation, and system interface specification and user documentation

Data base design: In this activity deals with the design of the physical database. A key is to determine how, the access path are to be implemented. A physical path is derived from logical paths. Program design: In conjunction with the data base design is a decision on programming language to be used and the flowcharting, coding, and debugging procedure prior to conversion. 2.1 System and programs test preparation: Each aspect of the system has separate test requirement. System testing is done after all programming and testing is completed. The test cases cover every

aspect of the candidate system actual operations, user interface and so on. 2.2 System interface specification: This phase specifies for the user how information should enter and leave the system.

Iterative Model Iterative models by definition have an iterative component to the systems development. It allows the developer to take a small segment of the application and develop it in a fashion that, at each recursion, the application is improved. Each of the three main sections: requirements definition, system design, and coding and testing are improved with each cycle through the process.

Design Guidelines From the point of view of project management, software design can be conducted in two phases. Preliminary design concerns with the transformation of requirements into data and software architecture. Detail design focuses on refinements to the architectural representation that led to detailed data structure and algorithmic representations for the software. In addition to the data, architectural and procedural design there is a distinct interface design activity. Interface design establishes the layout and interaction mechanisms for human machine interaction.

TESTING

Testing a program consists of providing a set of test input and observing if the program behaves that expected. If the program fails to behave expected then the condition under a failure occurs are noted for debugging and correction. The error that comes are failure, falt, test case suit.

There are three types of testing:-

6 Unit testing:-It is the testing of different units or modules of a system in isolation. It is always better to first test each module in isolation before integration as it makes subsequent debugging easier, if an error is depleted when a module is being tested along with several after module. It is usually different top determine exactly as to which module has to be error. In unit testing, there are essentially two main approach is used. 2.3 Black-box approach:-In black-box approach test cases designed using only the functional specification of s/w i.e. without any knowledge of the internal structure of s/w

2.4 White-box approach:-in white-box test cases requires though knowledge of the internal structure of s/w

7 Integration testing:-The integration testing consists of a no of steps. During each integration steps some modules are added to the previously, partially integrated system and the system and the system is tested again. The primary objective of integration testing is to test integration module interfaces. In this testing four approach are generally used 2.4.1 2.4.2 2.4.3 2.4.4 Big-bang approach Bottom approach Top-down approach Mixed approach

8 System testing:-System test are designed to validate a fully develop system with a view to the assuming that it means it requirement. There are essentially three main kinds of system testing

8.1 Alpha testing:-Alpha testing refers to the system testing that is carried out by the test team with in the organist ion.

8.2 Beta testing:-Beta testing is the system testing performed by a select group of friendly customers 8.3Acceptance testing:-It is the system testing performed by the customer to determine whether or not to accept the delivery of system.

During system testing in addition to functional and performance test, system test are performed to determining the limitation of the system.

Codes And Form: Welcome form:

Codes for Welcome form:


namespace Hospital_Management_System { public partial class Welcome : Form { Entry_Form ef; public Welcome() { InitializeComponent(); } private void btnProceed_Click(object sender, EventArgs e) { ef = new Entry_Form(); this.Hide(); ef.Show(); } private void Welcome_Load(object sender, EventArgs e) { } } }

Login Form:

Codes for login form:


namespace Hospital_Management_System { public partial class Entry_Form : Form { Main_Form mf; public Entry_Form() { InitializeComponent(); } private void btnLogin_Click(object sender, EventArgs e) { if (txtPwd.Text == "smu" && txtUid.Text == "bca") { mf = new Main_Form(); this.Hide(); mf.Show(); } } private void btnClear_Click(object sender, EventArgs e) { txtPwd.Text = ""; txtUid.Text = ""; } private void btnExit_Click(object sender, EventArgs e) { Application.Exit(); } } }

Main Form:

Codes for Main form:


namespace Hospital_Management_System { public partial class Main_Form : Form { Electricity etc; Service_Tax st; In_Patient_Remove ipr; Bill bl; Treatment_Details td; Add_Doctor ad; In_Patinet_Entry ipe; Entry_Form ef; Remove_Doctor rd; public Main_Form() { InitializeComponent(); } private void inPatientEntryFormToolStripMenuItem_Click(object sender, EventArgs e) { ipe = new In_Patinet_Entry(); this.Hide(); ipe.Show(); } private void exitToolStripMenuItem_Click(object sender, EventArgs e) { Application.Exit(); } private void backToolStripMenuItem_Click(object sender, EventArgs e) { ef = new Entry_Form(); this.Hide(); ef.Show(); } private void addDoctorToolStripMenuItem_Click(object sender, EventArgs e) { ad = new Add_Doctor(); this.Hide(); ad.Show(); } private void removeDoctorToolStripMenuItem_Click(object sender, EventArgs e) { this.Hide(); rd = new Remove_Doctor(); rd.Show(); }

private void billToolStripMenuItem_Click(object sender, EventArgs e) { bl = new Bill(); this.Hide(); bl.Show(); } private void inPatientRemoveToolStripMenuItem_Click(object sender, EventArgs e) { ipr = new In_Patient_Remove(); this.Hide(); ipr.Show(); } private void treatmentDetailsToolStripMenuItem_Click(object sender, EventArgs e) { td = new Treatment_Details(); this.Hide(); td.Show(); } private void serviceTaxToolStripMenuItem_Click(object sender, EventArgs e) { st = new Service_Tax(); this.Hide(); st.Show(); } private void electricityToolStripMenuItem_Click(object sender, EventArgs e) { etc = new Electricity(); this.Hide(); etc.Show(); } private void Main_Form_Load(object sender, EventArgs e) { }

} }

In Patient Entry Form:

Codes for in Patient entry form:


namespace Hospital_Management_System { public partial class In_Patinet_Entry : Form { SqlConnection scon; SqlCommand scom; Main_Form mf; connectionString cs; public In_Patinet_Entry() { InitializeComponent(); cs = new connectionString(); } private void In_Patinet_Entry_Load(object sender, EventArgs e) { scon = new SqlConnection(); scom = new SqlCommand(); scon.ConnectionString = cs.constring1(); scom.Connection = scon; } string sex; private void btnSubmit_Click(object sender, EventArgs e) { try { if (rbFemale.Checked) { sex = rbFemale.Text; } else { sex = rbMale.Text; } scon.Open(); scom.CommandText = "insert into patient values('" + txtName.Text + "','" + txtTreatment.Text + "','" + txtFname.Text + "','" + txtPcode.Text + "','" +txtAge.Text + "','" + sex + "')"; scom.ExecuteNonQuery(); MessageBox.Show("Submitted successfully"); } catch (Exception ec) { MessageBox.Show(ec.Message); } finally { scon.Close(); } } private void btnCancel_Click(object sender, EventArgs e) { Application.Exit();

} private void btnBack_Click(object sender, EventArgs e) { mf = new Main_Form(); this.Hide(); mf.Show(); } private void btnNew_Click(object sender, EventArgs e) { txtAge.Text = ""; txtFname.Text = ""; txtName.Text = ""; txtPcode.Text = ""; txtTreatment.Text = ""; } } }

In Patient remove:

Codes for In patient remove form:


namespace Hospital_Management_System { public partial class In_Patient_Remove : Form { connectionString cs; SqlCommand scom; SqlConnection scon; Main_Form mf; SqlDataAdapter sda; DataTable dt; public In_Patient_Remove() { InitializeComponent(); cs = new connectionString(); } private void btnRemove_Click(object sender, EventArgs e) { try { scon.Open(); scom.CommandText = "delete from patient where pcode='" + cbID.SelectedItem.ToString() + "'"; scom.ExecuteNonQuery(); MessageBox.Show("sucessfully removed"); } catch (Exception jj) { MessageBox.Show(jj.Message); } finally { scon.Close(); } } private void In_Patient_Remove_Load(object sender, EventArgs e) { scon = new SqlConnection(); scom = new SqlCommand(); scom.Connection = scon; scon.ConnectionString = cs.constring1(); try { scon.Open(); scom.CommandText = "select pcode from patient"; SqlDataReader sdr = scom.ExecuteReader(); while (sdr.Read()) { cbID.Items.Add(sdr[0]); } } catch (Exception cc) {

MessageBox.Show(cc.Message); } finally { scon.Close(); } } private void btnBack_Click(object sender, EventArgs e) { mf = new Main_Form(); this.Hide(); mf.Show(); } private void btnExit_Click(object sender, EventArgs e) { Application.Exit(); } } }

Treatment Details form:

Codes for Treatment Details form:


namespace Hospital_Management_System { public partial class Treatment_Details : Form { SqlConnection scon; SqlCommand scom; Main_Form mf; connectionString cs; public Treatment_Details() { InitializeComponent(); cs = new connectionString(); } private void Treatment_Details_Load(object sender, EventArgs e) { scon = new SqlConnection(); scom = new SqlCommand(); scon.ConnectionString = cs.constring1(); scom.Connection = scon; } private void btnSubmit_Click(object sender, EventArgs e) { try { scon.Open(); scom.CommandText = "insert into treatmentdetails values('" + txtName.Text + "','" + txtDid.Text + "','" +txtDays.Text + "','" + txtStatus.Text +"')"; scom.ExecuteNonQuery(); MessageBox.Show("Submitted successfully"); } catch (Exception ec) { MessageBox.Show(ec.Message); } finally { scon.Close(); } } private void btnBack_Click(object sender, EventArgs e) { mf = new Main_Form(); this.Hide(); mf.Show(); } private void btnNew_Click(object sender, EventArgs e) { txtDays.Text = ""; txtDid.Text = "";

txtName.Text = ""; txtStatus.Text = ""; } } }

Add doctor form:

Codes for add doctors form:


namespace Hospital_Management_System { public partial class Add_Doctor : Form { SqlConnection scon; SqlCommand scom; Main_Form mf; connectionString cs; public Add_Doctor() { InitializeComponent(); cs = new connectionString(); } string sex; private void btnSubmit_Click(object sender, EventArgs e) { try { if (rbFemale.Checked) { sex = rbFemale.Text; } else { sex = rbMale.Text; } scon.Open(); scom.CommandText = "insert into doctor values('" + txtName.Text + "','" + txtDoctorID.Text + "','" +txtAddress.Text + "','" +dtp.Text + "','" + txtQualification.Text +"','" + sex + "')"; scom.ExecuteNonQuery(); MessageBox.Show("Submitted successfully"); } catch (Exception ec) { MessageBox.Show(ec.Message); } finally { scon.Close(); } } private void Add_Doctor_Load(object sender, EventArgs e) { scon = new SqlConnection(); scom = new SqlCommand(); scon.ConnectionString = cs.constring1(); scom.Connection = scon; } private void btnBack_Click(object sender, EventArgs e)

{ mf = new Main_Form(); this.Hide(); mf.Show(); } private void btnCancel_Click(object sender, EventArgs e) { Application.Exit(); } private void btnNew_Click(object sender, EventArgs e) { txtAddress.Text = ""; txtDoctorID.Text = ""; txtName.Text = ""; txtQualification.Text = ""; rbFemale.Checked = false; rbMale.Checked = false; } } }

Remove doctor form:

Codes for doctor remove form:


namespace Hospital_Management_System { public partial class Remove_Doctor : Form { connectionString cs; SqlCommand scom; SqlConnection scon; Main_Form mf; SqlDataAdapter sda; DataTable dt; public Remove_Doctor() { InitializeComponent(); cs = new connectionString(); } private void Remove_Doctor_Load(object sender, EventArgs e) { scon = new SqlConnection(); scom = new SqlCommand(); scom.Connection = scon; scon.ConnectionString = cs.constring1(); try { scon.Open(); scom.CommandText = "select id from doctor"; SqlDataReader sdr = scom.ExecuteReader(); while (sdr.Read()) { cbID.Items.Add(sdr[0]); } } catch (Exception cc) { MessageBox.Show(cc.Message); } finally { scon.Close(); } } private void btnBack_Click(object sender, EventArgs e) { mf = new Main_Form(); this.Hide(); mf.Show(); } private void btnExit_Click(object sender, EventArgs e) { Application.Exit(); }

private void btnRemove_Click(object sender, EventArgs e) { try { scon.Open(); scom.CommandText = "delete from doctor where id='" + cbID.SelectedItem.ToString() + "'"; scom.ExecuteNonQuery(); MessageBox.Show("sucessfully removed"); } catch (Exception jj) { MessageBox.Show(jj.Message); } finally { scon.Close(); } } }

Bill form:

Codes for bill form:


namespace Hospital_Management_System { public partial class Bill : Form { BillPrint bp; SqlConnection scon; SqlCommand scom; Main_Form mf; connectionString cs; public Bill() { InitializeComponent(); cs = new connectionString(); } private void Bill_Load(object sender, EventArgs e) { scon = new SqlConnection(); scom = new SqlCommand(); scom.Connection = scon; scon.ConnectionString = cs.constring1(); } private void btnSubmit_Click(object sender, EventArgs e) { try { scon.Open(); scom.CommandText = "insert into bill values('" + txtName.Text + "','" +txtBillNo.Text + "','" +txtMCharge.Text + "','" +txtBCharge.Text + "','" +txtOCharge.Text + "','" +txtTBill.Text + "')"; scom.ExecuteNonQuery(); MessageBox.Show("Submitted successfully"); } catch (Exception ec) { MessageBox.Show(ec.Message); } finally { scon.Close(); } } private void btnNew_Click(object sender, EventArgs e) { txtTBill.Text = ""; txtOCharge.Text = ""; txtName.Text = ""; txtBCharge.Text = ""; txtBillNo.Text = ""; txtMCharge.Text = "";

} private void btnBack_Click(object sender, EventArgs e) { mf = new Main_Form(); this.Hide(); mf.Show(); } private void btnCancel_Click(object sender, EventArgs e) { Application.Exit(); } private void btnPrint_Click(object sender, EventArgs e) { this.Hide(); bp = new BillPrint(); bp.Show(); } } }

Bill Print form:

Codes for bill report form:


namespace Hospital_Management_System { public partial class BillPrint : Form { SqlCommand scom; SqlConnection scon; connectionString cs; DataTable dt; SqlDataAdapter sda; public BillPrint() { InitializeComponent(); cs = new connectionString(); } private void BillPrint_Load(object sender, EventArgs e) { scom = new SqlCommand(); scon = new SqlConnection(); scon.ConnectionString = cs.constring1(); dt = new DataTable(); string str = "select name,no,mcharge,bcharge,ocharge,total from bill"; try { scon.Open(); sda = new SqlDataAdapter(str, scon); sda.Fill(dt); billReport1.SetDataSource(dt); crystalReportViewer1.ReportSource = billReport1 ; } catch (Exception jj) { MessageBox.Show(jj.Message); } finally { scon.Close(); } } } }

Service tax form:

Codes for service tax form:


namespace Hospital_Management_System { public partial class Service_Tax : Form { SqlConnection scon; SqlCommand scom; Main_Form mf; connectionString cs; public Service_Tax() { InitializeComponent(); cs = new connectionString(); } private void Service_Tax_Load(object sender, EventArgs e) { scon = new SqlConnection(); scom = new SqlCommand(); scon.ConnectionString = cs.constring1(); scom.Connection = scon; } private void btnSubmit_Click(object sender, EventArgs e) { try { scon.Open(); scom.CommandText = "insert into servicetax values('" + txtIncome.Text + "','" + txtState.Text + "','" + txtcentral.Text + "','" + txtTotalTax.Text + "','" + txtTotal.Text + "')"; scom.ExecuteNonQuery(); MessageBox.Show("Submitted successfully"); } catch (Exception ec) { MessageBox.Show(ec.Source); } finally { scon.Close(); } } float income, central, state, percentage, payable; private void txtIncome_TextChanged(object sender, EventArgs e) { if (txtIncome.Text.Trim() != "") { income = float.Parse(txtIncome.Text); } else { MessageBox.Show("enter data"); }

private void txtState_TextChanged(object sender, EventArgs e) { if (txtState.Text.Trim() != "") { state = float.Parse(txtState.Text); p1 = (income * state) / 100; } else { MessageBox.Show("enter data"); } } float p1, p2, p3; private void txtcentral_TextChanged(object sender, EventArgs e) { if (txtcentral.Text.Trim() != "") { central = float.Parse(txtcentral.Text); p2 = (income * central) / 100; p3 = p1 + p2; txtTotalTax.Text = p3.ToString(); } else { MessageBox.Show("enter data"); } } private void txtTotal_TextChanged(object sender, EventArgs e) { } private void txtTotalTax_TextChanged(object sender, EventArgs e) { txtTotal.Text = (income - p3).ToString(); btnSubmit.Enabled = true; } private void btnBack_Click(object sender, EventArgs e) { mf = new Main_Form(); this.Hide(); mf.Show(); } private void btnCancel_Click(object sender, EventArgs e) { Application.Exit();

} private void btnCancel_Click_1(object sender, EventArgs e) { } private void btnBack_Click_1(object sender, EventArgs e) { }

} }

Electricity form:

Codes for electricity form:


namespace Hospital_Management_System { public partial class Electricity : Form { SqlConnection scon; SqlCommand scom; Main_Form mf; connectionString cs; public Electricity() { InitializeComponent(); cs = new connectionString(); } private void Electricity_Load(object sender, EventArgs e) { //btnSubmit.Enabled = false; for (int i = 200; i <= 2010; i++) { cbYear.Items.Add(i); } scon = new SqlConnection(); scom = new SqlCommand(); scon.ConnectionString = cs.constring1(); scom.Connection = scon; } float unit; float charge; private void btnSubmit_Click(object sender, EventArgs e) { try { scon.Open(); scom.CommandText = "insert into electricity values('" + cbMonth.Text + "','" + cbYear.Text + "','" + cbProvider.Text + "','" + txtPerUnitCharge.Text + "','" + txtUnitsConsumed.Text + "','" + txtMonthlyRental.Text + "','" + txtAmountPayable.Text + "')"; scom.ExecuteNonQuery(); MessageBox.Show("Submitted successfully"); } catch (Exception ec) { MessageBox.Show(ec.Source); } finally { scon.Close(); } } private void txtUnitsConsumed_TextChanged(object sender, EventArgs e)

{ if (txtUnitsConsumed.Text.Trim() != "") { unit = float.Parse(txtUnitsConsumed.Text); } else { MessageBox.Show("enter data"); } } float total; float rent; private void txtMonthlyRental_TextChanged(object sender, EventArgs e) { if (txtMonthlyRental.Text.Trim() != "") { rent = float.Parse(txtMonthlyRental.Text); total = (charge * unit) + rent; txtAmountPayable.Text = total.ToString(); btnSubmit.Enabled = true; } else { MessageBox.Show("enter data"); } } private void txtPerUnitCharge_TextChanged(object sender, EventArgs e) { if (txtPerUnitCharge.Text.Trim() != "") { charge = float.Parse(txtPerUnitCharge.Text); } } private void btnBack_Click(object sender, EventArgs e) { mf = new Main_Form(); this.Hide(); mf.Show(); } private void btnCancel_Click(object sender, EventArgs e) { Application.Exit(); } private void btnCancel_Click_1(object sender, EventArgs e) { }

} }

TESTING PROCEDURES

The testing is done to validate and verify the project. Verification means to check the system to ensure that it is doing what the faction is supposed to do validation means to ensure that system is doing what the user wants to do. So, we will test the system from both the aspects of user and of program.

Different types of testing that we will be doing are: 1. White box testing: when using white box testing, we are

involved directly with the structure of the code within a module or code segment. We draw a directed graph and use it to plan tests which adequately cover all the code in a given module. While definitions and descriptions they are not easy to accomplish. Code coverage is defined in terms of seven types: a. Segment coverage b. Branch coverage or node testing c. Compound condition coverage d. Basis path testing e. Data flow testing f. Path testing g. Loop testing 2. Black box testing: - this is done to see whether the outputs are the expected ones. This verifies that the s/we is generation the expected outputs with a given sets of inputs.

TESTING REPORTS

For configuring the status of testing procedure, first off all find the answers of following questions: -

1. Is it showing all data? 2. Is it deleting the required data? 3. Is it updating the required data? 4. is it store the important data in database 5. Is it worked properly?

Applying the given testing procedure, I find that the answer of given above question are in yes. So finally the all requirement of software development system and works properly.

BIBLOGRAPHY
Books consulted while designing this software are as follow.

For backend development Sql Server 2005: 1. Complete Reference 2. Database System 3. fundamental of database management

For front end development in C#: 1. .Net by sikkim manipal university 2. .net programming Black book 3. .net complete BPB publications

Websites:1. www.ondont.com/pub/ 2. www.programerseaven.com/articles/

Das könnte Ihnen auch gefallen