Page | 1 1. ORGANISATIONAL OVERVIEW SP FORT HOSPITAL SP FORT hospital is owned by a large business family. It was established on 26 th January, 1998.in the first years of its development there were only average facilities. After this it was the way of gradual development. The reasons for its growth are: • Very effective doctor service is available here. The doctors are well qualified and are always ready to provide as good service as possible • The tools and facilities provide here are of the best quality. The machines used are just like those available in any other super specialty hospital. If any machine becomes out of order it will be repaired as early as possible by the service men available here so that the machine can be used at any time of its need. • Above all three is an excellent management group in the hospital. They are always willing to provide any facility required by the customer. And ,they are always willing to listen to problems and rectify them • The patients are highly impressed because of the excellent service provide in the hospital. The service cost is not very high. Thus most excellent service is available here at low expense.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
P a g e | 1
1. ORGANISATIONAL OVERVIEW
SP FORT HOSPITAL
SP FORT hospital is owned by a large business family. It was established on 26thJanuary, 1998.in the first years of its development there were only average facilities. After this it was the way of gradual development. The reasons for its growth are:
• Very effective doctor service is available here. The doctors are well qualified and are always ready to provide as good service as possible
• The tools and facilities provide here are of the best quality. The machines used are just like those available in any other super specialty hospital. If any machine becomes out of order it will be repaired as early as possible by the service men available here so that the machine can be used at any time of its need.
• Above all three is an excellent management group in the hospital. They are always willing to provide any facility required by the customer. And ,they are always willing to listen to problems and rectify them
• The patients are highly impressed because of the excellent service provide in the hospital. The service cost is not very high. Thus most excellent service is available here at low expense.
P a g e | 2
2. SYSTEM ANALYSIS
Analysis is a detailed study of various operations performed by a system and their relationships within and outside the system. During analysis, data are collected on the available files, decision points and transactions handled by the present system. Interviews, on-site observation and questionnaire are the tools used for system analysis. Using the following steps it becomes easy to draw the exact boundary of the new system under consideration:
All procedures, requirements must be analyzed and documented in the form of detailed data flow diagrams (DFD), data dictionary, logical data structures and miniature specifications. System analysis also includes sub-dividing of complex process involving the entire system, identification of data store and manual processes.
The main purpose of analysis activity is to clearly understand the exact requirements of the system and eliminates the entire problem: inconsistency and its completeness of the existing system
2.1. STUDY OF EXISTING SYSTEM
• Patient reception
In case of an emergency the receptionist will collect patient information like name, age and address and whether they want to consult a doctor to their wish. If that doctor is not available, receptionistwill suggest a doctor’s name. If the case is serious, he is directly sent to the casualty and after the initial checkup he will be referred to the appropriate department doctors.
• Outpatient registration
After the patient reception OP card issued. The patient funds the op registration fees at the registration. The consulting fee is different for different doctors. The OP card is valid for a particular duration. If the patient comes after this duration, the card will be renewed. Then the details collected from the patient are recorded.
• Inpatient admission
.The patient will be admitted in hospital if needed, by the doctor .
• Room/ward
There are 2 sections. General ward and room.
P a g e | 3
• Billing
Only when a patient is discharge from a hospital a bill is prepared. It includes room rent, doctor‘s charge and soon.
• Discharge
A patient is discharged only when the doctor suggests. The dues will be cleared.
• Lab test
Depending on the disease and symptoms, the doctor will suggest for the required test for patient.
2.1.1 LIMITATION OF EXISTING SYSTEM
1. Lack of immediate retrievals: -The information is very difficult to retrieve and to find particular information like- E.g. - To find out about the patient’s history, the user has to go through various registers. This results in inconvenience and wastage of time.
2. Lack of immediate information storage: - The information generated by various transactions takes time and efforts to be stored at right place.
3. Lack of prompt updating: - Various changes to information like patient details or immunization details of child are difficult to make as paper work is involved.
4. Error prone manual calculation: - Manual calculations are error prone and take a lot of time this may result in incorrect information. For example calculation of patient billing based on various treatments.
5. Preparation of accurate and prompt reports: - This becomes a difficulttask as information is difficult to collect from various registers.
2.2. PROPOSED SYSTEM
The main objective of the proposed system is to overcome the drawbacks in the manual system. Also some modifications have to make it a simple and user friendly. Redundancy, inconsistency and storage of large amount of data extraction for generating a variety of reports
P a g e | 4
are the factors in the manual system. This form is the basic for the development of proposed system. High speed and accuracy are the main features of the proposed system over the manual system.
2.2.1. ADVANTAGES OF PROPOSED SYSTEM
• Planned approach towards working: - The working in the organization will be well planned and organized. The data will be stored properly in data stores, which will help in retrieval of information as well as its storage.
• Accuracy: - The level of accuracy in the proposed system will be higher. All operation would be done correctly and it ensures that whatever information is coming from the center is accurate.
• Reliability: - The reliability of the proposed system will be high due to the above stated reasons. The reason for the increased reliability of the system is that now there would be proper storage of information.
• No Redundancy: - In the proposed system utmost care would be that no information is repeated anywhere, in storage or otherwise. This would assure economic use of storage space and consistency in the data stored.
• Immediate retrieval of information: - The main objective of proposed system is to provide for a quick and efficient retrieval of information. Any typeof information would be available whenever the user requires.
• Immediate storage of information: - In manual system there are manyproblems to store the largest amount of information.
• Easy to Operate: - The system should be easy to operate and should be such that it can be developed within a short period of time and fit in the limited budget of the user.
2.3. REQUIREMENT ANALYSIS
Requirements Analysis is the process of understanding the customer needs and expectations from a proposed system or application and is a well-defined stage in the Software Development Life Cycle model.
P a g e | 5
Requirements are a description of how a system should behave or a description of system properties or attributes. It can alternatively be a statement of ‘what’ an application is expected to do.
Given the multiple levels of interaction between users, business processes and devices in global corporations today, there are simultaneous and complex requirements from a single application, from various levels within an organization and outside it as well.
The Software Requirements Analysis Process covers the complex task of eliciting and documenting the requirements of all these users, modeling and analyzing these requirements and documenting them as a basis for system design.
A dedicated and specialized Requirements Analyst is best equipped to handle the job. The Requirements Analysis function may also fall under the scope of Project Manager, Program Manager or Business Analyst, depending on the organizational hierarchy.
2.3.1. HARDWARE REQUIREMENTS
Processor : Dual coreHard disk : 20 GBRam : 1GBCd drive : 52xInput device: keyboard, mouse & web camera
2.3.2. SOFTWARE REQUIREMENTS
Operating system : windows7Backend : MicrosoftSQL server 2005Front end : c#.netDesign tool : Microsoft visual studio
2.4. FEASIBILITY STUDY
Preliminary investigations examine project feasibility, the likelihood the system organization. All projects are feasible-given unlimited resources and infinite time. Unfortunately,
P a g e | 6
the development of a computer-based system or product is more likely plagued by a scarcity of resource and difficult delivery dates. It is boat necessary and prudent to evaluate the feasibility of the project at the earliest possible time. Feasibility and risk analysis are related in many ways. Three important tests of feasibility are studied and described below
2.4.1. ECONOMIC FEASIBILITY
Economics feasibility is an important task of system analysis. A system that can be developed technically and that can be developed technically and that will be used if installed must still be profitable for the organization. Financial benefits must be equal or exceed the cost. The analysis raises financial and economic questions during the preliminary investigation to estimates the following to estimates the following.
1. The cost of conduct a full system investigation
2. The error benefit in the form of reduced cost or fewer costly errors.
3. The cost if nothing changes to be, judged feasible, a proposal for the specific project must pass all these tests, otherwise it is not considered as feasible project.
2.4.2. OPERATIONAL FEASIBILITY
Proposed project are beneficial only if they can be turned into information systems that will. Meet the operating requirements of the organization. This test of feasibility asks if the system will work when it is developed and installed. This project satisfies all the operational conditions.
2.4.3. TECHNICAL FEASIBILITY
There are a number of technical issued when are generally raised during the feasibility stage of the investigation. A study of function, performance and constraints may affect the ability to achieve an acceptable system. The considerations that are normally that are normally associated to technical feasibility include:
1. Development risk
2. Resource availability
3. Technology
2.5 RELEVANT ENTITIES
Entities are the objects of significance for the organization about which information needs to be known. The main entities of our project are
P a g e | 7
1. User 2. Administrator.
1. User:
The hospital staffs are the users in this software
Login
With user name and password, users can login to the software
OP
Details regarding outpatients are stored.
IP
Details of admitted persons are stored.
INFO
User can recollect all stored details.
TEST
User can add the test amount into patient bills.
Pharmacy
User can add the medicine charges into patient bills.
Video conferencing
User can communicate with another person through internet.
2. Administrator
Administrator Login is used only for the administrative purpose of the system. This login can be used only by the administrator, who accepts or deny access to the user.
Settings
Administrator can only set& reset the setting of the software
Id card creation
Id card for hospital staffs are created by the administrator.
P a g e | 8
3. SYSTEM DESIGN
The most creative and challenge phase of the system life cycle is system design . System design is a solution a ‘how’ to approach to the creation of a new system. This important phase is composed of several steps. They provide the understanding and procedural details necessary for implementing the system recommended in the feasibility study. Emphasis is translating the performance requirements into design specification. The design phase is a transition from a user oriented document to a documented oriented to the programmers or database personal. This phase is including input and output design and basics of form design.
There are two different categories in design phase. They are physical design of the system and logical design of the system. Define the system in terms of the user system specification is called logical system definition. First the system objectives are achieved logically, and then only design portions will convert into physical terms.
In logical system definition a number of factors have been considered
• The analyst must clarify the specific objectives of the design process • The result of the analysis must be converted into an outline of the outfits for and input
the system• It is necessary to structure the data , which will need to be stored in order to
procedure the outputs
• It is necessary to consider the nature of the processing need to met the user requirements
3.1 DESIGN OF SUBSYSTEM
1. OP MODULE
The op module deals with functions of out patients. They are
• Op registration• Op consultation
P a g e | 9
Op registration sub modules The function of this module of registration of new patient in the op .The registration form with patient’s data. The patients can select the desired doctors for consultation. And also OP card issued.
Op consultation sub module
This is designed to update op renewal and consultations. The op number is used to search for patient data.
2. IP MODULE
Admission of patient maintenance of the IP register, discharge of patient and IP billing are handled by this module. The sub modules are
IP admission IP bills
* IP admission sub module
There are two primary options in addition. That is to admit a patient already having an IP registration or to admit a new patient as IP .in the first case function is to search with op number and show all available patient data. Additional information needed is then entered in IP register. For a new patient new IP number is generated and will relevant data are accepted.
In this module will inpatients are listed. The user can select patient for discharge. While proceeding with discharge summary is entered
* IP bills sub module
The IP number is used to search for patients data. Then validity for current registration is verified by checking data of last renewal in IP registration. And calculate the total fee and balance fee of the patient.
3. INFO MODULE
This module has the following sub modules
• Room / ward information • Doctors information • Test information • Op information• IP information
P a g e | 10
• Room / ward information To display which room / bed is free and which occupied.
• Doctors information List the name of all doctors and there name ,id ,section and consultation free are displayed .
• Test informationTo display the test details. Test name and cost of the test are included.
• Op informationTo display op information
• Ip informationTo display ip information
4. SETTINGS
This module relates to the generation of reports needed for system setting.
5. TEST
This module relates to the testing.
6. ID CARD CREATION
This module related to creating ID card for hospital staff.
7. VIDEO CONFERENCING
This module offer video communication through internet.
8. PHARMACY
This module deals medicine cost of a patient from the hospital
P a g e | 11
3.2 USER INTERFACE DESIGN
The user interface portion of a software product is responsible for all interactions with the user. Almost every software product has a user interface. Most users often judge a software product based on its user interface. An interface that is difficult to use leads to higher levels of user errors and ultimately leads to user dissatisfaction. Therefore, sufficient care attention should be paid to the design of the user, interface of any software product.
Systematic development of the user interface is also important. Development of a good interface usually takes significant portion of the total system development effort. Unless the user interface is designed and developed in a systematic manner, the total effort required to develop the interface will increase tremendously. Therefore, it is necessary to carefully study various concepts associated with user interface design and understand the various systematic techniques available for the development of user interface.
P a g e | 12
3.3 DATA BASE DESIGN After the input and output and various from are designed files and the data they store most be organized according to user requirements and constrains of the hard ware and the operating system. In a data environment, common data are available and used by several users .instead of each program managing its own data, data across application are shared by authorized users with data base software managing the data as an entity.
A data base is a collection of interrelated data stored with minimum redundancy to serve many users quickly and efficiently .the generally objective is to make in formation access easy, quick, in expensive, flexible for the user. In data base designing several specific objectives are considered they are
• Control redundancy • Easy of learning • Data independence • More information on low cost• Accuracy and integrity • Recovery form failure • Privacy and security performance.
Heart of the data base is the data base management .it control and manage the data base file and manages the data base files and handle s request from application program in a data manipulation language .
Data base structuring is refined through a process called normalization .data are grouped in the simplest way possible so that later changes can be made be with a minimum of impact on the structure. When too many application are formed together to make entities, some are found to be entitled themselves into attributes liked by common data elements to form relationship improved by effective data base management system.
3.4 TABLE DESIGN
users
column name data type constraintsuser name nvarchar(50) primary keypassword nvarchar(30)IsAdmin nvarchar(10)
P a g e | 13
IPpayment
column name data type constraintsIpno Char(10) Foreign keyBilldate datetimeDue Decimal(10,2)paid Decimal(10,2)closed Varchar(10)
RoomWard
column name data type constraintsRoom name varchar(50) Primary keyNoOfBeds varchar(50)Rent decimal(10,2)BedsFree intRoomType varchar(10)
Test
column name data type constraintsTest varchar(50)charge float
DEPARTMENT
column name data type constraintsDEPARTMENT Varchar(200)
op
Column name Data type constraints
Op no varchar(10) Primary key
Name varchar(300)
Age int
Sex varchar(2)
Address varchar(500)
Phone varchar(300)
P a g e | 14
Refdr varchar(300)
Date varchar(50)
Last date varchar(50)
comments varchar(max)DEPARTMENT varchar(200)
DrDetails
Column name Data type constraintsId no Int primary keyName varchar(300)Phone_no varchar(50)Details varchar(max)Consultation_fee Floatdepartment varchar(200)
Pharmacy
column name data type constraintsID int primary keyItem varchar(50)Quantity intRate Decimal(10,2)
OTHER
column name data type constraintsHOSPITALNAME varchar(200)OpExpiryDays int
IP
Column name Data type constraintsIP no Char(10) Primary keyCons_date varchar(50)Name varchar(50)Age IntSex char(2)
P a g e | 15
Address varchar(300)Phone varchar(30)Refdr varchar(300)Complaint varchar(500)Wardtype varchar(50)Roomorwardno char(10)Department varchar(100)Date of last paid date
3.5 RELATIONSHIP BETWEEN TABLES
P a g e | 16
3.6 DATA FLOW DIAGRAM
The DFD is a simple graphical formalize that can be used to represent a system. A DFD graphically depicts the transformation of the data input to the system to the final result through a hierarchy of levels. The main reason why the DFD technique is so popular is probably because of the fact that DFD is a very simple formalism – it is simple to understand and use. A DFD model uses a very limited number of functions performed by a system and the data flow among these functions. Starting with a set of high-level functions that a system performs, a DFD model hierarchically represents various sub functions. To develop a higher-level DFD model, processes are decomposed into their sub-processes and the data flows among these sub-processes are identified.
Primitive Symbols Used for Constructing DFD
Function Symbol
A function is represented using a circle. This symbol is called a process or a bubble. Bubbles are annotated with the names of the corresponding functions.
- Process
External Entity Symbol
An external entity such as a librarian, a library member, etc is represented by a rectangle. The external entities are essentially those physical entities external to the software system which interact with the system by inputting data to the system or by consuming the data produced by the system. In addition to the human users, the external entity symbol can be used to represent external hardware and software such as external application software.
- External Entity
Data Flow Symbol
A directed arc or an arrow is used as flow symbol. A data flow symbol represents the data flow occurring between two processes, or between an external entity and a process, in the direction of the data flow arrow. Data flow symbols are usually annotated with the corresponding data names
P a g e | 17
- Data Flow Symbol
Data Store Symbol
A data store represents a logical file. It is represented using two parallel lines. A logical file can represent either a data store symbol which can represent either a data structure or physical file on disk. Each data store is connected to a process by means of a data flow symbol. The direction of the data flow arrow shows whether data is being read from or written in to a data store. An arrow flowing in or out of a data store implicitly represents the entire data store and hence arrows connecting to a data store need not be annotated with the name of the corresponding data items.
- Data Store Symbol
Output Symbol
The Output symbol is used to represent the output
- Output Symbol
3.7 CONTEXT DIAGRAM
Context diagram is also called Level-0 DFD. It represents the entire system in a single bubble. The various external entities with which the system interacts and the data flows occurring between the systems and external entities are also represented. A System Context Diagram (SCD) is the highest level of a system, showing the system as a whole and its inputs and outputs from/to external actors. SCDs are a type of Data Flow Diagram, and they should always be produced as DFDs. Context Diagrams show the interactions between a system and other factors with which the system is designed to face. SCD is very helpful in understanding the context in which the system will be part of Software engineering.
Context diagrams are used early in a project to get agreement on the scope under investigation. Context diagrams are typically included in a requirements document. These diagrams must be read by all project stakeholders and thus should be written in plain language so the stakeholders can understand items within the document. An alternative would be a use case diagram since it also represents the scope of the project at a similar level of abstraction.
P a g e | 18
The best System Context Diagrams are used to display how system interoperates at a very high level or how systems operate and interact logically. The system context diagram is a necessary tool in developing a baseline interaction between systems and actors; actors and system or systems and system.
LEVEL 1 DFD
P a g e | 19
P a g e | 20
P a g e | 21
P a g e | 22
P a g e | 23
3.8 STRUCTURE CHART
P a g e | 24
3.9 MENU TREE
P a g e | 25
4. PROCESSING ENVIORNMENT
4.1 Hardware Specification
Processor Intel Dual Core
RAM 1GB
Hard disk 40 GB
Input Keyboard, mouse&web camera
4.2 Software Specification
Operating system windows 7
Language used English
Front end C#.net
Back end MS SQL
OPERATING SYSTEM
Windows 7 is the latest release of Microsoft Windows, a series of operating systems produced by Microsoft for use on personal computers, including home and business desktops, laptops, netbooks, tablet PCs, and media center PCs. Windows 7 was released to manufacturing on July 22, 2009, and reached general retail availability on October 22, 2009, less than three years after the release of its predecessor, Windows Vista. Windows 7's server counterpart, Windows Server 2008 R2, was released at the same time.
Unlike its predecessor, Windows Vista, which introduced a large number of new features, Windows 7 was intended to be a more focused, incremental upgrade to the Windows line, with the goal of being compatible with applications and hardware with which Windows Vista was not at the time. Presentations given by Microsoft in 2008 focused on multi-touch support, a redesigned Windows shell with a new taskbar, referred to as the Super bar, a home networking system called Home Group, and performance improvements. Some standard applications that
P a g e | 26
have been included with prior releases of Microsoft Windows, including Windows Calendar, Windows Mail, Windows Movie Maker, and Windows Photo Gallery, are not included in Windows 7; most are instead offered separately at no charge as part of the Windows Live Essentials suite.
FRONT END
Introduction to Microsoft - Net
• Microsoft .net is a set of software technologies for collecting information, people, system and devices.
• An absolutely new programming module totally object oriented; grammar / functionally independent of each other.
• Simplified and consistent architecture same development methodology may be applied across plethora of languages without performance loss.
• Microsoft.net is a set of software technologies for connecting information, people, system and devices.
• An absolutely new programming model- totally object oriented; grammar functionally independent of each other.
• Simplified and consist architecture- same development methodology may be applied without performance loss.
• Net frame work• The net framework is a development and execution environment that allows
different programming languages and libraries to work together seamlessly to create applications that are easier to build, manage, deploy and integrated with other networked systems.
The.net frame work is responsible for providing a basic platform for application.
Main parts of .net frame work
• The common language runtime (CLR)• The frame work class libraries (FCL)• The programming language (C#,VB)• Asp.net (web application)
Common language runtime
• CLR is a virtual machine component of micro soft’s.net.• It’s an implementation for common language infra-structure(CLI)• CLR runs a form of byte code.
P a g e | 27
The common language run time is responsible for run time services such as language integration, security enforcement memory, process and thread management. in addition it has a role at development time when feature such as life cycle management ,storage type naming across language exception .handling, dynamic binding and soon .reduce the amount of the code that a developer must write to turn business logic into re-usable component.
Frame work class libraries (FCL)
• FCL is a library of classes available to all languages using.net fiber work.• The BCL provides classes which encapsulated a number of common function
including file reading and writing, graphic rendering, data base interaction and XML document manipulation.
The class library is an object oriented, providing types form which our own managed code can derive functionally. This not only make the .net frame work type easy to use ,but also reduces the time associated with learning new features of the .net frame work. in addition third party components can integrate seamlessly with classes in the .net frame work.
C-SHARP(C#)
• C# = VB + java (best of both).• C# is an OOP language.• Developed by Microsoft.• Simple operator loading.• Basic statement identical to c++, java.
C# is simple ,powerful ,type –safe object oriented rapid application development while retraining expressiveness and elegance of c-style language visual studio support visual c# with a featured code editor project templates ,designers ,code wizard , a power full and easy-to-to use debugger and other tool. The .net frame work class library provides access to a wide range of operating system services and other use full, well-designed class that sped up the development cycle significantly.
The c# language is clearly the star of whole .net range-production with visual basic .net and it is side click. C # is a ’java-like’ qualities such as garbage. Collection and hierarchical namespaces—have received lot of attention.
WPF
Windows Presentation Foundation (WPF) is the code-name of the presentation (user-interfaces) sub system in Windows programming model and is used to create user interfaces. If you have been programming .NET, you must be familiar with Windows Forms and ASP.NET. Windows Forms are used to build Windows client application and ASP.NET is
P a g e | 28
used to build Web applications. Well, WPF is a new technology that may be used instead of both Windows Forms and ASP.NET.
BACKEND
MS SQL
SQL server is the native data store of C#.net. Every business enterprises maintain large volume of data for its operation with more and more people accessing data for their work, the need to maintain its integrity and relevance increases. Normally with the traditional method of storing data and information in file, the changes that the data loses its integrity and validity are very high SQL server 2005 offers capacity of both relational and object-oriented data base system. In general objects can be defined as reusable software calls which can be located independently and perform specific
Tasks on my application environment with little or no change to the code.
FEATURES OF SQL
• Scalability and availability • Enterprise level database features• Ease of interaction deployment and use
P a g e | 29
5. CODING AND TESTING
The input to the coding phase is the design document. During the coding phase, different modules identify in the design document are coded according to the respective module specifications. Recall that at the end of the design phase, we not only have the module structure of the system but also the module specifications where the data structures and algorithms for each module are specified. Therefore, we can say that the objective of the coding phase is transform the design of a system as given by its module specifications, into a high level language code and to unit test this code.
A crucial phase in the system development life cycle is the successful implementation of new system design. Implementation simply means converting a new system design into operation. An important aspect of the system analyst’s job is to make sure that the design is implemented to establish the standard. A critical phase in the system development is the implementation of the new system. Implementation is the process of converting a new system design into an operational one. Implementation includes all the activities that take place to convert from the old system into a new one. The new system may be totally new. Replacing an existing system on it may be a major modification to a system currently put into use.
Implementation is the stage of the project when this theoretical design is turned into a working system. At this stage the main work load shifts to user department. It can’t be considered to be a crucial stage in achieving a successful new stage and in giving the user confidence that the system will work and be effective.
TESTING
Testing is probably the most important phase for long-term support as well as for the reputation of the company. If you don’t control the quality of the software, it will not be able to compete with other products on the market. If software crashes at the customer site, your customer loses productivity as well money and you lose credibility. Sometimes these losses are huge. Unhappy customers will not buy your other products and will not refer other customers to you. You can avoid this situation by doing extensive testing. This testing is referred to as Quality Assurance, or QA, in most of the software world.
Usually, testing starts as soon as the initial parts of the software are available. There are multiple types of testing and these are explained in this section. Each of these has its own importance.
P a g e | 30
• Unit testing
• User Acceptance testing
• Validation testing
• Integration testing
1. Unit testing
Unit testing is testing one part or one component of the product. The developer usually does this when he/she has completed writing code for that part of the product. This makes sure that the component is doing what it is intended to do. This also saves a lot of time for software testers as well as developers by eliminating many cycles of software being passed back and forth between the developer and the tester.
When a developer is confident that a particular part of the software is ready, he/she can write test cases to test functionality of this part of the software. The component is then forwarded to the software testing people who run test cases to make sure that the unit is working properly.
2 User Acceptance testing
User acceptance of a system is a key factor for the success of any system. The system under consideration is tested for the user acceptance by constantly, keeping in touch with the prospective system user at the time of developing and making changes whenever required.
3 Validation testing
Validation test can be defines in many ways, but a simple definition is that the validation succeeds when the software functions in a manner that is expected by the customer.
4 Integration testing
It is the systematic approach for constructing the program structure, while at the same time conducting test to uncover errors associated with in the interface.
P a g e | 31
6. SECURITY, BACKUP AND RECOVERY
Security is the condition of being protected against danger or data loss. In the general sense, security is a concept similar to safety. The nuance between the two is an added emphasis on being protected from dangers that originate for outside. Individuals or actions that encroach upon the condition of protection are responsible for the breach of security.
In the field of information technology, backup refers to the copying of data so that these additional copies may be restored after a data loss event. Backups are useful primarily for two purposes: to restore a computer to an operational state following a disaster and to restore small numbers of files after they have been accidentally deleted or corrupted. Backups differ from archives in the sense that archives are the primary copy of data and backups are a secondary copy of data. Backup systems differ from fault tolerant systems in the sense that backup systems assume that a fault will cause a data loss event and fault-tolerant systems assume a fault will not. Backups are typically that last line of defense against data loss, and consequently the least granular and least convenient to use.
P a g e | 32
7. UPGRADEABILITY POSSIBILITIES
It refers to the up gradation possibilities of the current project. This program can upgraded to have many more features such as hospital inventory management, staff details, payroll management etc. Also it can give network capabilities for connecting and synchronizing various section or departments of a hospital.
1. Even though casualty not included even if it could be added2. Pharmacy is described simply we could add specific details about pharmacy and
test3. Different types of rooms and ward are available in the hospital. That are not
specified in the software 4. Staff details except doctorsare not stored 5. Users are only hospital staff.Even though should be explicit publically.
P a g e | 33
8. SOFTWARE MAINTENANCE
Software maintenance refers to any changes made to a software product after it has been delivered to the customer. Maintenance is needed to correct errors, enhance features, port to new platforms, etc. When the hardware platform changes, and a software product performs some low level functions, maintenance becomes necessary. The requirement of software maintenance arises on account of the three main reasons:
CorrectiveCorrective maintenance of a software product becomes necessary to rectify the bugs
observed while the system is in use.
Adaptive A software product might need maintenance when the customers need the product to run
on new platforms, on new operating systems, on new operating systems, or when they need the product to be interfaced with new hardware or software.
PerfectiveA software product needs maintenance to support the new features that users want it to
support to change different functionalities of the system according to customer demands, or to enhance the performance of the system.
P a g e | 34
9. APPENDIX
9.1Conclusion
Hospital management system is an application that can be used for manipulating and maintaining the internal processes of a hospital in a simple and user friendly way. This software works on a simple work station. If we use this software we can perform most of the function in a hospital within seconds.
9.2Bibliography
BOOKS
Fundamentals of Software Engineering
ByRajib Mall
Software Engineering
By K.L James
WEBSITE
http://www.en/wikipedia.org.
9.3. Gantt chartGantt charts are mainly used to allocate resources to activities. The resources allocated to
activities include staff, hardware and software. A Gantt chart is a special type of bar chart where each bar represents an activity. The bars are drawn along a timeline. The length of each bar is proportional to the duration of the time planned for the corresponding activity.
Gantt charts used for the software project management are actually an enhanced version of the standard Gantt charts. In the charts used for software project management, each bar consists of a white part and shaded part. The shaded part of the bar shows the length of the time estimated to take. The white part shows the slack time is the time by which a task must be finished.
Design database part
Design database part
NOV 15 DEC 1 DEC 25 JAN 11 JAN 31 March 10
Specifications
Design database part
Design GUI part
Code database part
Code GUI part
Integration and test
Write user manualpart Designatabs
P a g e | 35
9.4Meeting Minutes
Date : November 15 to November 30
Time : 10:00 am
Location :neyyattin kara
Present :AKHIL S.V
AKHIL GOPAL
DEEPU
P a g e | 36
SACHIN vijeesh
Progress Report
We took a weekly meeting. This period the specification of requirement was conducted. A detailed study of the existing system was done. Reports were written about the analysis. The drawbacks of the existing system were noted. Thus a new system was proposed. The requirements and the specifications for the proposed system were recorded. The server, which has a major role, was also specified. The software was broken into the modules. Specific tasks were assigned to each member.
Scheduled meeting
Date : December 1 to December 25
Time : 11:00 am
Location :neyyattin kara
Present :AKHIL S.V
AKHIL GOPAL
DEEPU
SACHIN vijeesh
Progress Report
The design of the graphical user interface part has been started. User friendly interface were created in concerned to the customer. The table design is completed. Date base work is also finished. Necessary values are inserted. Various validation processes are studied. The database design discussed with our project guide at college.
Scheduled meeting
Date : January 11 to January 31
P a g e | 37
Time : 10:00 am
Location :neyyattin kara
Present :AKHIL S.V
AKHIL GOPAL
DEEPU
SACHIN VIJEESH
Progress Report
The code of GUI part has been completed. The database part code will take a few more days to be finished. The report work has been completed.
Scheduled meeting
Date : February 1 to March 10
Time : 10:00 am
Location :neyyattin kara
Present :AKHIL S.V
AKHIL GOPAL
DEEPU
SACHIN VIJEESH
P a g e | 38
Progress Report
The design and coding of the system have completed. Now the integration and testing part to evaluate the systems complaints with specified requirements the data input and output has been checked. System testing has done using verification and validation. Thus this proposed system has finished its design coding and testing phase.
ClassLogging log = new ClassLogging(); public DepartmentList() : base() {try { ClassDbManager db = new ClassDbManager(global::WpfApplication2.Properties.Settings.Default.ConnectionString); db.OpenDB(); Department department;
DataTable dtDepartments = new DataTable(); DataTable dtDoctors = new DataTable();
SqlCommand com = new SqlCommand(); com.CommandType = CommandType.StoredProcedure;
DataTableReader dtrDepartments = new DataTableReader(dtDepartments);while (dtrDepartments.Read()) { Add(department = new Department(dtrDepartments["Departments"].ToString()));
com.Parameters["@DepartmentName"].Value = dtrDepartments["Departments"].ToString();//com.CommandText = "SELECT name AS DoctorName FROM DOCTORS WHERE DEPARTMENT='" + dtrDepartments["DEPARTMENTS"].ToString() + "'"; ad.SelectCommand = com;
ad.Fill(dtDoctors);for (int i = 0; i < dtDoctors.Rows.Count; i++) { department.Doctors.Add(new Doctor(dtDoctors.Rows[i]["DoctorName"].ToString())); }
}public ClassDbManager(string connString) { ConString = connString; }publicstatic SqlConnection con ;//function for opening connectionpublicbool OpenDB() {if (ConString != "") {try { con = new SqlConnection(ConString); con.Open();returntrue;
}catch { MessageBox.Show("Cannot open DB\nSource:Class DBManger.openDB(string)");returnfalse; } }elsereturnfalse; }//function for checking if entry exitspublicbool EntryExists(string query) { DataSet ds = new DataSet(); SqlDataAdapter ad = new SqlDataAdapter(); SqlCommand com = new SqlCommand(); com.Connection = ClassDbManager.con;
sing System;using System.Collections.Generic;using System.Text;using System.Data;using System.Data.SqlClient;
namespace WpfApplication2{/* * Load OP bill items and return as data table * insert into OP Bill -at frnt * Print OP Bill */classClassOPBillMangement {public DataTable LoadBillItems() {try { DataTable items = new DataTable(); SqlDataAdapter ad = new SqlDataAdapter("SELECT * FROM OPBILLMASTER", ClassDbManager.con); ad.Fill(items);return items; }catch(Exception w) { ClassLogging log = new ClassLogging(); log.LogException(w);returnnull; } }
P a g e | 50
}}
using System;using System.Collections.Generic;using System.Data;using System.Data.SqlClient;using System.Text;
namespace WpfApplication2{classClassPharmacyManger {public DataView GetItemList() { SqlDataAdapter ad = new SqlDataAdapter("SELECT Item FROM pharmacy",ClassDbManager.con); DataTable dt = new DataTable(); ad.Fill(dt);return dt.AsDataView(); }
///<summary>/// Clean up any resources being used.///</summary>///<param name="disposing">true if managed resources should be disposed; otherwise, false.</param>protectedoverridevoid Dispose(bool disposing) {if (disposing && (components != null)) { components.Dispose(); }base.Dispose(disposing); }
#region Windows Form Designer generated code
///<summary>/// Required method for Designer support - do not modify/// the contents of this method with the code editor.///</summary>privatevoid InitializeComponent() {this.button1 = new System.Windows.Forms.Button();this.SuspendLayout();// // button1// this.button1.Location = new System.Drawing.Point(269, 101);this.button1.Name = "button1";this.button1.Size = new System.Drawing.Size(75, 23);this.button1.TabIndex = 0;
P a g e | 56
this.button1.Text = "button1";this.button1.UseVisualStyleBackColor = true;this.button1.Click += new System.EventHandler(this.button1_Click);// // Form1// this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;this.ClientSize = new System.Drawing.Size(851, 414);this.Controls.Add(this.button1);this.Name = "Form1";this.Text = "Form1";this.ResumeLayout(false);
publicbool SubmitValues() {if (textBoxName.Text != "")//name cannot be empty {if (textBoxComment.Text != "") //Comment Cannot be emty {if (textBoxAge.Text != "")//Age cannot be empty { SqlCommand com = new SqlCommand(@"Insert into ip (consdate,name,age,sex,address,phone,refdr,complaint,department,RoomorWardno,DateLastPaid) values('" + DateTime.Now.Date + "','" + textBoxName.Text + "'," + textBoxAge.Text + ",'" + ((bool)(radioButtonFemale.IsChecked) ? "Female" : "Male") + "','" + textBoxAddress.Text + "','" + textBoxPhoneNumber.Text + "','" + comboBoxReferenceDoctor.Text + "','" + textBoxComment.Text + "','" + comboBoxDepartments.Text + "','"+comboBoxRoom.Text+"','"+DateTime.Now.Date+"')", ClassDbManager.con);if (com.ExecuteNonQuery() > 0) { ResultEventArgs e = new ResultEventArgs(false, "New Entry added"); OnResult(e);//clear all values #region clear fields textBoxName.Text = ""; textBoxAge.Text = ""; textBoxAddress.Text = "Not Specified"; textBoxPhoneNumber.Text = ""; textBoxComment.Text = ""; #endregionreturntrue; }else { ResultEventArgs e = new ResultEventArgs(true, "Please Check your data"); OnResult(e);returnfalse; } }else { ResultEventArgs e = new ResultEventArgs(true, "New entry not added! Age not valid"); OnResult(e);returnfalse; }
P a g e | 60
}else { textBoxComment_LostFocus(newobject(), new RoutedEventArgs()); ResultEventArgs e = new ResultEventArgs(true, "New entry not added! Comment Cannot be empty"); OnResult(e);returnfalse; } }else {
textBoxName_LostFocus(newobject(), new RoutedEventArgs()); ResultEventArgs e = new ResultEventArgs(true, "New entry not added! Name Cannot be empty"); OnResult(e);returnfalse; }
}privatevoid comboBoxOP_SelectionChanged(object sender, SelectionChangedEventArgs e) {/* * name * age * sex * address * phone no * comment * department * doctor */
SqlDataAdapter ad = new SqlDataAdapter("SELECT NAME,AGE,SEX,ADDRESS,PHONE,COMMENT,DEPARTMENT,DOCTOR FROM OP WHERE ID=" + ((System.Data.DataRowView)(comboBoxOP.SelectedValue)).Row[0].ToString(), ClassDbManager.con); DataTable dt = new DataTable(); ad.Fill(dt);
{//select op No. into combobox SqlDataAdapter ad = new SqlDataAdapter("SELECT ID FROM OP", ClassDbManager.con); DataTable dt = new DataTable(); ad.Fill(dt); comboBoxOP.ItemsSource = dt.AsDataView(); comboBoxOP.DisplayMemberPath = "ID";
ad = new SqlDataAdapter("SELECT roomname FROM ROOMWARD",ClassDbManager.con); DataTable dt1 = new DataTable(); ad.Fill(dt1); comboBoxRoom.ItemsSource = dt1.AsDataView(); comboBoxRoom.DisplayMemberPath = "roomname";try { comboBoxRoom.SelectedIndex = 0; }catch { } }
privatevoid textBoxAge_TextChanged(object sender, TextChangedEventArgs e) {//Text Box Validation ClassAgeValidation val = new ClassAgeValidation(); ValidationResult res = val.Validate(textBoxAge.Text, null);if (!res.IsValid) { textBoxAge.Style = (Style)this.Resources["textBoxInError"]; textBoxAge.ToolTip = "Age is not valid"; }else { textBoxAge.Style = (Style)TextBox.StyleProperty.DefaultMetadata.DefaultValue; textBoxAge.ToolTip = null; } }
privatevoid Window_Loaded(object sender, RoutedEventArgs e) { ClassDbManager db = new ClassDbManager(global::WpfApplication2.Properties.Settings.Default.ConnectionString);
P a g e | 65
if (!db.OpenDB()) MessageBox.Show("Cannot Connect to Database", "Error", MessageBoxButton.OK, MessageBoxImage.Error);// Form1 frm = new Form1();// frm.Show();
privatevoid OPCons_Result(object sender, ResultEventArgs e) {//upadte bill datagrid with new cons fee SqlDataAdapter ad = new SqlDataAdapter("SELECT OPExpiryDays FROM Other", ClassDbManager.con); DataTable dt = new DataTable(); ad.Fill(dt);int maxDays = Convert.ToInt32(dt.Rows[0][0]);
int daysAfterLastVisit = 0;DateTime LastDate = newDateTime();
ad = new SqlDataAdapter("SELECT last_date FROM OP WHERE ID=" + e.Message, ClassDbManager.con); dt.Clear(); ad.Fill(dt);try { LastDate=Convert.ToDateTime(dt.Rows[0]["last_date"]); }catch{} daysAfterLastVisit = LastDate.Subtract(DateTime.Now.Date).Days;
void SetRoomRentDue(int ipno) { SqlDataAdapter ad=new SqlDataAdapter("SELECT DateLastPaid FROM IP where ipno="+ipno,ClassDbManager.con); DataTable dt = new DataTable(); ad.Fill(dt);DateTime date1=newDateTime();if (DateTime.TryParse(dt.Rows[0]["DateLastPaid"].ToString(),out date1)) { int days = 0;
P a g e | 72
days= date1.Subtract(DateTime.Now).Days; dt.Clear(); ad = new SqlDataAdapter("SELECT RoomorWardNo FROM ip WHERE ipno=" + ipno, ClassDbManager.con); ad.Fill(dt);
string ward_room = dt.Rows[0][0].ToString(); dt.Clear(); ad = new SqlDataAdapter("SELECT Rent FROM ROOMWARD where roomname='" + ward_room + "'", ClassDbManager.con); ad.Fill(dt);
decimal rent = Convert.ToDecimal(dt.Rows[0][0]);decimal due = rent * days;
ad = new SqlDataAdapter("UPDATE IPBILLITEM SET due=" + due, ClassDbManager.con); ad.Fill(dt); } }privatevoid Window_Loaded(object sender, RoutedEventArgs e) { SqlDataAdapter ad = new SqlDataAdapter("select ipno from ip", ClassDbManager.con); DataTable dt = new DataTable(); ad.Fill(dt); comboBox1.ItemsSource=dt.AsDataView(); comboBox1.DisplayMemberPath = "ipno"; }
WpfApplication2._D__DB_HOSPITAL_MDFDataSet1 _D__DB_HOSPITAL_MDFDataSet1 = ((WpfApplication2._D__DB_HOSPITAL_MDFDataSet1)(this.FindResource("_D__DB_HOSPITAL_MDFDataSet1")));// Load data into the table Ip. You can modify this code as needed. WpfApplication2._D__DB_HOSPITAL_MDFDataSet1TableAdapters.IpTableAdapter _D__DB_HOSPITAL_MDFDataSet1IpTableAdapter = new WpfApplication2._D__DB_HOSPITAL_MDFDataSet1TableAdapters.IpTableAdapter(); _D__DB_HOSPITAL_MDFDataSet1IpTableAdapter.Fill(_D__DB_HOSPITAL_MDFDataSet1.Ip); System.Windows.Data.CollectionViewSource ipViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("ipViewSource"))); ipViewSource.View.MoveCurrentToFirst(); WpfApplication2._D__DB_HOSPITAL_MDFDataSet2 _D__DB_HOSPITAL_MDFDataSet2 = ((WpfApplication2._D__DB_HOSPITAL_MDFDataSet2)(this.FindResource("_D__DB_HOSPITAL_MDFDataSet2")));// Load data into the table Pharmacy. You can modify this code as needed. WpfApplication2._D__DB_HOSPITAL_MDFDataSet2TableAdapters.PharmacyTableAdapter _D__DB_HOSPITAL_MDFDataSet2PharmacyTableAdapter = new WpfApplication2._D__DB_HOSPITAL_MDFDataSet2TableAdapters.PharmacyTableAdapter(); _D__DB_HOSPITAL_MDFDataSet2PharmacyTableAdapter.Fill(_D__DB_HOSPITAL_MDFDataSet2.Pharmacy); System.Windows.Data.CollectionViewSource pharmacyViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("pharmacyViewSource"))); pharmacyViewSource.View.MoveCurrentToFirst();
WpfApplication2._D__DB_HOSPITAL_MDFDataSet _D__DB_HOSPITAL_MDFDataSet = ((WpfApplication2._D__DB_HOSPITAL_MDFDataSet)(this.FindResource("_D__DB_HOSPITAL_MDFDataSet")));// Load data into the table Test. You can modify this code as needed. WpfApplication2._D__DB_HOSPITAL_MDFDataSetTableAdapters.TestTableAdapter _D__DB_HOSPITAL_MDFDataSetTestTableAdapter = new WpfApplication2._D__DB_HOSPITAL_MDFDataSetTableAdapters.TestTableAdapter(); _D__DB_HOSPITAL_MDFDataSetTestTableAdapter.Fill(_D__DB_HOSPITAL_MDFDataSet.Test); System.Windows.Data.CollectionViewSource testViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("testViewSource"))); testViewSource.View.MoveCurrentToFirst();
P a g e | 85
System.Windows.Data.CollectionViewSource classOPBillDataClassViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("classOPBillDataClassViewSource")));// Load data by setting the CollectionViewSource.Source property:// classOPBillDataClassViewSource.Source = [generic data source] WpfApplication2._D__DB_HOSPITAL_MDFDataSet1 _D__DB_HOSPITAL_MDFDataSet1 = ((WpfApplication2._D__DB_HOSPITAL_MDFDataSet1)(this.FindResource("_D__DB_HOSPITAL_MDFDataSet1")));// Load data into the table Ip. You can modify this code as needed. WpfApplication2._D__DB_HOSPITAL_MDFDataSet1TableAdapters.IpTableAdapter _D__DB_HOSPITAL_MDFDataSet1IpTableAdapter = new WpfApplication2._D__DB_HOSPITAL_MDFDataSet1TableAdapters.IpTableAdapter(); _D__DB_HOSPITAL_MDFDataSet1IpTableAdapter.Fill(_D__DB_HOSPITAL_MDFDataSet1.Ip); System.Windows.Data.CollectionViewSource ipViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("ipViewSource"))); ipViewSource.View.MoveCurrentToFirst(); }
privatevoid buttonAdd_Click(object sender, RoutedEventArgs e) {//add to dueif(comboBox1.SelectedIndex!=-1) {if(comboBoxIP.SelectedIndex!=-1) { SqlCommand com = new SqlCommand("UPDATE IPBILLITEM SET due=due+" + textBoxPrice.Text + " WHERE IPNO=" + comboBoxIP.Text, ClassDbManager.con);if (com.ExecuteNonQuery() > 0) { MessageBox.Show("Added to IP due", "Success", MessageBoxButton.OK, MessageBoxImage.Information); }else { MessageBox.Show("Cannot add to IP","Error",MessageBoxButton.OK,MessageBoxImage.Error); } } } }
privatevoid comboBox1_SelectionChanged(object sender, SelectionChangedEventArgs e) { SqlDataAdapter ad = new SqlDataAdapter("SELECT charge FROM test WHERE test='" + (((System.Data.DataRowView)((comboBox1.SelectedItem))).Row).ItemArray[0].ToString() + "'", ClassDbManager.con); DataTable dt = new DataTable(); ad.Fill(dt); textBoxPrice.Text = dt.Rows[0]["charge"].ToString(); }
DataTable dtGrid = new DataTable();
P a g e | 86
}}
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Data.SqlClient;using System.Text;using System.Windows.Forms;using System.IO;
namespace WpfApplication2{ public partial class FormID : Form { public FormID() { InitializeComponent(); } string imgSource = ""; private void button1_Click(object sender, EventArgs e) { }
private void buttonSave_Click(object sender, RoutedEventArgs e) { if (selectedButton == SelectedButton.OP) { OPReg.SubmitValues(); } else if (selectedButton == SelectedButton.Consultation) {
P a g e | 89
//do code for date updation if (OPCons.SelectedOP > 0) { SqlCommand com = new SqlCommand("UPDATE OP SET LAST_DATE='" + DateTime.Now.Date + "' WHERE id=" + OPCons.SelectedOP, ClassDbManager.con); if (com.ExecuteNonQuery() > 0) { Brush b = new SolidColorBrush(Colors.Black); StatusLabel.Foreground = b; StatusLabel.Content = "OP Status updated"; } else { Brush b = new SolidColorBrush(Colors.Red); StatusLabel.Foreground = b; StatusLabel.Content = "OP Status cannot be updated"; } } else { Brush b = new SolidColorBrush(Colors.Red); StatusLabel.Foreground = b; StatusLabel.Content = "No OP Selected!"; } } else if (selectedButton == SelectedButton.IP) { userControlIP1.SubmitValues(); } }
private void OPReg_Error(object sender, ResultEventArgs e) { if (e.ErrorOccured) { Brush b = new SolidColorBrush(Colors.Red); StatusLabel.Foreground = b; StatusLabel.Content = e.Message; } else { Brush b = new SolidColorBrush(Colors.White); StatusLabel.Foreground = b; StatusLabel.Content = e.Message; }
private void buttonBill_Click_1(object sender, RoutedEventArgs e) { //pass it to report viewer DataTable dt = ((DataView)dataGrid1.ItemsSource).Table; FormOPBill opBill = new FormOPBill(dt); opBill.Show(); }
private void userControlIP1_Result(object sender, ResultEventArgs e) { if (e.ErrorOccured) { Brush b = new SolidColorBrush(Colors.Red); StatusLabel.Foreground = b; StatusLabel.Content = e.Message; } else { Brush b = new SolidColorBrush(Colors.White); StatusLabel.Foreground = b; StatusLabel.Content = e.Message; } }
private void buttonIPBill_Click(object sender, RoutedEventArgs e) { WindowBill bill = new WindowBill(); bill.ShowDialog(); }
private void label2_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { if (IsAdmin) { WindowMaster master = new WindowMaster(); master.ShowDialog();
P a g e | 92
} else { MessageBox.Show("Yo dont have privilage to perform this action!", "Access denied", MessageBoxButton.OK, MessageBoxImage.Exclamation); } }
private void OPCons_Result(object sender, ResultEventArgs e) { //upadte bill datagrid with new cons fee SqlDataAdapter ad = new SqlDataAdapter("SELECT OPExpiryDays FROM Other", ClassDbManager.con); DataTable dt = new DataTable(); ad.Fill(dt); int maxDays = Convert.ToInt32(dt.Rows[0][0]);
int daysAfterLastVisit = 0; DateTime LastDate = new DateTime(); ad = new SqlDataAdapter("SELECT last_date FROM OP WHERE ID=" + e.Message, ClassDbManager.con); dt.Clear(); ad.Fill(dt); try { LastDate=Convert.ToDateTime(dt.Rows[0]["last_date"]); } catch{} daysAfterLastVisit = LastDate.Subtract(DateTime.Now.Date).Days;
using System.Windows.Media.Imaging;using System.Windows.Navigation;using System.Windows.Shapes;
namespace WpfApplication2{ public delegate void ResultEventHandler(object sender, ResultEventArgs e); public partial class UserControl1 : UserControl { public UserControl1() { InitializeComponent(); } public event ResultEventHandler Result; protected virtual void OnResult(ResultEventArgs e) { ResultEventHandler handler = Result; if (handler != null) { handler(this, e); } }
SqlDataAdapter ad = new SqlDataAdapter(); SqlCommand com = new SqlCommand(); DataTable dt = new DataTable();
public bool SubmitValues() { /* *Validate all columns\ * *Name NOT NULL √ *Age NOT NULL,INTEGER √ *Address Anything...√ *Phone Number Anything...√ *Comment NOT NULL.√ *Department Fixed√ *Doctor Fixed√ *Last Consultastion Date Fixed√ * *Save √ * *Name, Age, Sex(convert to varchar),Address,Phone Number,Comment,Department,Doctor√ * * *Display Op √ *Print OP Card * */ ClassDbManager db = new ClassDbManager(); if (textBoxName.Text != "")//name cannot be empty { if (textBoxComment.Text != "") //Comment Cannot be emty {
P a g e | 95
if (textBoxAge.Text != "")//Age cannot be empty { //insert values string sex = ""; if ((bool)radioButtonFemale.IsChecked) sex = "Female"; else sex = "Male";
if (db.Insert(fields, table, values) > 0)//add successful { ResultEventArgs e = new ResultEventArgs(false, "New Entry added"); OnResult(e); WindowNewOPAdded wnd = new WindowNewOPAdded();//show quick info wnd.ShowDialog(); //clear all values #region clear fields textBoxName.Text = ""; textBoxAge.Text = ""; textBoxAddress.Text = "Not Specified"; textBoxPhoneNumber.Text = ""; textBoxComment.Text = ""; #endregion return true; } else// Cannot add entry { ResultEventArgs e = new ResultEventArgs(true, "Please Check your data"); OnResult(e); return false; } } else //Age empty { ResultEventArgs e = new ResultEventArgs(true, "New entry not added! Age not valid"); OnResult(e); return false; } } else //Comment Empty { textBoxComment_LostFocus(new object(), new RoutedEventArgs()); ResultEventArgs e = new ResultEventArgs(true, "New entry not added! Comment Cannot be empty"); OnResult(e);
P a g e | 96
return false; } } else //Name empty { textBoxName_LostFocus(new object(), new RoutedEventArgs()); ResultEventArgs e = new ResultEventArgs(true, "New entry not added! Name Cannot be empty"); OnResult(e); return false; } }
/------------------------------------------------------------------------------// <auto-generated>// This code was generated by a tool.// Runtime Version:4.0.30319.1//// Changes to this file may cause incorrect behavior and will be lost if// the code is regenerated.// </auto-generated>//------------------------------------------------------------------------------
#pragma warning disable 1591
namespace WpfApplication2 { /// <summary> ///Represents a strongly typed in-memory cache of data. ///</summary> [global::System.Serializable()] [global::System.ComponentModel.DesignerCategoryAttribute("code")] [global::System.ComponentModel.ToolboxItem(true)] [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedDataSetSchema")] [global::System.Xml.Serialization.XmlRootAttribute("HospitalDataSet1")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.DataSet")] public partial class HospitalDataSet1 : global::System.Data.DataSet { private OPBILLMASTERDataTable tableOPBILLMASTER; private global::System.Data.SchemaSerializationMode _schemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
global::System.Data.ConnectionState previousConnectionState = this.Adapter.UpdateCommand.Connection.State; if (((this.Adapter.UpdateCommand.Connection.State & global::System.Data.ConnectionState.Open) != global::System.Data.ConnectionState.Open)) { this.Adapter.UpdateCommand.Connection.Open(); } try { int returnValue = this.Adapter.UpdateCommand.ExecuteNonQuery(); return returnValue; } finally { if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) { this.Adapter.UpdateCommand.Connection.Close(); } } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)] public virtual int Update(global::System.Nullable<decimal> Amount, string Original_BillItem, global::System.Nullable<decimal> Original_Amount) { return this.Update(Original_BillItem, Amount, Original_BillItem, Original_Amount); } } /// <summary> ///TableAdapterManager is used to coordinate TableAdapters in the dataset to enable Hierarchical Update scenarios ///</summary> [global::System.ComponentModel.DesignerCategoryAttribute("code")] [global::System.ComponentModel.ToolboxItem(true)] [global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerDesigner, Microsoft.VSD" + "esigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapterManager")] public partial class TableAdapterManager : global::System.ComponentModel.Component {
P a g e | 123
private UpdateOrderOption _updateOrder; private OPBILLMASTERTableAdapter _oPBILLMASTERTableAdapter; private bool _backupDataSetBeforeUpdate; private global::System.Data.IDbConnection _connection; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public UpdateOrderOption UpdateOrder { get { return this._updateOrder; } set { this._updateOrder = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] [global::System.ComponentModel.EditorAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerPropertyEditor, Microso" + "ft.VSDesigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3" + "a", "System.Drawing.Design.UITypeEditor")] public OPBILLMASTERTableAdapter OPBILLMASTERTableAdapter { get { return this._oPBILLMASTERTableAdapter; } set { this._oPBILLMASTERTableAdapter = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public bool BackupDataSetBeforeUpdate { get { return this._backupDataSetBeforeUpdate; } set { this._backupDataSetBeforeUpdate = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
P a g e | 124
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] [global::System.ComponentModel.Browsable(false)] public global::System.Data.IDbConnection Connection { get { if ((this._connection != null)) { return this._connection; } if (((this._oPBILLMASTERTableAdapter != null) && (this._oPBILLMASTERTableAdapter.Connection != null))) { return this._oPBILLMASTERTableAdapter.Connection; } return null; } set { this._connection = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] [global::System.ComponentModel.Browsable(false)] public int TableAdapterInstanceCount { get { int count = 0; if ((this._oPBILLMASTERTableAdapter != null)) { count = (count + 1); } return count; } } /// <summary> ///Update rows in top-down order. ///</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] private int UpdateUpdatedRows(HospitalDataSet1 dataSet, global::System.Collections.Generic.List<global::System.Data.DataRow> allChangedRows, global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows) { int result = 0; if ((this._oPBILLMASTERTableAdapter != null)) { global::System.Data.DataRow[] updatedRows = dataSet.OPBILLMASTER.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent); updatedRows = this.GetRealUpdatedRows(updatedRows, allAddedRows); if (((updatedRows != null)
P a g e | 125
&& (0 < updatedRows.Length))) { result = (result + this._oPBILLMASTERTableAdapter.Update(updatedRows)); allChangedRows.AddRange(updatedRows); } } return result; } /// <summary> ///Insert rows in top-down order. ///</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] private int UpdateInsertedRows(HospitalDataSet1 dataSet, global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows) { int result = 0; if ((this._oPBILLMASTERTableAdapter != null)) { global::System.Data.DataRow[] addedRows = dataSet.OPBILLMASTER.Select(null, null, global::System.Data.DataViewRowState.Added); if (((addedRows != null) && (0 < addedRows.Length))) { result = (result + this._oPBILLMASTERTableAdapter.Update(addedRows)); allAddedRows.AddRange(addedRows); } } return result; } /// <summary> ///Delete rows in bottom-up order. ///</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] private int UpdateDeletedRows(HospitalDataSet1 dataSet, global::System.Collections.Generic.List<global::System.Data.DataRow> allChangedRows) { int result = 0; if ((this._oPBILLMASTERTableAdapter != null)) { global::System.Data.DataRow[] deletedRows = dataSet.OPBILLMASTER.Select(null, null, global::System.Data.DataViewRowState.Deleted); if (((deletedRows != null) && (0 < deletedRows.Length))) { result = (result + this._oPBILLMASTERTableAdapter.Update(deletedRows)); allChangedRows.AddRange(deletedRows); } }
P a g e | 126
return result; } /// <summary> ///Remove inserted rows that become updated rows after calling TableAdapter.Update(inserted rows) first ///</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] private global::System.Data.DataRow[] GetRealUpdatedRows(global::System.Data.DataRow[] updatedRows, global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows) { if (((updatedRows == null) || (updatedRows.Length < 1))) { return updatedRows; } if (((allAddedRows == null) || (allAddedRows.Count < 1))) { return updatedRows; } global::System.Collections.Generic.List<global::System.Data.DataRow> realUpdatedRows = new global::System.Collections.Generic.List<global::System.Data.DataRow>(); for (int i = 0; (i < updatedRows.Length); i = (i + 1)) { global::System.Data.DataRow row = updatedRows[i]; if ((allAddedRows.Contains(row) == false)) { realUpdatedRows.Add(row); } } return realUpdatedRows.ToArray(); } /// <summary> ///Update all changes to the dataset. ///</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public virtual int UpdateAll(HospitalDataSet1 dataSet) { if ((dataSet == null)) { throw new global::System.ArgumentNullException("dataSet"); } if ((dataSet.HasChanges() == false)) { return 0; } if (((this._oPBILLMASTERTableAdapter != null) && (this.MatchTableAdapterConnection(this._oPBILLMASTERTableAdapter.Connection) == false))) { throw new global::System.ArgumentException("All TableAdapters managed by a TableAdapterManager must use the same connection s" + "tring.");
P a g e | 127
} global::System.Data.IDbConnection workConnection = this.Connection; if ((workConnection == null)) { throw new global::System.ApplicationException("TableAdapterManager contains no connection information. Set each TableAdapterMana" + "ger TableAdapter property to a valid TableAdapter instance."); } bool workConnOpened = false; if (((workConnection.State & global::System.Data.ConnectionState.Broken) == global::System.Data.ConnectionState.Broken)) { workConnection.Close(); } if ((workConnection.State == global::System.Data.ConnectionState.Closed)) { workConnection.Open(); workConnOpened = true; } global::System.Data.IDbTransaction workTransaction = workConnection.BeginTransaction(); if ((workTransaction == null)) { throw new global::System.ApplicationException("The transaction cannot begin. The current data connection does not support transa" + "ctions or the current state is not allowing the transaction to begin."); } global::System.Collections.Generic.List<global::System.Data.DataRow> allChangedRows = new global::System.Collections.Generic.List<global::System.Data.DataRow>(); global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows = new global::System.Collections.Generic.List<global::System.Data.DataRow>(); global::System.Collections.Generic.List<global::System.Data.Common.DataAdapter> adaptersWithAcceptChangesDuringUpdate = new global::System.Collections.Generic.List<global::System.Data.Common.DataAdapter>(); global::System.Collections.Generic.Dictionary<object, global::System.Data.IDbConnection> revertConnections = new global::System.Collections.Generic.Dictionary<object, global::System.Data.IDbConnection>(); int result = 0; global::System.Data.DataSet backupDataSet = null; if (this.BackupDataSetBeforeUpdate) { backupDataSet = new global::System.Data.DataSet(); backupDataSet.Merge(dataSet); } try { // ---- Prepare for update ----------- // if ((this._oPBILLMASTERTableAdapter != null)) { revertConnections.Add(this._oPBILLMASTERTableAdapter, this._oPBILLMASTERTableAdapter.Connection); this._oPBILLMASTERTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(workConnection));
P a g e | 128
this._oPBILLMASTERTableAdapter.Transaction = ((global::System.Data.SqlClient.SqlTransaction)(workTransaction)); if (this._oPBILLMASTERTableAdapter.Adapter.AcceptChangesDuringUpdate) { this._oPBILLMASTERTableAdapter.Adapter.AcceptChangesDuringUpdate = false; adaptersWithAcceptChangesDuringUpdate.Add(this._oPBILLMASTERTableAdapter.Adapter); } } // //---- Perform updates ----------- // if ((this.UpdateOrder == UpdateOrderOption.UpdateInsertDelete)) { result = (result + this.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows)); result = (result + this.UpdateInsertedRows(dataSet, allAddedRows)); } else { result = (result + this.UpdateInsertedRows(dataSet, allAddedRows)); result = (result + this.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows)); } result = (result + this.UpdateDeletedRows(dataSet, allChangedRows)); // //---- Commit updates ----------- // workTransaction.Commit(); if ((0 < allAddedRows.Count)) { global::System.Data.DataRow[] rows = new System.Data.DataRow[allAddedRows.Count]; allAddedRows.CopyTo(rows); for (int i = 0; (i < rows.Length); i = (i + 1)) { global::System.Data.DataRow row = rows[i]; row.AcceptChanges(); } } if ((0 < allChangedRows.Count)) { global::System.Data.DataRow[] rows = new System.Data.DataRow[allChangedRows.Count]; allChangedRows.CopyTo(rows); for (int i = 0; (i < rows.Length); i = (i + 1)) { global::System.Data.DataRow row = rows[i]; row.AcceptChanges(); } } } catch (global::System.Exception ex) { workTransaction.Rollback(); // ---- Restore the dataset ----------- if (this.BackupDataSetBeforeUpdate) { global::System.Diagnostics.Debug.Assert((backupDataSet != null)); dataSet.Clear();
P a g e | 129
dataSet.Merge(backupDataSet); } else { if ((0 < allAddedRows.Count)) { global::System.Data.DataRow[] rows = new System.Data.DataRow[allAddedRows.Count]; allAddedRows.CopyTo(rows); for (int i = 0; (i < rows.Length); i = (i + 1)) { global::System.Data.DataRow row = rows[i]; row.AcceptChanges(); row.SetAdded(); } } } throw ex; } finally { if (workConnOpened) { workConnection.Close(); } if ((this._oPBILLMASTERTableAdapter != null)) { this._oPBILLMASTERTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(revertConnections[this._oPBILLMASTERTableAdapter])); this._oPBILLMASTERTableAdapter.Transaction = null; } if ((0 < adaptersWithAcceptChangesDuringUpdate.Count)) { global::System.Data.Common.DataAdapter[] adapters = new System.Data.Common.DataAdapter[adaptersWithAcceptChangesDuringUpdate.Count]; adaptersWithAcceptChangesDuringUpdate.CopyTo(adapters); for (int i = 0; (i < adapters.Length); i = (i + 1)) { global::System.Data.Common.DataAdapter adapter = adapters[i]; adapter.AcceptChangesDuringUpdate = true; } } } return result; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected virtual void SortSelfReferenceRows(global::System.Data.DataRow[] rows, global::System.Data.DataRelation relation, bool childFirst) { global::System.Array.Sort<global::System.Data.DataRow>(rows, new SelfReferenceComparer(relation, childFirst)); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
/// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing)
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.OP = new System.Windows.Forms.TabControl(); this.tabPage1 = new System.Windows.Forms.TabPage(); this.dataGridView1 = new System.Windows.Forms.DataGridView(); this.iDDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.nAMEDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.aGEDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.sEXDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.aDDRESSDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.cOMMENTDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.pHONEDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dATEDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.lASTDATEDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dOCTORDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dEPARTMENTDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.oPBindingSource = new System.Windows.Forms.BindingSource(this.components); this.hospitalDataSet = new WpfApplication2.HospitalDataSet(); this.oPBILLMASTERBindingSource = new System.Windows.Forms.BindingSource(this.components); this.hospitalDataSet1 = new WpfApplication2.HospitalDataSet1(); this.tabPage3 = new System.Windows.Forms.TabPage(); this.dataGridView3 = new System.Windows.Forms.DataGridView(); this.ipnoDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.consDateDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.nameDataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.ageDataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
P a g e | 134
this.sexDataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.addressDataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.phoneDataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.refdrDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.complaintDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.roomOrWardnoDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.departmentDataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dateLastPaidDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.ipBindingSource = new System.Windows.Forms.BindingSource(this.components); this.hospitalDataSet2 = new WpfApplication2.HospitalDataSet2(); this.tabPage4 = new System.Windows.Forms.TabPage(); this.dataGridView4 = new System.Windows.Forms.DataGridView(); this.testDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.chargeDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.testBindingSource = new System.Windows.Forms.BindingSource(this.components); this.hospitalDataSet3 = new WpfApplication2.HospitalDataSet3(); this.tabPage5 = new System.Windows.Forms.TabPage(); this.dataGridView5 = new System.Windows.Forms.DataGridView(); this.iDDataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.itemDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.quantityDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.rateDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.pharmacyBindingSource = new System.Windows.Forms.BindingSource(this.components); this.hospitalDataSet4 = new WpfApplication2.HospitalDataSet4(); this.oPTableAdapter = new WpfApplication2.HospitalDataSetTableAdapters.OPTableAdapter(); this.oPBILLMASTERTableAdapter = new WpfApplication2.HospitalDataSet1TableAdapters.OPBILLMASTERTableAdapter(); this.ipTableAdapter = new WpfApplication2.HospitalDataSet2TableAdapters.IpTableAdapter(); this.testTableAdapter = new WpfApplication2.HospitalDataSet3TableAdapters.TestTableAdapter(); this.pharmacyTableAdapter = new WpfApplication2.HospitalDataSet4TableAdapters.PharmacyTableAdapter(); this.tabPage2 = new System.Windows.Forms.TabPage(); this.tabPage6 = new System.Windows.Forms.TabPage(); this.dataGridView2 = new System.Windows.Forms.DataGridView(); this.hospitalDataSet5 = new WpfApplication2.HospitalDataSet5(); this.rOOMWARDBindingSource = new System.Windows.Forms.BindingSource(this.components);
P a g e | 135
this.rOOMWARDTableAdapter = new WpfApplication2.HospitalDataSet5TableAdapters.ROOMWARDTableAdapter(); this.roomNameDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.noOfBedsDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.rentDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.bedsFreeDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.roomTypeDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridView6 = new System.Windows.Forms.DataGridView(); this.hospitalDataSet6 = new WpfApplication2.HospitalDataSet6(); this.dOCTORSBindingSource = new System.Windows.Forms.BindingSource(this.components); this.dOCTORSTableAdapter = new WpfApplication2.HospitalDataSet6TableAdapters.DOCTORSTableAdapter(); this.iDNODataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.nAMEDataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.pHONENUMBERDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dETAILSDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.cONSULTATIONFEEDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dEPARTMENTDataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.OP.SuspendLayout(); this.tabPage1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.oPBindingSource)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.hospitalDataSet)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.oPBILLMASTERBindingSource)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.hospitalDataSet1)).BeginInit(); this.tabPage3.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView3)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.ipBindingSource)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.hospitalDataSet2)).BeginInit(); this.tabPage4.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView4)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.testBindingSource)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.hospitalDataSet3)).BeginInit(); this.tabPage5.SuspendLayout();
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Windows;
P a g e | 150
using System.Windows.Controls;using System.Windows.Data;using System.Windows.Documents;using System.Windows.Input;using System.Windows.Media;using System.Windows.Media.Imaging;using System.Windows.Shapes;using System.Data;using System.Data.SqlClient;
namespace WpfApplication2{ /// <summary> /// Interaction logic for WindowPharmacy.xaml /// </summary> public partial class WindowPharmacy : Window { public WindowPharmacy() { InitializeComponent(); } DataTable dt = new DataTable();
void MakeDataTable(DataTable DT) { DT.Columns.Add("Item"); DT.Columns.Add("Quantity"); } private void Window_Loaded(object sender, RoutedEventArgs e) { WpfApplication2._D__DB_HOSPITAL_MDFDataSet1 _D__DB_HOSPITAL_MDFDataSet1 = ((WpfApplication2._D__DB_HOSPITAL_MDFDataSet1)(this.FindResource("_D__DB_HOSPITAL_MDFDataSet1"))); // Load data into the table Ip. You can modify this code as needed. WpfApplication2._D__DB_HOSPITAL_MDFDataSet1TableAdapters.IpTableAdapter _D__DB_HOSPITAL_MDFDataSet1IpTableAdapter = new WpfApplication2._D__DB_HOSPITAL_MDFDataSet1TableAdapters.IpTableAdapter(); _D__DB_HOSPITAL_MDFDataSet1IpTableAdapter.Fill(_D__DB_HOSPITAL_MDFDataSet1.Ip); System.Windows.Data.CollectionViewSource ipViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("ipViewSource"))); ipViewSource.View.MoveCurrentToFirst(); WpfApplication2._D__DB_HOSPITAL_MDFDataSet2 _D__DB_HOSPITAL_MDFDataSet2 = ((WpfApplication2._D__DB_HOSPITAL_MDFDataSet2)(this.FindResource("_D__DB_HOSPITAL_MDFDataSet2"))); // Load data into the table Pharmacy. You can modify this code as needed. WpfApplication2._D__DB_HOSPITAL_MDFDataSet2TableAdapters.PharmacyTableAdapter _D__DB_HOSPITAL_MDFDataSet2PharmacyTableAdapter = new WpfApplication2._D__DB_HOSPITAL_MDFDataSet2TableAdapters.PharmacyTableAdapter(); _D__DB_HOSPITAL_MDFDataSet2PharmacyTableAdapter.Fill(_D__DB_HOSPITAL_MDFDataSet2.Pharmacy);
namespace WpfApplication2{ /// <summary> /// Interaction logic for WindowLogin.xaml /// </summary> public partial class WindowLogin : Window { public WindowLogin() { InitializeComponent(); }
bool DetectedUser = false;
private void buttonLogin_Click(object sender, RoutedEventArgs e) { ClassDbManager db = new ClassDbManager(global::WpfApplication2.Properties.Settings.Default.ConnectionString);
P a g e | 153
if (!db.OpenDB()) MessageBox.Show("Cannot Connect to Database", "Error", MessageBoxButton.OK, MessageBoxImage.Error); SqlCommand com = new SqlCommand(); com.Connection = ClassDbManager.con; com.CommandText = "SELECT isadmin FROM users WHERE username='" + textBox1.Text + "' AND password='" + passwordBox1.Password + "'"; SqlDataAdapter ad = new SqlDataAdapter(); DataTable dt = new DataTable(); ad.SelectCommand = com; ad.Fill(dt);
if (dt.Rows.Count > 0) { DetectedUser = true; if (dt.Rows[0][0].ToString().Trim().ToLower() == "false") { Window1 wnd = new Window1(Convert.ToBoolean(dt.Rows[0][0].ToString().Trim().ToLower())); label2.IsEnabled = false; wnd.Show(); this.Close(); } else { Window1 wnd = new Window1(Convert.ToBoolean(dt.Rows[0][0].ToString().Trim().ToLower())); label2.IsEnabled = false; wnd.Show(); this.Close(); } } else { MessageBox.Show("Invalid user name or password","Login failed",MessageBoxButton.OK,MessageBoxImage.Exclamation); } }