Hospital Management System .

Click here to load reader

description

Project Report on Hospital Management system .

Transcript of Hospital Management System .

Hospital Management System

Certificate

This is to certify that the project entitled___________________is successfully completed by Mr./Ms.______________________ as Per the syllabus & in partial fulfillment for the completion of BSc. degree in Computer Science of University of Mumbai,it is also to cetify that this is the original work of the candidate done during the academic year 2010-2011. Exam seat no.____________

Place Date.Rasayani.

____________ ____________________Guide Principal/HOD (Comp.Sc.)

_______________External Examinar

Hospital Management System

Certificate Date:Respected Sir , This is to certify that Mr. Namit R.Kadu student of TYCS of Pillais Collage of Arts,Commerce and Science,Rasayani 410207 affiliated to University of Mumbai was working on project Hospital Management System He had designed modules created database structure and the written code for system and generation of the report.The quality of work done by him is commendable.we are hopeful that the project will be of great help for us for our system with necessary customization.we appreciate the efforts in project by Namit R.Kadu.

Thanking You Yours Truly (For Manager)

PILLAIS HOCLArts, Commerce, Science CollegeRASAYANI VB.NET PROJECT REPORT ONHOSPITAL MANAGEMENT SYSTEMByMr. Namit R. Kadu. Under the Guidance OfProf. Mr. Abhijit Salvi.Submitted toUniversity of Mumbai 2010-2011DEPARTMENT OF COMPUTER SCIENCE

Acknowledgment

It is indeed a matter of great pleasure and proud privilege to be able to present this project on HOSPITAL MANAGEMENT SYSTEM. The completion of the project work is a milestone in student life and its execution is inevitable in the hands of guide. I am highly indebted the projects guide and our subject teacher Prof. Mr. Abhijit Salvi. His invaluable guidance and appreciation for giving form and substance to this report. It is due to her enduring efforts; patience and enthusiasm, which has given a sense of direction and purposefulness to this project and ultimately made it a success. I would like to tender our sincere thanks to the H.O.D. Prof. Ms.Ragita Nayar and all the teachers for their co-operation.I would also like to express our deep regards and gratitude to the Principal Mrs.Lata mam. I would like to thank Mr. Vivek Rege to allow me todevelop the Hospital management system for his the present system of the workshop. I would like to thank him for giving me all the information about the Entire Work.

I would wish to thank the non teaching staff and my friends who have helped me all the time in one way or the other.Really it is highly impossible to repay the dept of all the people who have directly or indirectly helped me for performing the project.INDEXSr. No.TopicPage No.

1. Preliminary Investigation4

a) Organizational Overview5

b) Description of System6

c) Limitations of present system 7

d) Proposed system & its advantages8

e) Feasibility Study10

f) Stakeholders13

g) Gantt Chart16

2. System Analysis17

a) Fact Finding Techniques18

b) Event Table19

c) Use Case Diagram20

d) ERD21

e) Activity Diagram22

f) Class Diagram 23

g) Object Diagram24

h) Sequence Diagram25

i) Collaboration Diagram26

j) State Diagram27

3. System Design28

a) Converting ERD to Tables29

b) Design Class Diagram30

c) Component Diagram31

d) Deployment Diagram32

e) System Flow chart33

f) Structure chart34

4. System Coding35

a) Menu Tree36

b) List of tables with attributes & constraints37

c) Program Description[Programs /classes & their responsibilities in brief] with naming conventions , Validations, Screen Layout & Report Layouts47

d) Validation145

e) TestCase,TestData and Test Result

5. System Implementation149

6. Future Enhancements150

7. Bibliography151

Chapter1Preliminary Investigation

1.Organizational Overview

An intelligent and effective use of available resources is the key to any successful venture. In this complex and competitive business world, it is planning, organization and well orchestral Coordination of these resources that matter the most. Human resources are the principle element in the whole gambit. However, a very scant attention is paid to its abundant availability. This coupled with corruptive practice is major stumbling block in smooth functioning of any organization. One of major finding of the research was the realization that a systematic approach to their requirement information was lacking in these organization due to variety of constraints. It was therefore felt that a professional approach to address this problem would provide some relief to the organization.

2.Description Of System

The present system of the Hospital Management is handled manually.

The system maintains all the records in registers. All the transactions made i.e. the bills,patient informations are recorded and stored with the paper work.

The information regarding all the Patient, Doctor, Staffmembers is stored in files. To check any detail about any one of them, we have to search number of papers.

Customer bill is calculated and maintained with paper work.

Information about Customer are stored in files. Records of imformations also stored as documents in files.

Also maintain Bill of the Patientt as well as maintain salary details of theStaff memberss. All the records maintain in manually. Whole data is stored in files.

3.Limitation of Present System

The manual system is not reliable that means a lot of mistake can occur. The manual system is not secure. Any manual error can lead to wrong result. More paper work Time consuming Difficulty in accessing data Data isolation Because data is scattered in various files, writing new application programs to retrieve the appropriate data is difficult.

4.Proposed System

The Proposed system is computerized and advanced Language. Therefore it gives more facilities than present System. It provides quick access to any data. In this system user have enter the data only once and then it automatically linked with all files. The reduces the workload of user and it is also saving process.

This system will provide our Staff with a database in which they can store all their important data such details of IpdBills,OpsBills and Patient informations.

The information about Patients Details and all Ipd,Opd Bill are kept safely in the memory of Computer. Hence, we can see it whenever we need.

Advantage Of Proposed System

All the information about Doctor, patient, and Bill will be maintain properly in this system. All manual calculation of Bill or all money management will be performed by the computer automatically.

This system will provide timely report for information.

The computer can hold amount of data in its storage device

The operation and speed of the computer is very high

Any difficulties we can solve easily

A database application can be stored in computer effectively.

It is very user friendly and easy to handle.

5.Feasibility Study

FRONTEND: - MICROSOFT VISUAL STUDIO 20081. First of all, VB.NET provides managed code execution that runs under the Common Language Runtime (CLR), resulting in robust, stable and secure applications. All features of the .NET framework are readily available in VB.NET.2. VB.NET is totally object oriented. This is a major addition that VB6 and other earlier releases didn't have.3. The .NET framework comes with ADO.NET, which follows the disconnected paradigm, i.e. once the required records are fetched the connection no longer exists. It also retrieves the records that are expected to be accessed in the immediate future. This enhances Scalability of the application to a great extent.4. VB.NET uses XML to transfer data between the various layers in the DNA Architecture i.e. data are passed as simple text strings.5. Error handling has changed in VB.NET. A new Try-Catch-Finally block has been introduced to handle errors and exceptions as a unit, allowing appropriate action to be taken at the place the error occurred thus discouraging the use of ON ERROR GOTO statement. This again credits to the maintainability of the code.6. Another great feature added to VB.NET is free threading against the VB single-threaded apartment feature. In many situations developers need spawning of a new thread to run as a background process and increase the usability of the application. VB.NET allows developers to spawn threads wherever they feel like, hence giving freedom and better control on the application.

7. Security has become more robust in VB.NET. In addition to the role-based security in VB6, VB.NET comes with a new security model, Code Access security. This security controls on what the code can access. For example you can set the security to a component such that the component cannot access the database. This type of security is important because it allows building components that can be trusted to various degrees.8. The CLR takes care of garbage collection i.e. the CLR releases resources as soon as an object is no more in use. This relieves the developer from thinking of ways to manage memory. CLR does this for them.

BACKEND: SQL SERVER 2000

IBM developed the original version of SQL, originally called Sequel, as part of the System R Project in the early 1970s. The Sequel language has evolved since then, and its name has changed to SQL (Structured Query Language).Many products now support the SQL language. SQL has clearly established itself as the standard relational database language.In 1986,the American Standards Institute (ANSI) and the International Organization for Standardization (ISO) published an SQL standard, called SQL-86.ANSI published an extended standard for SQL,SQL-89,in 1989.The next version of the standard was SQL-92 standard followed by SQL:1999;the most recent versions are SQL:2003 and then SQL:2005. The SQL language has several parts: Data-definition language (DDL): The SQL DDL providescommands for defining relation schemas, deleting relations, and modifying relation schemas.

Interactive data-manipulation language (DML):The SQL DML includes a query language based on both the relational algebra (2) and the tuple relational calculus (5).It includes also commands for specifying integrity constraints that the data stored in the database must satisfy. Updates that violate integrity constraints are disallowed.

View definition: The SQL DDL includes commands for defining views.

Transaction control: SQL includes commands for specifying the beginning and ending of transactions.

Embedded SQL and Dynamic SQL: Embedded and dynamic SQL define how SQL statements can be embedded within general-purpose programming languages, such as C, C++.Java, PL/I, COBOL, Pascal, and FORTRAN.

Authorization: The SQL DDL includes commands for specifying access rights to relations and views.

6. Stakeholders

Stakeholders are anyone who has an interest in the project. Project stakeholders are individuals and organizations that are actively involved in the project, or whose interests may be affected as a result of project execution or project completion. They may also exert influence over the projects objectives and outcomes. The project management team must identify the stakeholders, determine their requirements and expectations, and, to the extent possible, manage their influence in relation to the requirements to ensure a successful project.The following are examples of project stakeholders:1. Project DevelopersProject Developers is one who develops software for customer. In my project I am the first stakeholder i.e. Project Developer.2. Project customer Project Customer is one who pays for the developed software. In my project the Chairman of Rege Hospital is the second stakeholder i.e. Project Customer.

3 .Project Testers Project Testers are those who test the software. In my project myself, my project guide and Technical Department of TAPL are the fourth stakeholders i.e. Project Testers.

Software Specification

FRONTEND : Microsoft Visual Basic 8.0

BACKEND : Microsoft SQL Server-2000

OPERATING SYSTEM: Windows XP

1. Software SpecificationFront EndDOT NET

JDK1.6 Update 17

Back EndMICROSOFT SQL SERVER 2000

Database DriverJDBC THIN Driver

Operating systemWindows XP

1. Hardware SpecificationProcessorPentium IV

RAM512 MB

Free Hard Disk Space2 GB

NetworkLAN

Gnatt Chart

Start date Completion date

Preliminary investigation01/06/201027/06/2010

Project Finalization01/06/201014/06/2010

Investigation of system requirement14/06/201027/06/2010

System Analysis27/06/201012/08/2010

System Design12/08/201029/09/2010

Coding29/09/201005/12/2010

Interface Coding29/09/201030/10/2010

Database Connectivity30/10/201020/11/2010

Validation Coding20/11/201027/11/2010

Report Coding27/11/201005/12/2010

Implementation05/12/201001/01/2011

Developer Testing05/12/201015/12/2010

Client Testing15/12/201022/12/2010

User Testing22/12/201029/12/2010

Project Delivery29/12/201001/01/2011

Project Report Submission15/01/2011

Project Report Hard Copy Checking

Project Submission15/01/2011

2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 week

Chapter2 System Analysis

1.Fact Finding IntroductionThe Current System is the manual one, hence is not speedy, accurate, efficient as well as time consuming. An essential part of the system analysis, which enables the developer to understand & the system correctly. It is undertaken to obtain details of the system. To understand the physical flow of the information through the current system. Collect various information through various fact finding techniques. Identify the procedural difficulties experienced by the user. Study the bottlenecks find out the redundant work being performed in the system.

Fact Finding Techniques Employed

1. InterviewsInformation was obtained from the employees at the organization by interviewing them at the location and time convention both.

2. Document SearchingAn extensive study of existing document an official correspondence was done to understand the present working status of organization.

2. Event TableEventTriggerSourceActivityResponseDestination

Patient(OPD)ArrivalPatient Is illPatient(OPD)PatientArrivingetHospitalPatientArrived Hospital

Get an appointmentVisit to Recipient Patient(OPD)Getting appointmentVisit to DoctorRecipient

Doctor treats the patient (OPD)Patient is appointedPatient(OPD)TreatmentPatient CheckedDoctor

Patient (OPD) pay billDoctor generate billPatient(OPD)Paying bill DoctorBill payedDoctor

IPD patient all the operation form Visit to recipient Patient(IPD)Filling form Form filled Recipient

Doctor treats patient IPDPatient is appointedPatient(PID)TreatmentPatient checkedDoctor

Doctor provides prescriptionDoctor advice PatientDoctorProviding Medicine Medicine provided to patientPatient(IPD)

Patient ask for discharge Patient feel wellDoctorAdvisingPatient get dischargePatient(IPD)

Patient IPD get dischargePatient pay billPatient(IPD)Taking dischargePatient dischargeHospital

3.Use Case Diagram

Give information & case paper Take Case Paper Enquiry Entry

Set Appointment

Fill Case Paper

Take Treatment PatientRecepient

Give Treatment

Take Medicine

Give Medicine

Take Discharge

Give Discharge

Doctor Generate Bill

Pay Bill

Take Bill.Entity-Relationship System

Appointment Bill Patient

Doctor

OPD

Treatment

Discharge IPD Ward

5.Activity Diagram

IPD Bill payment OPD Bill payment YES YES NOReport generationDischarge of patient Admit the patientTreatment & AdviceCheck if IPD patient Appointment Enquiry

Doctor D_id D_name D_add Check() Treatment()6.Class Diagram

BillB_idP_idDetails()EmployeeE_idE_nameDetails()Work()

Patient P_idP_nameP_add Visit()Pay bill()

HospitalH_idH_nameH_add

IPDIP_idIP_nameIP_addVisit()Pay bill() OPDOP_idOP_nameOP_addVisit()Pay bill()

Reports R_idR_check() Room R_id P_idR_details()

Special S_id P_id S_details() General G_id P_idG_details()

7.Object Diagram

Employee1AbhiMohopadaWork()Doctor 1 Sandesh Kharghar Mbbs Check()Treatment()

Patient 1PankajTurade Visit()Pay bill()

Hospital1Rege HospitalH_add

Bill1112PankajNurse ChargeWard chargeDetails()

OPD11sandyCoughingVisit()Pay bill()

IPD14amolPanvelFractureVisit()Pay bill() Room 1 12R_details() Reports 1 Patient Report R_check()

Special 1 1 S_details() General 1 1 G_details()

8.Sequence Diagram

:Appointment:PatientInfo

Patient Request For Register

Gets patientid

Request For Appoinment

Sequence Diagram For Patient registration&Appointment

:Bill:Ward:Treatment:Doctor:Appointment:PatientInfo

Request forAppointment check for availability Doctor Diagnosis Appointment no If available If Required Admit

Case Paper Discharge Discharge

Request Bill

Generate Bill

Sequence Diagrame For Patient Treatment & Bill9.Collaboration Diagram

Recipient Patient OPD Patient IPD1:Enquiry2:Take case paper

10:Take Operation From 4:Set Appointment 11:Fill the3:Fill case paper operation form

12: Doctor treats patient 6: Patient saying bill problem 13:Doctor provide preparation 14.patient9: Pay bill ask for Discharge

16: Give discharge to patient ask for 17: Pay

Doctor5: Enquiry About health 7: Treat Patient8: Give Medicine & Advice

15:Check Patient 10.State Diagram

Patient RegistrationCheck Registration Patient_info.

Treatment

Patient Bill Ward For Registration of PatientRquest_admitBed_allocationDischarge

Chapter 3 System Design

1. Converting ERD to Tables

Table No. Table NameDescription

1 Department This table contains details of Department.

2Doctor DetailsThis table contains details of Doctor.

3Ward DetailsThis table contains details of Ward.

4Medicine Detail This table contains details of Medicines.

5 Staff DetailsThis table contains detailsAbout Staff.

6Bill This table contains all Patient Bills

7Patient Details This table contains details of Patient

8Opd BillThis Table Contain All Opd Bill

9Ipd DetailsThis Table Contain all Ipd details

10Ipd BillThis Table Contain all Ipd Bill

11Ipd TestThis Table Contain all Ipd Test

12Operation DetailsThis Table Contain all Operation Details

13Discharge DetailsThis Table Contain all Discharge Details

3.Component Diagram

Registration.vb

Admit .vb

Hospital Management System Discharge .vb

Test.vb

Bill.vb

4.Package Diagram

Master

Reportment detailsWard DetailsDoctor Details

Patient Details

Staff Details

Medicine Details Hospital Management System

Transaction

OPD prescription bill IPD Bill

IPD Treatment IPD Report

Discharge Details

5.Deployment Diagram

Registration.vbTest.vbTest.vb

Hospital Management System

Bill.vbAdmit.vb

Admit .vb

Discharge.vb

Local Area Network

Printer Printer

PrinterHUBPrinterHUB

6.System Flow Charts

MaintainDoctorDetails Doctor

EmployeeReport

MaintainEmployeeDetailsEmployee

HospitalManagamentSystem PatientMaintainPatientDetails

PatientReport

Test

MaintainTestDetailsTestReport

MaitainRoomDetails Room

7.Structure Chart

7.Structure Chart

HospitalManagementSystem

BillRoomEmployeeDoctorPatient

Get DetailsPut DetailsGet DetailsPut Details

Get DetailsPut Details

Put DetailsGet Details

Patient DetailsTest Details

Chapter 4System Coding

1.Menu Tree

Department

ExitHelpAbout UsOpdBillDoctorMASTER

Ward

Medicine

Staff

Patient

Entry

MDI Form

IpdInfo

IpdBill

Medicine rpt

Reports

IpdPatient rpt

Discharge rpt

Ipd Test rpt

CalculatorUtility

2.Program List

NOFORM NAMEPURPOSE

1Loginform.vbThis form is used for security with the help of password

2frmsplash.vbThis form display the title of system name of organization & copyright of the system

3MdIForm1.vbThis is the multiple document interface for the all of the form in the project

4Department Detail.vbThis form is use for store the Department information

5Doctor Detail.vbThis form is use for store the Doctor information

6Ward Details.vbThis form is use to the Ward information

7Medicine Detail .vbThis form is use to Store the Medicine Information

8Staff details.vbThis form is use for Store Staff Information

9PatientDetailsl.vbThis form is use for Store Patient Information

10OpdBill.vbThis form is use for Store Opd Bill Information

11IpdInfo.vbThis form is use for Store Ipd Information

12IpdBill.vbThis form is use for Store Ipd Bill Information

3.Table Used

Table NoTable NameDescriptionFields

1.DepartmentThis table maintains information about the Department.Dept id ,Dept Name,Dept Description .

2.DoctorThis table maintains information Of Doctor.Docid,DocName,Address,Phno,MobilenoQualification,

3.WardThis table maintains information about Ward Details Wardid,ward name,WardType,Phno,mobile no

4.Medicine_DetailThis table maintains information about the Medicine

Medicinename,MedicineCode,Dossage,Duration

5.StaffdetailsThis table maintains information about the StaffMemberStaffid,Staffname,address,Designation

6. IpdbillThis table maintains information about the IpdbillIpdid ,IpdName,OperationCharges,NurseCharges

Maintenance Table

1. Table name:-Department Details Description: it provides information about the Department DetailsSr.No. Field Name Data type Description

1Dept_idintegerStores the Departmentdetails

2Dept_nameVarcharStores the Dept Name

3Dept_DiscriptionVarcharStores the infprmation Of Depat Deiscription

2. Table name:Doctor Details Description: it provides information about the Doctors Details.

Sr.No. Field Name Data type Description

1Dept_IDintegerStores the Department details

2Doc_IDVarcharStores the Doc id

3DocFNameVarcharStores the Doc First name

4DocMNameVarcharStore the Doc Middle name

5DocLNameVarcharStore the last name

6DocAddressVarcharStore the Doc Address

7DocHPhoneintegerStore the Doc Phno

8DocEmail_idVarcharStore the Doc Email Address

9QualificationVarcharStore the Doc Qualification

3. Table name:Patient Details Description: it provides information about the Patient Details

Sr.No. Field Name Data type Description

1Doc_IDintegerStores the Doc id

2Form_NointegerStores the Form_no

3PFNameVarcharStores the Patient First name

4PMNameVarcharStore the Middle name

5PLNameVarcharStore the last name

6PAddressVarcharStore the Patient Address

7PResPhoneintegerStore the Patient Phno

8PMobileintegerStore the patient mobile no

9PAgeintegerStore the Patient Age

10DOBDate/TimeStore the patient Date of birth

11PGenderVarcharStore the patient Gender

12DiagonosisVarcharStore the Information about patient Diagonosis

4. Table name:Ward Details Description: it provides information about the Ward Details

Sr.No. Field Name Data type Description

1Ward_nointegerStores theWard id

2Ward_typeVarcharStores the WardType

3Ward_InchargeVarcharStores the Ward Incharge information

4Ward_LocationVarcharStores the ward location information

5Avail_BedsintegerStores the information about available bed

6Ward_ChargesintegerStores the wards Charges

5. Table name :Medicine Details Description: it provides information about the Medicine DetailsSr.No. Field Name Data type Description

1Medicine_CodeintegerStores theMedicine Code

2Medicine_NameVarcharStores the Medicine Name

3Manufacturing_DateDate/timeStores the medicine Manufacturing Date

4Expiry_DateDate/timeStores the medicine Expiry Date

5QuantityintegerStores the information about Medicine Quantity

6RateintegerStores the Medicine Rate

Sr.No. Field Name Data type Description

1Ward_nointegerStores theWard id

2Ward_typeVarcharStores the WardType

3Ward_InchargeVarcharStores the Ward Incharge information

4Ward_LocationVarcharStores the ward location information

5Avail_BedsintegerStores the information about available bed

6Ward_ChargesintegerStores the wards Charges

6. Table name :Staff Details Description: it provides information about the Staff DetailsSr.No. Field Name Data type Description

1StaffidintegerStores the Staffid

2StaffnameVarcharStores the Staffname

3Staff AddresVarcharStores the StaffAddress

4StaffDesignationVarcharStores the information AboutStaffDesignation

5StaffGenderVarcharStores the information about Staff Gender

6StaffMobilenointegerStores the StaffMobileNo

7. Table name :Opd Priscription Bill Description: it provides information about the OpdBillSr.No. Field Name Data type Description

1Form_NointegerStores the Formno

2OPD_IDVarcharStores the Opdid

3nextvisitDateDate/TimeStores the Patient NextVisitDate

4Date1Date/TimeStores the information AboutPatientTreatment date

5Medicine_NameVarcharStores the information about medicine name

6DossageintegerStores the patients Dossageinformation

7DurationintegerStores the patients Durationinformation

8. Table name :IPDDetails Description: it provides information about the IpdDetails

Sr.No. Field Name Data type Description

1Form_NointegerStores the Form no

2IPD_IDintegerStores the Information about IpdId

3IPD_DiagnosisVarcharStores the Patient Diagnosis Information

4Blood_GroupVarcharStore the Patient BloodGroup

5Ward_NoVarcharStore the ward no

6Admitted_DateVarcharStore the Patient Admitted date

9. Table name :IPDTest Description: it provides information about the IpdTest

Sr.No. Field Name Data type Description

1IPD_IDintegerStores the Ipd_id

2TemperatureintegerStores the Information about patient Temprature

3HbintegerStores the Information about patient Hb

4Blood_SugarintegerStores the Information about patient BloodSugar

5Blood_UreaintegerStores the Information about patient BloodUrea

6BPVarcharStores the Information about patient BP

7PulseintegerStores the Information about patient Pulse

8HIVVarcharStores the Information about patient HIV Test

9SonographyVarcharStores the Information about patient Sonography

10. Table name :IPDBill Description: it provides information about the IpdBill

Sr.No. Field Name Data type Description

1IPD_IDintegerStores the Ipd_id

2Bill_nointegerStores the Billno

3Ward_ChargesintegerStores the Information about Ward Charges

4Nursing_ChargesintegerStores the Information about Nursing Charges

5Visit_ChargesintegerStores the Information about Visit Charges

6Dilivary_ChargesintegerStores the Information about Dilivary Charges

7Lense_ChargesintegerStores the Information about Lense Charges

8Other_ChargesintegerStores the Information about Other Charges

9TaxintegerStores the Information about Tax

10Total_BillintegerStores the Information about TotalBill

11Payment_TypeVarcharStores the Information about Payment_type

12Payment_DateDate/TimeStores the Information about Payment_Date

Report ListNO.REPORT NAMEPURPOSE

1 IpdPatient.rptThis report is use for to print and show the detail of the Patient

2 IpdTest.rptThis report is use for to print & show the detail report of the IpdTest

3 MedicineDet.rptThis report is use for to print & Show the detail report ofMedicine Details

4 IpdBill.rptThis report is use for to print and show the report from thePatients Entire Bill.

5

IpdDischarge.rptThis report is use for to print and show the report from the Patient Discharge.

NAMING CONVENTIONS

Object NamePrefix

Text boxtxt

Labellbl

Formfrm

Combo boxcmb

Option Buttonopt

Command Buttoncmd

RadioButtonrdb

Program Description with naming conventions

Program ID: Login

Program Function: This is form is used to Login in the system.

CODE:- Imports System.Data.SqlClient Public Class login Inherits System.Windows.Forms.FormDim str, s1, s2 As String Dim i As Integer

Private Sub btnChpass_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnChpass.Click Dim objchPass As New changePassword objchPass.Show() Me.Hide()

End Sub

Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click If MessageBox.Show("Do want to exit ? ", "Login", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then End End If End Sub

Private Sub btnOK_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnOK.Click

str = "select * from LOGIN where Username='" & txtname.Text & "'and PASSWORD='" & txtPwd.Text & "'" objcon.Open() objCommand = New SqlCommand(str, objcon) dr = objCommand.ExecuteReader()

While dr.Read() uname = dr(3) pas = dr(1) role = dr(3) End While

objcon.Close() If uname = "" And pas = "" Then MessageBox.Show("InValid User", "Login Failed", MessageBoxButtons.OK, MessageBoxIcon.Exclamation) txtPwd.Clear() txtname.Focus() i = i + 1 Else MessageBox.Show("Welcome! Valid user", "Login Success", MessageBoxButtons.OK, MessageBoxIcon.Exclamation) txtPwd.Clear() Me.Hide() Dim objsplash As New SplashScreen objsplash.Show() End If If i >= 3 Then MessageBox.Show("Password is not correct", "Last Try", MessageBoxButtons.OK, MessageBoxIcon.Exclamation) End End If

End Sub

Private Sub login_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub

Private Sub txtname_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtname.TextChanged

End SubEnd Class

CODE:-Public Class SplashScreen Inherits System.Windows.Forms.FormSub progressbar() pgBar1.Value = pgBar1.Value + 5 If pgBar1.Value = 500 Then pgBar1.Value = 0 Timer1.Enabled = False Me.Hide() Dim objmdi As New MDI objmdi.Show() End If End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick progressbar() End Sub

CODE:-Public Class MDI Inherits System.Windows.Forms.FormPrivate Sub mnuDepartment_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuDepartment.Click Dim objDept As New frmDepartment objDept.MdiParent = Me objDept.Show() End SubPrivate Sub mnuDoctor_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuDoctor.Click Dim objDoc As New frmDoctorDetails objDoc.MdiParent = Me objDoc.Show()End SubPrivate Sub mnuWard_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuWard.Click Dim objWard As New frmwardDeatils objWard.MdiParent = Me objWard.Show() End SubPrivate Sub mnuStaffDetails_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnumedicine.Click Dim objstaff As New StaffDetails objstaff.MdiParent = Me objstaff.Show() End Sub Private Sub mnuPatient_Info_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuPatient_Info.Click MessageBox.Show(role) If Trim(role) = "admin" Then Dim objPat As New frmPatientDetails objPat.MdiParent = Me objPat.Show() Else MessageBox.Show("error") End IfEnd Sub Private Sub mnuOPD_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuOPD.Click MessageBox.Show(role) If Trim(role) = "admin" Then Dim objOPD As New frmOPDPrescrition objOPD.MdiParent = Me objOPD.Show() Else MessageBox.Show("error") End If End SubPrivate Sub mnuIPDDetails_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuIPDDetails.Click MessageBox.Show(role) If Trim(role) = "admin" Then Dim objIPD As New IPD_Info objIPD.MdiParent = Me objIPD.Show() Else MessageBox.Show("error") End IfEnd SubPrivate Sub mnuDischarge_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuDischarge.Click Dim objDischarge As New IPD_DischargeDetails objDischarge.MdiParent = Me objDischarge.Show() End SubPrivate Sub mnuIPDBill_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuIPDBill.Click MessageBox.Show(role) If Trim(role) = "admin" Then Dim objBill As New IPD_BILL objBill.MdiParent = Me objBill.Show() Else MessageBox.Show("error") End IfEnd SubPrivate Sub mnuCalculator_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuCalculator.Click Shell("C:\Windows\system32\calc.exe", AppWinStyle.NormalFocus) End Sub Private Sub mnuExit_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuExit.Click If MessageBox.Show("Do you want to Exit ?", "Anand Mangal", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then End End If End Sub Private Sub mnuSEARCH_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuSEARCH.Click Dim objS As New Search objS.MdiParent = Me objS.Show() End Sub Private Sub MenuItem7_Click(ByVal sender As System.Object, ByVal e As system.EventArgs) Handles MenuIPDbillReport.Click Dim objipdbillrep As New Form2 objipdbillrep.MdiParent = Me objipdbillrep.Show() End SubPrivate Sub Menuipdtestreport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Menuipdtestreport.Click Dim objtest As New IpdTestReport objtest.MdiParent = Me objtest.Show()End Sub Private Sub MenuipdmediReport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuipdmediReport.Click Dim objmed As New IPD_Medicine_Report objmed.MdiParent = Me objmed.Show() End Sub

Private Sub MenuipddischReport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuipddischReport.Click Dim objDischa As New IPD_Discharge_Report objDischa.MdiParent = Me objDischa.Show() End Sub Private Sub MenuPatientreport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuPatientreport.Click Dim objpatientrepo As New IPD_Patient_Report objpatientrepo.MdiParent = Me objpatientrepo.Show() End Sub Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem2.Click Dim objMed As New frmMedicalDetails objMed.MdiParent = Me objMed.Show() End SubEnd Class

Program ID: Department

Program Function: This is form is used to give the information about Department.Form layout:

Pseudo Code:

Sr. No.Name ProcedureDescription

1Btn_FirstClickDisplay First Record.

2Btn_Previous ClickDisplay Previous Record.

3Btn_NextClickDisplay Next record.

4Btn_LastClickDisplay Last Record.

5Btn_Add ClickAdds the new record.

6Btn_SaveClickSaves the record.

7Btn_ DeleteClickDelete the record

8Btn_UpdateClickUpdate the record

9Btn_ExitClickClose the form

Test result:-

CODE:-

Public Class frmDepartment Inherits System.Windows.Forms.FormDim Q As String = "Select * from Department"

Private Sub BindFields() BindClear(grpDept) txtDeptID.DataBindings.Add("text", dv, "Dept_ID") txtDeptName.DataBindings.Add("text", dv, "Dept_Name") txtDeptDescript.DataBindings.Add("text", dv, "Dept_Description") End Sub

Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click exiting("Department", Me) End Sub

Private Sub btnUpdate_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUpdate.Click If btnUpdate.Text = "&UPDATE" Then EnableDisableButtons(False, Me) btnUpdate.Enabled = True EnableDisableControls(True, grpDept) txtDeptID.Enabled = False btnUpdate.Text = "MODIFY" Else If btnUpdate.Text = "MODIFY" Then s1 = "update Department SET Dept_Name='" & txtDeptName.Text & "',Dept_Description='" & txtDeptDescript.Text & "'where Dept_ID='" & Val(txtDeptID.Text) & "'" Opt(btnUpdate, s1, "Updated", Me, "Department", Q) BindFields() EnableDisableControls(False, grpDept) btnUpdate.Text = "&UPDATE" EnableDisableButtons(True, Me) btnSave.Enabled = False End If End If End Sub

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load fills("Department", Me, Q) BindFields() EnableDisableControls(False, grpDept) btnSave.Enabled = False End Sub

Private Sub btnFirst_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFirst.Click nav(btnFirst, cur) End Sub

Private Sub btnPrevious_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrevious.Click nav(btnPrevious, cur) End Sub

Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNext.Click nav(btnNext, cur) End Sub

Private Sub btnLast_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLast.Click nav(btnLast, cur) End Sub

Private Sub btnDelete_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnDelete.Click EnableDisableControls(True, grpDept) EnableDisableButtons(False, Me) btnDelete.Enabled = True s1 = "Delete from Department where Dept_ID='" & Val(txtDeptID.Text) & "'" Opt(btnDelete, s1, "Deleted", Me, "Department", Q) BindFields() EnableDisableButtons(True, Me) btnSave.Enabled = False EnableDisableControls(False, grpDept) End Sub

Private Sub btnAddnew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddnew.Click If btnAddnew.Text = "&ADD" Then EnableDisableControls(True, grpDept) txtDeptID.Enabled = False EnableDisableButtons(False, Me) btnAddnew.Enabled = True btnSave.Enabled = True btnAddnew.Text = "&Cancel" cur.Position = cur.Count - 1 i = Val(txtDeptID.Text) + 1 Clear(grpDept) txtDeptID.Text = i txtDeptName.Focus() ElseIf btnAddnew.Text = "&Cancel" Then If MessageBox.Show("Are you sure you want to Cancel ?", "Record", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then s1 = "Delete from Department where Dept_ID='" & Val(txtDeptID.Text) & "'" fills("Department", Me, Q) BindFields() End If EnableDisableButtons(True, Me) btnSave.Enabled = False EnableDisableControls(False, grpDept) btnAddnew.Text = "&ADD" End If End Sub

Private Sub btnSave_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click s1 = "insert into Department values('" & CInt(txtDeptID.Text) & "','" & txtDeptName.Text & "','" & txtDeptDescript.Text & "')" Opt(btnSave, s1, "Save Successfully.", Me, "Department", Q) 'BindFields() btnAddnew.Text = "&ADD" EnableDisableButtons(True, Me) EnableDisableControls(False, grpDept) btnSave.Enabled = False End Sub Private Sub txtDeptName_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtDeptName.KeyPress CharValidation(txtDeptName, e) End Sub

Private Sub txtDeptDescript_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtDeptDescript.KeyPress CharValidation(txtDeptDescript, e) End Sub

Private Sub Label3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label3.Click

End SubEnd Class

Program ID: Doctor Details

Program Function: This is form is used to give the information about Doctors.Form layout:

Pseudo Code:

Sr. No.Name ProcedureDescription

1Btn_FirstClickDisplay First Record.

2Btn_Previous ClickDisplay Previous Record.

3Btn_NextClickDisplay Next record.

4Btn_LastClickDisplay Last Record.

5Btn_Add ClickAdds the new record.

6Btn_SaveClickSaves the record.

7Btn_ DeleteClickDelete the record

8Btn_UpdateClickUpdate the record

9Btn_ExitClickClose the form

Test result:-

CODE:-

Imports System.Data.SqlClientPublic Class frmDoctorDetails Inherits System.Windows.Forms.FormDim Q As String = "SELECT Department.Dept_ID ,Department.Dept_Name,Doc_ID,DocFName, DocMName,DocLName,DocAddress,DocHPhone,DocMobile,Docfax_no,DocEmail_id,Qualification FROM Department JOIN Doctor_Info ON Department.Dept_ID=Doctor_Info.Dept_ID " Dim Strcbo As String = "select Dept_ID,Dept_Name from Department ORDER BY Dept_Name"

Private Sub BindFields() BindClear(grpDoctor) BindClear(grpContact) cboDeptname.DataBindings.Add("text", dv, "Dept_Name") txtDeptID.DataBindings.Add("text", dv, "Dept_ID") txtDocID.DataBindings.Add("text", dv, "Doc_ID") txtFN.DataBindings.Add("text", dv, "DocFName") txtMN.DataBindings.Add("text", dv, "DocMName") txtLN.DataBindings.Add("text", dv, "DocLName") txtAddress.DataBindings.Add("text", dv, "DocAddress") txtQualification.DataBindings.Add("text", dv, "Qualification") txtPhone.DataBindings.Add("text", dv, "DocHPhone") txtMobile.DataBindings.Add("text", dv, "DocMobile") txtFax.DataBindings.Add("text", dv, "Docfax_no") txtemail.DataBindings.Add("text", dv, "DocEmail_id") End Sub Private Sub btnUpdate_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUpdate.Click If btnUpdate.Text = "&UPDATE" Then EnableDisableButtons(False, Me) btnUpdate.Enabled = True EnableDisableControls(True, grpDoctor) txtDeptID.Enabled = False txtDocID.Enabled = False EnableDisableControls(True, grpContact) btnUpdate.Text = "MODIFY" Else If btnUpdate.Text = "MODIFY" Then s1 = "update Doctor_Info SET Doc_ID='" & txtDocID.Text & "',DocFName='" & txtFN.Text & "' ,DocMName='" & txtMN.Text & "',DocLName='" & txtLN.Text & "',DocAddress='" & txtAddress.Text & "' ,Qualification='" & txtQualification.Text & "',DocHPhone='" & txtPhone.Text & "' ,DocMobile='" & txtMobile.Text & "',Docfax_no='" & txtFax.Text & "',DocEmail_id='" & txtemail.Text & "' WHERE Dept_ID='" & Val(txtDeptID.Text) & "'" Opt(btnUpdate, s1, "Updated", Me, "Doctor_Info", Q) BindFields() EnableDisableControls(False, grpDoctor) EnableDisableControls(False, grpContact) btnUpdate.Text = "&UPDATE" EnableDisableButtons(True, Me) btnSave.Enabled = False End If End If End Sub

Public Sub FillComboBox() Try objCommand = New SqlCommand(Strcbo, objcon) objcon.Open() dr = objCommand.ExecuteReader While (dr.Read()) cboDeptname.Items.Add(dr.Item(1)) arrlist.Add(dr.Item(0)) End While objcon.Close() dr.Close() Catch ex As Exception MsgBox(ex.Message) End Try End Sub Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load FillComboBox() fills("Doctor_Info", Me, Q) BindFields() EnableDisableControls(False, grpDoctor) EnableDisableControls(False, grpContact) btnSave.Enabled = False End Sub

Private Sub btnDelete_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnDelete.Click EnableDisableControls(True, grpDoctor) EnableDisableControls(True, grpContact) EnableDisableButtons(False, Me) btnDelete.Enabled = True s1 = "Delete from Doctor_Info where Doc_ID='" & Val(txtDocID.Text) & "'" Opt(btnDelete, s1, "Deleted", Me, "Doctor_Info", Q) BindFields() EnableDisableButtons(True, Me) EnableDisableControls(False, grpDoctor) EnableDisableControls(False, grpContact) btnSave.Enabled = False End Sub

Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click exiting("Doctor_Info", Me) End Sub

Private Sub cboDeptname_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboDeptname.SelectedIndexChanged i = cboDeptname.SelectedIndex txtDeptID.Text = arrlist(i) End Sub

Private Sub btnAddnew_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAddnew.Click If btnAddnew.Text = "&ADD" Then EnableDisableControls(True, grpDoctor) EnableDisableControls(True, grpContact) txtDocID.Enabled = False txtDeptID.Enabled = False EnableDisableButtons(False, Me) btnAddnew.Enabled = True btnSave.Enabled = True btnAddnew.Text = "&Cancel" cur.Position = cur.Count - 1 i = Val(txtDocID.Text) + 1 Clear(grpDoctor) Clear(grpContact) txtDocID.Text = i ElseIf btnAddnew.Text = "&Cancel" Then If MessageBox.Show("Are you sure you want to Cancel ?", "Record", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then s1 = "Delete from Doctor_Info where Doc_ID='" & Val(txtDocID.Text) & "'" fills("Doctor_Info", Me, Q) BindFields() End If EnableDisableButtons(True, Me) btnSave.Enabled = False EnableDisableControls(False, grpDoctor) EnableDisableControls(False, grpContact) btnAddnew.Text = "&ADD" End If End Sub

Private Sub btnSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSave.Click If txtDeptID.Text = "" Then MessageBox.Show("Select appropriate Department Name", "Invalid", MessageBoxButtons.OK, MessageBoxIcon.Information) cboDeptname.Focus() Else s1 = "insert into Doctor_Info values('" & CInt(txtDeptID.Text) & "','" & CInt(txtDocID.Text) & "','" & txtFN.Text & "','" & txtMN.Text & "','" & txtLN.Text & "','" & txtAddress.Text & "','" & CInt(txtPhone.Text) & "','" & (txtMobile.Text) & "','" & CInt(txtFax.Text) & "','" & txtemail.Text & "','" & txtQualification.Text & "')" Opt(btnSave, s1, "Saved Successfully", Me, "Doctor_Info", Q) BindFields() btnAddnew.Text = "&ADD" EnableDisableControls(False, grpDoctor) EnableDisableControls(False, grpContact) EnableDisableButtons(True, Me) btnSave.Enabled = False End If End Sub

Private Sub txtFN_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtFN.KeyPress CharValidation(txtFN, e) End Sub

Private Sub txtLN_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtLN.KeyPress CharValidation(txtLN, e) End Sub

Private Sub txtMN_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtMN.KeyPress CharValidation(txtMN, e) End Sub

Private Sub txtMobile_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtMobile.KeyPress numValidation(txtMobile, e) End Sub

Private Sub txtFax_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtFax.KeyPress numValidation(txtFax, e) End Sub

Private Sub btnFirst_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFirst.Click nav(btnFirst, cur) End Sub

Private Sub btnPrevious_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrevious.Click nav(btnPrevious, cur) End Sub

Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNext.Click nav(btnNext, cur) End Sub

Private Sub btnLast_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLast.Click nav(btnLast, cur) End Sub

Private Sub txtPhone_KeyPress1(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtPhone.KeyPress numValidation(txtPhone, e) End Sub

Private Sub txtMobile_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtMobile.LostFocus phoneValidation(txtMobile) End Sub

Private Sub txtPhone_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtPhone.LostFocus phoneValidation(txtPhone) End Sub

End Class

Program ID: Ward Details

Program Function: This is form is used to give the information about Department.Form layout:

Pseudo Code:

Sr. No.Name ProcedureDescription

1Btn_FirstClickDisplay First Record.

2Btn_Previous ClickDisplay Previous Record.

3Btn_NextClickDisplay Next record.

4Btn_LastClickDisplay Last Record.

5Btn_Add ClickAdds the new record.

6Btn_SaveClickSaves the record.

7Btn_ DeleteClickDelete the record

8Btn_UpdateClickUpdate the record

9Btn_ExitClickClose the form

Test result:-

CODE:-Public Class frmwardDeatils Inherits System.Windows.Forms.FormDim Q As String = "SELECT * from Ward_Details"

Private Sub BindFields() BindClear(grpWard) txtWno.DataBindings.Add("text", dv, "Ward_No") cboWtype.DataBindings.Add("text", dv, "Ward_Type") txtWincharge.DataBindings.Add("text", dv, "Ward_Incharge") cboWl.DataBindings.Add("text", dv, "Ward_Location") txtAvailBeds.DataBindings.Add("text", dv, "Avail_Beds") txtWc.DataBindings.Add("text", dv, "Ward_Charges") End Sub Private Sub btnUpdate_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUpdate.Click If btnUpdate.Text = "&UPDATE" Then EnableDisableButtons(False, Me) btnUpdate.Enabled = True EnableDisableControls(True, grpWard) txtWno.Enabled = False btnUpdate.Text = "MODIFY" Else If btnUpdate.Text = "MODIFY" Then s1 = "update Ward_Details SET Ward_Type='" & cboWtype.Text & "' ,Ward_Incharge='" & txtWincharge.Text & "',Ward_Location='" & cboWl.Text & "',Avail_Beds='" & txtAvailBeds.Text & "',Ward_Charges='" & txtWc.Text & "'where Ward_No='" & CInt(txtWno.Text) & "'" Opt(btnUpdate, s1, "Updated", Me, "Ward_Details", Q) BindFields() EnableDisableControls(False, grpWard) btnUpdate.Text = "&UPDATE" EnableDisableButtons(True, Me) btnSave.Enabled = False End If End If End Sub

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load fills("Ward_Details", Me, Q) BindFields() EnableDisableControls(False, grpWard) btnSave.Enabled = False End Sub

Private Sub btnFirst_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnFirst.Click nav(btnFirst, cur) End Sub

Private Sub btnLast_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnLast.Click nav(btnLast, cur) End Sub

Private Sub btnPrevious_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnPrevious.Click nav(btnPrevious, cur) End Sub

Private Sub btnNext_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnNext.Click nav(btnNext, cur) End Sub

Private Sub btnDelete_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnDelete.Click EnableDisableControls(True, grpWard) EnableDisableButtons(False, Me) btnDelete.Enabled = True s1 = "Delete from Ward_Details where Ward_No='" & Val(txtWno.Text) & "'" Opt(btnDelete, s1, "Deleted", Me, "Ward_Details", Q) BindFields() EnableDisableButtons(True, Me) btnSave.Enabled = False EnableDisableControls(False, grpWard) End Sub

Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click exiting("Ward Details", Me) End Sub

Private Sub btnAddnew_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddnew.Click If btnAddnew.Text = "&ADD" Then EnableDisableControls(True, grpWard) txtWno.Enabled = False EnableDisableButtons(False, Me) btnAddnew.Enabled = True btnSave.Enabled = True btnAddnew.Text = "&Cancel" cur.Position = cur.Count - 1 i = Val(txtWno.Text) + 1 Clear(grpWard) txtWno.Text = i ElseIf btnAddnew.Text = "&Cancel" Then If MessageBox.Show("Are you sure you want to Cancel ?", "Record", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then s1 = "Delete from Ward_Details where Ward_No='" & Val(txtWno.Text) & "'" fills("Ward_Details", Me, Q) BindFields() End If EnableDisableButtons(True, Me) btnSave.Enabled = False EnableDisableControls(False, grpWard) btnAddnew.Text = "&ADD" End If End Sub

Private Sub btnSave_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click s1 = "insert into Ward_Details values('" & CInt(txtWno.Text) & "','" & cboWtype.Text & "','" & txtWincharge.Text & "','" & cboWl.Text & "','" & CInt(txtAvailBeds.Text) & "','" & CInt(txtWc.Text) & "')" Opt(btnSave, s1, "Inserted Successfully", Me, "Ward_Details", Q) BindFields() btnAddnew.Text = "&ADD" EnableDisableButtons(True, Me) EnableDisableControls(False, grpWard) btnSave.Enabled = False End Sub

Private Sub txtWincharge_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtWincharge.KeyPress CharValidation(txtWincharge, e) End Sub

Private Sub txtWc_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtWc.KeyPress numValidation(txtWc, e) End Sub

Private Sub txtAvailBeds_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtAvailBeds.KeyPress numValidation(txtAvailBeds, e) End SubEnd Class

Program ID: StaffDetails

Program Function: This is form is used to give the information about Staff Members.Form layout:

Sr. No.Name ProcedureDescription

1Btn_ResetClickClear the Fields.

2Btn_SaveClickSaves the record.

3Btn_ DeleteClickDelete the record

4Btn_UpdateClickUpdate the record

5Btn_SearchClickSearch the Records

6Btn_ExitClickClose the form

Pseudo Code:

Test result:-

CODE:-Imports System.Data.SqlClientImports System.Windows.Forms.ControlImports System.Windows.Forms.BindingManagerBase

Public Class StaffDetails Inherits System.Windows.Forms.Form Private bmgr As BindingManagerBase Private Sub BindFields() Dim da As New SqlDataAdapter("select * from StaffDetails", objcon) Dim ds As New DataSet da.Fill(ds, "StaffDetails") BindClearPan(Panstaff) txtstaffid.DataBindings.Add("text", dv, "StaffId") txtstaffname.DataBindings.Add("text", dv, "StaffName") txtstaffname.DataBindings.Add("text", dv, "username") txtstaffadd.DataBindings.Add("text", dv, "StaffAddress") cbodesig.DataBindings.Add("text", dv, "StaffDesig")

If rdoMale.Text = "Male" Then rdoMale.DataBindings.Add("checked", dv, "StaffGender") ElseIf rdoFemale.Text = "Female" Then rdoFemale.DataBindings.Add("checked", dv, "StaffGender") End If txtphonenum.DataBindings.Add("text", dv, "StaffPhoneno") bmgr = Me.BindingContext(ds, "StaffDetails") End SubPrivate Sub btnSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSave.Click Dim comm As New SqlCommand Try comm.Connection = objcon Dim selectstatement As String = "insert into StaffDetails values(@StaffId,@StaffName,@StaffAddress,@StaffDesig,@StaffGender,@StaffPhoneno)" comm.Parameters.AddWithValue("@StaffId", Convert.ToDouble(txtstaffid.Text)) comm.Parameters.AddWithValue("@StaffName", txtstaffname.Text) comm.Parameters.AddWithValue("@StaffAddress", txtstaffadd.Text) comm.Parameters.AddWithValue("@StaffDesig", cbodesig.Text) If rdoMale.Checked = True Then comm.Parameters.AddWithValue("@StaffGender", rdoMale.Text) Else comm.Parameters.AddWithValue("@StaffGender", rdoFemale.Text) End If comm.Parameters.AddWithValue("@StaffPhoneno", Convert.ToDouble(txtphonenum.Text)) comm.CommandText = selectstatement objcon.Open() comm.ExecuteNonQuery() objcon.Close() MessageBox.Show("Record saved successfully") Catch MessageBox.Show("Please insert proper data") End Try

End SubPrivate Sub StaffDetails_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim cmd As New SqlCommand("select count(StaffId)+1 from StaffDetails", objcon) objcon.Open() Dim isum As Decimal = CDec(cmd.ExecuteScalar()) objcon.Close() txtstaffid.Text = isumEnd Sub Private Sub btnupdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnupdate.Click Dim comm As New SqlCommand Try comm.Connection = objcon Dim selectstatement As String = "update StaffDetails set StaffId=@StaffId,StaffName=@StaffName,StaffAddress=@StaffAddress,StaffDesig=@StaffDesig,StaffGender=@StaffGender,StaffPhoneno=@StaffPhoneno where StaffId=" & Convert.ToDecimal(txtstaffid.Text) comm.Parameters.AddWithValue("@StaffId", txtstaffid.Text) comm.Parameters.AddWithValue("@StaffName", txtstaffname.Text) comm.Parameters.AddWithValue("@StaffAddress", txtstaffadd.Text) comm.Parameters.AddWithValue("@StaffDesig", cbodesig.Text) comm.CommandText = selectstatement If rdoMale.Checked = True Then comm.Parameters.AddWithValue("@StaffGender", rdoMale.Text) Else comm.Parameters.AddWithValue("@StaffGender", rdoFemale.Text) End If comm.Parameters.AddWithValue("@StaffPhoneno", Convert.ToDouble(txtphonenum.Text)) objcon.Open() comm.ExecuteNonQuery() objcon.Close() MessageBox.Show("Record Update successfully") Catch MessageBox.Show("Error in Updating") End Try End Sub Private Sub btnDelet_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelet.Click Dim deletCmd As New SqlCommand("delete from StaffDetails where StaffId=@StaffId", objcon) deletCmd.Parameters.AddWithValue("StaffId", txtstaffid.Text) objcon.Open() deletCmd.ExecuteNonQuery() objcon.Close() MessageBox.Show("Record deleted successfully") End Sub Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click txtstaffid.Text = "" txtstaffname.Text = "" txtstaffadd.Text = "" cbodesig.Text = "" txtphonenum.Text = "" rdoMale.Checked = False rdoFemale.Checked = False End Sub Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click exiting("StaffDetails", Me) End Sub Private Sub btnsearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsearch.Click Dim str As String Dim Gender As String If rdoMale.Checked = True Then Gender = "male" Else Gender = "female" End If str = InputBox("Enter Staff ID") Dim objcommand As New SqlCommand Dim objrd As SqlDataReader objcommand.Connection = objcon objcommand.CommandText = "select * from StaffDetails where StaffId=" & str objcon.Open() objrd = objcommand.ExecuteReader While objrd.Read txtstaffid.Text = objrd(0) txtstaffname.Text = objrd(1) txtstaffadd.Text = objrd(2) cbodesig.Text = objrd(3) txtphonenum.Text = objrd(4) End While objcon.Close() End Sub Private Sub Label5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label5.Click End SubEnd Class

Program ID: Medicine Details

Program Function: This is form is used to give the information about Medicine Details.Form layout:

Sr. No.Name ProcedureDescription

1Btn_FirstClickDisplay First Record.

2Btn_Previous ClickDisplay Previous Record.

3Btn_NextClickDisplay Next record.

4Btn_LastClickDisplay Last Record.

5Btn_Add ClickAdds the new record.

6Btn_SaveClickSaves the record.

7Btn_ DeleteClickDelete the record

8Btn_UpdateClickUpdate the record

9Btn_ExitClickClose the form

Pseudo Code:

Test result:-

CODE:-Public Class frmMedicalDetails Inherits System.Windows.Forms.FormDim Q As String = "SELECT * from Medicine_Details"

Private Sub BindFields() BindClear(grpMedicine) txtMedCode.DataBindings.Add("text", dv, "Medicine_code") txtMName.DataBindings.Add("text", dv, "Medicine_Name") dtpMDate.DataBindings.Add("text", dv, "Manufacturing_Date") dtpEDate.DataBindings.Add("text", dv, "Expiry_Date") txtQuantity.DataBindings.Add("text", dv, "Quantity") txtRate.DataBindings.Add("text", dv, "Rate") End Sub

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load fills("Medicine_Details", Me, Q) BindFields() EnableDisableControls(False, grpMedicine) btnSave.Enabled = False

End Sub Public Sub expire() Dim currentdate As Date currentdate = Date.Today Dim a, b As Integer b = cur.Count - 1 For a = cur.Position To b If dtpEDate.Text < currentdate Then ' MessageBox.Show("Please remove the expired medicine from the stock", "Expired", MessageBoxButtons.OK, MessageBoxIcon.Warning) Me.Show() Exit Sub Else cur.Position += 1 End If Next End Sub

Private Sub btnFirst_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnFirst.Click nav(btnFirst, cur) End Sub

Private Sub btnLast_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnLast.Click nav(btnLast, cur) End Sub

Private Sub btnPrevious_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnPrevious.Click nav(btnPrevious, cur) End Sub

Private Sub btnNext_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnNext.Click nav(btnNext, cur) End Sub Private Sub btnUpdate_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUpdate.Click If btnUpdate.Text = "&UPDATE" Then EnableDisableButtons(False, Me) btnUpdate.Enabled = True EnableDisableControls(True, grpMedicine) txtMedCode.Enabled = False btnUpdate.Text = "MODIFY" Else If btnUpdate.Text = "MODIFY" Then s1 = "update Medicine_Details SET Medicine_code='" & txtMedCode.Text & "',Medicine_Name='" & txtMName.Text & "' ,Manufacturing_Date='" & dtpMDate.Text & "',Expiry_Date='" & dtpEDate.Text & "',Quantity='" & txtQuantity.Text & "' ,Rate='" & txtRate.Text & "'where Medicine_code='" & Val(txtMedCode.Text) & "'" Opt(btnUpdate, s1, "Updated", Me, "Medicine_Details", Q) BindFields() EnableDisableControls(False, grpMedicine) btnUpdate.Text = "&UPDATE" EnableDisableButtons(True, Me) btnSave.Enabled = False End If End If End Sub Private Sub btnDelete_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnDelete.Click EnableDisableControls(True, grpMedicine) EnableDisableButtons(False, Me) btnDelete.Enabled = True s1 = "Delete from Medicine_Details where Medicine_code='" & Val(txtMedCode.Text) & "'" Opt(btnDelete, s1, "Deleted", Me, "Medicine_Details", Q) BindFields() EnableDisableButtons(True, Me) btnSave.Enabled = False EnableDisableControls(False, grpMedicine) End Sub

Private Sub btnExit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExit.Click exiting("Medicine Details", Me) End Sub

Private Sub btnAddnew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddnew.Click If btnAddnew.Text = "&ADD" Then EnableDisableControls(True, grpMedicine) txtMedCode.Enabled = False EnableDisableButtons(False, Me) btnAddnew.Enabled = True btnSave.Enabled = True btnAddnew.Text = "&Cancel" cur.Position = cur.Count - 1 i = Val(txtMedCode.Text) + 1 Clear(grpMedicine) txtMedCode.Text = i txtMName.Focus() ElseIf btnAddnew.Text = "&Cancel" Then If MessageBox.Show("Are you sure you want to Cancel ?", "Record", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then s1 = "Delete from Medicine_Details where Medicine_code='" & Val(txtMedCode.Text) & "'" fills("Medicine_Details", Me, Q) BindFields() End If EnableDisableButtons(True, Me) btnSave.Enabled = False EnableDisableControls(False, grpMedicine) btnAddnew.Text = "&ADD" End If End Sub

Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click s1 = "insert into Medicine_Details values('" & CInt(txtMedCode.Text) & "','" & txtMName.Text & "','" & dtpMDate.Text & "','" & dtpEDate.Text & "','" & CInt(txtQuantity.Text) & "','" & CInt(txtRate.Text) & "')" Opt(btnSave, s1, "Inserted Successfuly", Me, "Medicine_Details", Q) BindFields() btnAddnew.Text = "&ADD" EnableDisableButtons(True, Me) EnableDisableControls(False, grpMedicine) btnSave.Enabled = False End Sub

Private Sub txtMName_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtMName.KeyPress CharValidation(txtMName, e) End Sub

Private Sub txtQuantity_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtQuantity.KeyPress numValidation(txtQuantity, e) End Sub

Private Sub txtRate_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtRate.KeyPress numValidation(txtRate, e) End Sub

Private Sub dtpMDate_CloseUp(ByVal sender As Object, ByVal e As System.EventArgs) Handles dtpMDate.CloseUp currentdate = Date.Today If (dtpMDate.Value > currentdate) Then MessageBox.Show("Manufacturing date should not be greater than today's date") End If End Sub

Private Sub dtpEDate_CloseUp(ByVal sender As Object, ByVal e As System.EventArgs) Handles dtpEDate.CloseUp currentdate = Date.Today If (dtpEDate.Value < currentdate) Then MessageBox.Show("Expiration date should not be less than today's date") End If End SubEnd Class

Program ID: Patient Details

Program Function: This is form is used to give the information about Patient Details.Form layout:

Pseudo Code:

Sr. No.Name ProcedureDescription

1Btn_FirstClickDisplay First Record.

2Btn_Previous ClickDisplay Previous Record.

3Btn_NextClickDisplay Next record.

4Btn_LastClickDisplay Last Record.

5Btn_Add ClickAdds the new record.

6Btn_SaveClickSaves the record.

7Btn_ DeleteClickDelete the record

8Btn_UpdateClickUpdate the record

9Btn_ExitClickClose the form

10Btn_PrintClickPrint the record

Test result:-

CODE:-Imports System.Data.SqlClientPublic Class frmPatientDetails Inherits System.Windows.Forms.Form Dim Q As String = "SELECT Doctor_Info.Doc_ID,Doctor_Info.DocFName ,Doctor_Info.DocLName,Patient_Information.Form_No,Date1,PFName,PMiddleName,PLastName,PAddress,PResPhone,PMobile,Email_id,DOB,PAge ,PGender,Name_of_Kind,Phone,Relation,Diagonosis FROM Doctor_Info JOIN Patient_Information ON Doctor_Info.Doc_ID=Patient_Information.Doc_ID " Dim Strcbo As String = "select Dept_Name from Department ORDER BY Dept_Name" Dim strcbodoc As String = "select Doc_ID,DocFName,DocLName from Doctor_Info ORDER BY DocFName"

Private Sub BindFields() BindClear(grp1) BindClearPan(Pangender) BindClear(grppat) BindClear(grpcont) BindClear(grpNKind) txtDocId.DataBindings.Add("text", dv, "Doc_ID") cbodoc.DataBindings.Add("text", dv, "DocFName") txtFormNo.DataBindings.Add("text", dv, "Form_No") txtDate.DataBindings.Add("text", dv, "Date1") txtPFName.DataBindings.Add("text", dv, "PFName") txtPMName.DataBindings.Add("text", dv, "PMiddleName") txtPLName.DataBindings.Add("text", dv, "PLastName") txtAddress.DataBindings.Add("text", dv, "PAddress") txtPhone.DataBindings.Add("text", dv, "PResPhone") txtMobile.DataBindings.Add("text", dv, "PMobile") txtEmail.DataBindings.Add("text", dv, "Email_id") dtpDOB.DataBindings.Add("text", dv, "DOB") txtAge.DataBindings.Add("text", dv, "PAge") If rdbMale.Text = "Male" Then rdbMale.DataBindings.Add("checked", dv, "PGender") ElseIf rdbFemale.Text = "Female" Then rdbFemale.DataBindings.Add("checked", dv, "PGender") End If txtName.DataBindings.Add("text", dv, "Name_of_Kind") txtph.DataBindings.Add("text", dv, "Phone") txtRelation.DataBindings.Add("text", dv, "Relation") txtDiagnosis.DataBindings.Add("text", dv, "Diagonosis") End Sub Public Sub FillComboBox() Try objCommand = New SqlCommand(strcbodoc, objcon) objcon.Open() dr = objCommand.ExecuteReader While (dr.Read()) cbodoc.Items.Add(dr.Item(1) & dr.Item(2)) arrlist.Add(dr.Item(0)) End While objcon.Close() dr.Close() Catch ex As Exception MsgBox(ex.Message) End Try End Sub

Private Sub btnSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSave.Click If txtDocId.Text = "" Then MessageBox.Show("Select appropriate Doctor Name", "Invalid", MessageBoxButtons.OK, MessageBoxIcon.Information) cbodoc.Focus() Else s1 = "insert into Patient_Information values('" & CInt(txtDocId.Text) & "','" & CInt(txtFormNo.Text) & "','" & txtDate.Text & "','" & txtPFName.Text & "','" & txtPMName.Text & "','" & txtPLName.Text & "','" & txtAddress.Text & "','" & txtPhone.Text & "','" & txtMobile.Text & "','" & txtEmail.Text & "','" & dtpDOB.Text & "','" & CInt(txtAge.Text) & "','" & rdbMale.Checked & "','" & txtName.Text & "','" & txtph.Text & "','" & txtRelation.Text & "','" & txtDiagnosis.Text & "')" Opt(btnSave, s1, "Inserted Successfully.", Me, "Patient_Information", Q) BindFields() btnAddnew.Text = "&ADD" EnableDisableControls(False, grp1) EnableDisableControls(False, grppat) EnableDisableControls(False, grpcont) EnableDisableControls(False, grpNKind) EnableDisableButtons(True, Me) btnSave.Enabled = False End If End Sub

Private Sub btnUpdate_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUpdate.Click If btnUpdate.Text = "&UPDATE" Then EnableDisableButtons(False, Me) btnUpdate.Enabled = True EnableDisableControls(True, grp1) EnableDisableControls(True, grppat) EnableDisableControls(True, grpcont) EnableDisableControls(True, grpNKind) Pangender.Enabled = True txtFormNo.Enabled = False txtDocId.Enabled = False btnUpdate.Text = "MODIFY" Else If btnUpdate.Text = "MODIFY" Then s1 = "update Patient_Information SET Doc_ID='" & txtDocId.Text & "',Date1='" & txtDate.Text & "' ,PFName='" & txtPFName.Text & "',PMiddleName='" & txtPMName.Text & "',PLastName='" & txtPFName.Text & "',PAddress='" & txtAddress.Text & "' ,PResPhone='" & txtPhone.Text & "',PMobile='" & txtMobile.Text & "' ,Email_id='" & txtEmail.Text & "',DOB='" & dtpDOB.Text & "', PAge='" & txtAge.Text & "' , PGender='" & rdbMale.Checked & "',Name_of_Kind='" & txtName.Text & "', Phone='" & txtph.Text & "',Relation='" & txtRelation.Text & " ', Diagonosis='" & txtDiagnosis.Text & "' WHERE Form_No='" & CInt(txtFormNo.Text) & "'" Opt(btnUpdate, s1, "Updated", Me, "Patient_Information", Q) BindFields() EnableDisableControls(False, grp1) EnableDisableControls(False, grppat) EnableDisableControls(False, grpcont) EnableDisableControls(False, grpNKind) Pangender.Enabled = False btnUpdate.Text = "&UPDATE" EnableDisableButtons(True, Me) btnSave.Enabled = False End If End If End Sub

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load FillComboBox() navrdb(rdbMale, rdbFemale) fills("Patient_Information", Me, Q) BindFields() EnableDisableControls(False, grp1) EnableDisableControls(False, grppat) EnableDisableControls(False, grpcont) EnableDisableControls(False, grpNKind) Pangender.Enabled = False btnSave.Enabled = False End Sub

Private Sub btnFirst_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnFirst.Click nav(btnFirst, cur) navrdb(rdbMale, rdbFemale) End Sub

Private Sub btnLast_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnLast.Click nav(btnLast, cur) navrdb(rdbMale, rdbFemale) End Sub

Private Sub btnPrevious_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnPrevious.Click nav(btnPrevious, cur) navrdb(rdbMale, rdbFemale) End Sub

Private Sub btnNext_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnNext.Click nav(btnNext, cur) navrdb(rdbMale, rdbFemale) End Sub

Private Sub btnDelete_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnDelete.Click EnableDisableControls(True, grp1) EnableDisableControls(True, grppat) EnableDisableControls(True, grpcont) EnableDisableControls(True, grpNKind) Pangender.Enabled = True EnableDisableButtons(False, Me) btnDelete.Enabled = True s1 = "Delete from Patient_Information where Form_No='" & Val(txtFormNo.Text) & "'" Opt(btnDelete, s1, "Deleted", Me, "Patient_Information", Q) BindFields() EnableDisableButtons(True, Me) EnableDisableControls(False, grp1) EnableDisableControls(False, grppat) EnableDisableControls(False, grpcont) EnableDisableControls(False, grpNKind) Pangender.Enabled = False btnSave.Enabled = False End Sub

Private Sub btnAddnew_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAddnew.Click If btnAddnew.Text = "&ADD" Then EnableDisableControls(True, grp1) EnableDisableControls(True, grppat) EnableDisableControls(True, grpcont) EnableDisableControls(True, grpNKind) Pangender.Enabled = True txtDocId.Enabled = False txtAge.Enabled = False txtDate.Enabled = False txtFormNo.Enabled = False EnableDisableButtons(False, Me) btnAddnew.Enabled = True btnSave.Enabled = True cur.Position = cur.Count - 1 i = Val(txtFormNo.Text) + 1 Clear(grp1) Clear(grppat) Clear(grpcont) Clear(grpNKind) Clearpanel(Pangender) txtFormNo.Text = i txtDate.Text = Date.Today btnAddnew.Text = "&Cancel" ElseIf btnAddnew.Text = "&Cancel" Then If MessageBox.Show("Are you sure you want to Cancel ?", "Record", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then s1 = "Delete from Patient_Information where Form_No='" & Val(txtFormNo.Text) & "'" fills("Patient_Information", Me, Q) BindFields() Else Exit Sub End If btnAddnew.Text = "&ADD" EnableDisableButtons(True, Me) btnSave.Enabled = False EnableDisableControls(False, grp1) EnableDisableControls(False, grppat) EnableDisableControls(False, grpcont) EnableDisableControls(False, grpNKind) Pangender.Enabled = False btnAddnew.Text = "&ADD" End If End Sub

Private Sub btnExit_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click exiting("Patient Information", Me) End Sub

Private Sub cbodoc_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbodoc.SelectedIndexChanged i = cbodoc.SelectedIndex txtDocId.Text = arrlist(i) End Sub

Public Sub age() Dim currentdate As Date Dim birthdate As Date birthdate = dtpDOB.Value currentdate = Date.Today txtAge.Text = currentdate.Year - birthdate.Year End Sub

Private Sub txtName_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtName.KeyPress CharValidation(txtName, e) End Sub

Private Sub txtPFName_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtPFName.KeyPress CharValidation(txtPFName, e) End Sub

Private Sub txtPLName_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtPLName.KeyPress CharValidation(txtPLName, e) End Sub

Private Sub txtPMName_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtPMName.KeyPress CharValidation(txtPMName, e) End Sub

Private Sub txtRelation_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtRelation.KeyPress CharValidation(txtRelation, e) End Sub

Private Sub dtpDOB_CloseUp(ByVal sender As Object, ByVal e As System.EventArgs) Handles dtpDOB.CloseUp Dim currentdate As Date currentdate = Date.Today If (dtpDOB.Value > currentdate) Then MessageBox.Show("Enter valid date...", "Date", MessageBoxButtons.OK, MessageBoxIcon.Warning) End If End Sub

Private Sub txtMobile_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtMobile.KeyPress numValidation(txtMobile, e) End Sub

Private Sub txtPhone_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtPhone.KeyPress numValidation(txtPhone, e) End Sub

Private Sub txtph_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtph.KeyPress numValidation(txtph, e) End Sub

Private Sub dtpDOB_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles dtpDOB.LostFocus age() End Sub

Private Sub txtPhone_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtPhone.LostFocus phoneValidation(txtPhone) End Sub

Private Sub txtph_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtph.LostFocus phoneValidation(txtph) End Sub

Private Sub txtMobile_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtMobile.LostFocus phoneValidation(txtMobile) End Sub

Private Sub btnprint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnprint.Click IpdPatient = txtPFName.Text IpdPatientReport.Show()

End SubEnd Class

Program ID: OPD Orescription Bill

Program Function: This is form is used to generate the Opd bills.Test Result:-

Sr. No.Name ProcedureDescription

1Btn_FirstClickDisplay First Record.

2Btn_Previous ClickDisplay Previous Record.

3Btn_NextClickDisplay Next record.

4Btn_LastClickDisplay Last Record.

5Btn_Add ClickAdds the new record.

6Btn_SaveClickSaves the record.

7Btn_ DeleteClickDelete the record

8Btn_UpdateClickUpdate the record

9Btn_ExitClickClose the form

10Btn_PrintClickPrint the record

Pseudo Code:

CODE:-Imports System.IOImports System.DataImports System.Data.SqlClientPublic Class frmOPDPrescrition Inherits System.Windows.Forms.Form Dim Q As String = "SELECT Patient_Information.Form_No ,Patient_Information.Doc_ID,Patient_Information.PFName,Patient_Information.PMiddleName,Patient_Inform