Sunteți pe pagina 1din 97

DESIGN & IMPLEMENTATION OF VEHICLE MANAGEMENT SYSTEM

A project report Submitted to Rajiv Gandhi Proudyogiki Vishwavidyalaya, Bhopal Towards partial fulfillment of The Degree of Bachelor of Engineering In Computer Science and Engineering 2011-2012

By Gurdeep .S. Bhatia (cs-38) & Kunal Mehta (cs-51)


Project Incharge
Ms. Kavita Namdev

Guided by
Ms. Juhi Kanungo

Acropolis Institute of Technology & Research, Indore (M.P.)


Department of Computer Science Engineering & Information Technology

ACROPOLIS INSTITUTE OF TECHNOLOGY & RESEARCH, INDORE

CERTIFICATE

This is to certify that Mr. Gurdeep Singh Bhatia (CS-38) & Mr. Kunal Mehta (CS-51) B.E. (Computer Science and Engineering) Third year 2011-2012 of Computer Science and Engineering department of this Institute have completed the project work entitled Vehicle Management System based on syllabus.

Mr. Sanjay Bansal Professor & Head, CSE

Project Coordinator
Ms. Kavita Namdev

Dr. Kamal Bharani Principal AITR, Indore

ACROPOLIS INSTITUTE OF TECHNOLOGY & RESEARCH, INDORE

CERTIFICATE

This is to certify that the project work entitled Vehicle Management System submitted by Mr. Gurdeep Singh Bhatia (CS-38) & Mr. Kunal Mehta (CS-51), B.E. (Computer Science and Engineering) Third year 2011-2012 of Computer Science and Engineering Department of this institute based on syllabus and is approved as partial fulfillment for the award of the Bachelor of Engineering (in Computer Science and Engineering) Degree by Rajiv Gandhi Proudyogiki Vishwavidyalaya, Bhopal.

Internal Examiner Date:

External Examiner Date:

ACKNOWLEDGEMENT

There are two ways of spreading the light, to be a candle, or the mirror, which reflects it. In relation to the light of knowledge, this work carried out by us is just a mirror. There are some candles on the other side of the mirror. We would like to avail this opportunity to express our sincere thanks to all those who helped us in making this project. Even a most vivid collection of words, yield to express our heart fully thank towards one and all to have successfully assisted us in our expenditure of carrying out this project. We wish to express our deep sense of gratitude to H.O.D Mr. Sanjay Bansal, our project coordinator Ms. Kavita Namdev our project guide Ms. Juhi Kanungo and the whole faculty members of the department of Computer Science for encouraging and giving moral support, not only regarding this project but also throughout our studies at this institute. Also, to all my fellow classmates, friends and well wishers for their support and cooperation towards us.

Gurdeep Singh Bhatia (CS-38) Kunal Mehta (CS-51)

CONTENTS
Chapter 1 Title Introduction 1.1 Purpose 1.2 Objectives 1.3 Scope 1.4 Problem Statement 1.4.1 Existing System 1.4.2Limitations 1.5 Proposed System 1.6 Intended Audience Literature Survey 2.1 Technologies 2.2 Tools Analysis 3.1 Detailed Statement of Problem 3.1.1 Problem Specification 3.1.2 Performance definition 3.1.3 Purpose 3.2 Functional Requirements 3.3 Non Functional Requirements 3.4 Use Case Model 3.2.1 Use Case Diagram 3.2.2 Use Case Specification 3.5 Activity Diagram 3.6 Class Diagram Design 4.1 Functional Model 4.1.1 Data Flow Diagram 4.2 Data Model 4.2.1 Entity Relationship Diagram 4.2.2 Database Design Page No. 12

15

22

28

5 6

Application Interface 5.1 Input / Output Interfaces Test Case Design 6.1 White Box Testing 6.2 Unit Testing 6.3 Integration Testing 6.2 System Testing 6.2 Black box Testing Output Screens 7.1 Screenshots of Code Screens 7.2 Important Coding Conclusion 7.1 Inferences Drawn 7.2 Future Scope 7.3 Limitations Users Manual References

39 42

44

73

A B

75 81

ABSTRACT

ABSTRACT
1. Aim:
This software design document describes the architecture and system design of Vehicle Management System (VMS) and provides an overview of the VMS system implementation. Its main purpose is to Provide the link between the Functional Specification and the detailed Design document. Detail the functionality which will be provided by each component or group of component and show how the various components interact in the design. Provide a basis for the VMS systems detailed design and development

2. Scope:
The Application Design outline in this document builds upon the scope define in the Requirement phase. Additionally this document provides mainly the details of the vehicle management system. Vehicle Management System is a complete solution for company's offering complete operational management for the day-to-day activities which are helpful to both the Management and the Customers. It is a Daily Accounting Software for all types of vehicles like in Transport industry, private or public service, cars, taxis, coaches, vans, picks up trucks, buses, trucks, rental services etc

3. Objectives:
Vehicle Management System is software which is helpful for bus operators, who wants to operate many bus trips in a day. Vehicle Management System is a desktop application for Windows operating systems which focused in the area of adding, editing and deleting the passengers, staff and the bus routes. In this software a manager can manage the vehicle routes and the staff, passengers details; he can also appoint other managers and booking clerk. He can add a

bus and its details including bus route details. He can also add the details of the staff and their duty time in the system

4. Formal Description:
Vehicle Management System is a complete solution for company's offering complete operational management for the day-to-day activities which are helpful to both the Management and the Customers. It is a Daily Accounting Software for all types of vehicles like in Transport industry, private or public service, cars, taxis, coaches, vans, picks up trucks, buses, trucks, rental services etc. It is most ideal for bus & taxi depots, garages, scrap yards, vehicle recovery businesses and other vehicle management companies. There are 2 intended users in our software. Manager Booking clerk

The manager can update the database time to time whenever required. He can also add new user as a manager or a booking clerk. The Booking clerk looks after the ticket selling and payment processes, registers passengers, baggage etc.

5. Modular Design:
VMS is a Management Information System specially designed for vehicle maintenance, job dispatching and route planning. VMS is a desktop-based system. Followings are the product features of VMS: Bus maintenance system Route Management Employee Management Passenger Management Bus maintenance system In Vehicle module a user can add a new Vehicle details to the database. Route Management Route Management module deals with the route management of the Vehicle. Employee Management In Employee Management personal details of employee can added to database. Passenger Management Details of every passenger are stored in the system

6. Technical Details:
Hardware Requirements:

For Windows 95 based computers , a 486 / 66 MHz or higher processor with 8MB

For Windows 98 based computers , a 500/88MHz or higher processor with 32 Mb of RAM

For Windows NT based computers , a 488 / 66 MHz or higher processor with 16 MB of RAM

For Windows 2000, XP based computers , a 700/850 MHz or higher processor with 512 MB of Ram

Software Requirements:

Operating System Language Database

: Windows NT, 98, 2000, XP, 7, Vista. : Java 2 Runtime Environment(jdk) : MS Access2007

CHAPTER 1 INTRODUCTION

INTRODUCTION

1.1 Purpose
Vehicle Management System is software which is helpful for vehicle operators, who wants to operate many trips in a day. In this software a manager can manage the vehicle routes and the staff, passengers details; he can also appoint other managers and booking clerk. The proposed system is very useful for the operators and passengers. This avoids the overheads for the operators. They can minimize the working stress and can keep essential documents related to the vehicle and the passengers as a softcopy. The advantage of the proposed system is the reduction in the cost of the office equipments and the transaction is done quickly. Any operator can answer if any seats for a particular route in a particular day are available or not

1.2 Objective
The goal of this project is basically management convenience. This also does not require special efforts from the management staff. It reduces manpower, time and cost. Vehicle Management System is a desktop application written for Windows operating systems which focused in the area of adding, editing and deleting the passengers, staff and the vehicle routes all the data will be stored with security. Genuineness is assured as all booking information is stored in the database.

1.3 Scope

Vehicle Management System is a complete solution for company's offering complete operational management for the day-to-day activities which are helpful to both the Management and the Customers. It is a Daily Accounting Software for all types of vehicles like in Transport industry, private or public service, cars, taxis, coaches, vans, picks up trucks, buses, trucks, rental services etc. It is most ideal for bus & taxi depots, garages, scrap yards, vehicle recovery businesses and other vehicle management companies

1.4Problem Statement 1.4.1 Existing System


In the current system all the jobs of the vehicle route management is done manually. This Is very difficult to the operators who want to handle hundreds of trips in a day. In current system there is no way to store the details of the employees working in the buses and taxis, So many complaints against staff can arise from the passengers side. More over there is no detailed record of the vehicle's routes in which they service

1.4.2Limitations
Slow access to database More probability of error Less Storage Capacity No Search facility Difficult to search old records Difficult to update records

1.5 Proposed System


The proposed system is very useful for the operators and passengers. This avoids the overheads for the operators. They can minimize the working stress and can keep essential documents related to the bus and the passengers as a softcopy. The advantage of the proposed system is the reduction in the cost of the office equipments and the transaction is done quickly. Any operator can answer if any seats for a particular route in a particular day are available or not.

1.6 Intended Audience


There are 2 intended users in our software. Manager Booking clerk

The manager can update the database time to time whenever required. He can also add new user as a manager or a booking clerk.

The Booking clerk looks after the ticket selling and payment processes, registers passengers, baggage etc.

CHAPTER 2 LITERATURE SURVEY

LITERATURE SURVEY

2.1 Technologies Java Development Kit (1.6):


When the java programming language was introduced in 1995, the only development tool available was the JDK from sun. This set of command line tools makes it possible to write, compile and debug JAVA programs. However, the JDK is the far cry from integrated development environment such as Visual Basic and Borland C++. An integrated development environment (IDE) is software that combines several development tools into a single, cohesive package. The assortment usually includes a source code editor, compiler debugger and other utilities. These tools work together the development process; most packages are highly visual and rely on windows, drag and drop, and other graphical elements. The goal is to make software design faster, more efficient, and easier to debug. MAIN PROPERTIES OF JAVA: JAVA is object oriented :

Object oriented programming is a power full way of organizing and developing software. Object oriented programming uses a set of components called objects. These objects exist independently of each other and communicate with each other. Thats why object oriented program are more adoptable and more bug proof. JAVA is small and simple:

The most complex parts of c++ were excluded from java, such as pointers and memory management. These elements are complicated to use. JAVA is safe:

Another thing essential to javas success is that it is safe. Java provides security and several different levels. Before a java program is run, a verifier check each by code to make sure nothing suspicious is going on.

JAVA is platform independent:

Platform independence is another way of saying that java is architectural neutral. The basically means that java programs dont care what system they are running on. JAVA is architectural neutral:

The JAVA designers made several hard decisions in the java languages and JVM is an attempt to alter the situation programs not running on the same machine after few days. Their goal was Write once; run anywhere, anytime, forever. JAVA is Distributed

Java is designed for the distributed environment of Internet because it handles TCP/IP protocols. The feature of inter-address-space messaging is done with the help of package Remote Method Invocation (RMI). This feature brings an unparalleled level of instructions to the client/server programming. JAVA is dynamic

Java programs carry with them substantial amounts of run time type information that is use to verify and resolve accesses to objects at run time. This is crucial to the robustness to the applet environment.

JAVA 2 Enterprise Edition (J2EE)


Java 2 Enterprise Edition (J2EE) technology is becoming a pervasive platform for the development of Internet-based, transactional business applications. It provides a robust development platform upon which to build flexible, reusable components and applications. It is a powerful standard that is well-suited for Internet-based applications because it provides many of the underlying services such as HTTP request processing (Java Servlet API), transaction management (Enterprise JavaBeans), and messaging (Java Message Service), just to name a few. However, J2EE is also a complex and changing standard that leaves the technologist with many design decisions and performance considerations. Each component service adds a level of overhead to the application processing that must be considered. Additionally, there are a number of common business logic functions, such as error handling, that must be designed and de developed for each component and application. Today more and more developments want to write distributed transactional applications for the enterprise and leverage the speed, security and reliability of

server side technology. J2EE is a platform independent, java centric environment from sun for developing, building and deploying web based enterprise application online. The J2EE platform consists of a set of services, APIs and protocols that provide functionality for developing multitiered web based application.At the client side tier, J2EE supports pure HTML as well as java applets or applications. It relies on JSP and Servlet codes to create HTML or other formatted data for the client. EJB provide another layer where the platforms logic is stored. An EJB server provides functions such as threading, concurrency, security and memory management. To reduce costs and fast-track enterprise application design and development, the java2 platform, Enterprise edition (J2EE) technology provides a component-based approach to the design, development, assembly and distributed application model, the ability to reuse components; integrated Extensible Markup Language (XML) based data interchange, a unified security model, and flexible transaction control. DISTRIBUTED MULTI TIERED APPLICATIONS The J2EE platform uses a multi tiered distributed application model. Application logic is divided into components according to function, and the various application components that make up a J2EE application are installed on different machines depending on the tier in the multi tiered J2EE environment to which the application component belongs. The figure shown below shows two multi tiered j2EE applications divided into the tiers described in the following list. The J2EE application parts shown in Figure Client-tier components run on the client machine. Web-tier components run on the J2EE server. Business-tier components run on the J2EE server. Enterprise information system (EIS)-tier software runs the EIS server.

2.2 Tools Net Beans (IDE):


For front end designing, java based software NETBEANS is used as it provides some very good tools for software design. One does not need to make classes for every form, they are inbuilt. The Net Beans IDE is a free, open-source Integrated Development Environment for software

developers. The IDE runs on many platforms including Windows, Linux, and Solaris. It is easy to install and use straight out of the box. The Net Beans IDE provides developers with all the tools they need to create professional cross-platform desktop, enterprise, web and mobile applications. Net Beans, along with Eclipse, is one of the most widely used Java IDE (Integrated Development Environment). The purpose of this document is to describe the steps needed to run Net beans 6.0.1 on a net based system, using Linux Java Virtual Machine and Linux compatibility mode. The major reasons for using NETBEANS are: a) It is the best IDE for Expediting Java Development. b) It provides a very easy way to connect one form to other. c) Easy connectivity of the forms. d) Its GUI makes it much more user friendly.

Java is used as the front end tool due to the following reasons: a) It is completely object oriented. b) Easy database linking and access. c) Proper object linking and embedding. d) It is platform independent. e) Low overhead profiling. f) Attaching to running applications. g) CPU Performance profiling. h) Memory leak debugging. i) Task-based profiling.

Microsoft Access 2003


Microsoft Access is the default database of Microsoft Visual Basic. Microsoft Access 2003 provides many new features that make working with data and designing a database even easier. Microsoft Access Database is a collection of data and objects related to particular topic or purpose. Microsoft Access Database may contain tables; queries, forms, reports, macros modules and shortcuts top data access pages.

Microsoft Access is a Relational Database Management System. Using Access we can organize our data according to subject and can store information about how different subject are related. In general MS-Access database can have several small tables. Microsoft Office Access, previously known as Microsoft Access, is a relational database management system from Microsoft that combines the relational Microsoft Jet Database Engine with a graphical user interface and software development tools. It is a member of the 2007 Microsoft Office system. Access can use data stored in Access/Jet, Microsoft SQL Server, Oracle, or any ODBC-compliant data container (including MySQL and PostgreSQL). Skilled software developers and data architects use it to develop application software. Relatively unskilled programmers and nonprogrammer "power users" can use it to build simple applications. It supports some object-oriented techniques but falls short of being a fully object-oriented development tool. Access is used by small businesses, within departments of large corporations, and by hobby programmers to create ad hoc customized desktop systems for handling the creation and manipulation of data. Access can be used as a database for basic web based applications hosted on Microsoft's Internet Information Services and utilizing Microsoft Active Server Pages ASP. Most typical web applications should use tools like ASP/Microsoft SQL Server or the LAMP stack. Some professional application developers use Access for rapid application development, especially for the creation of prototypes and standalone applications that serve as tools for on-the-road salesmen. Access does not scale well if data access is via a network, so applications that are used by more than a handful of people tend to rely on Client-Server based solutions. However, an Access "front end" (the forms, reports, queries and VB code) can be used against a host of database back ends, including JET (file-based database engine, used in Access by default), Microsoft SQL Server, Oracle, and any other ODBC-compliant product. Features One of the benefits of Access from a programmer's perspective is its relative compatibility with SQL (structured query language) queries may be viewed and edited as SQL statements, and SQL statements can be used directly in Macros and VBA Modules to manipulate Access tables. Users may mix and use both VBA and "Macros" for programming forms and logic and offers object-oriented possibilities.

MSDE (Microsoft SQL Server Desktop Engine) 2000, a mini-version of MS SQL Server 2000, is included with the developer edition of Office XP and may be used with Access as an alternative to the Jet Database Engine. Unlike a modern RDBMS, the Access and the Jet Engine implements database triggers and stored procedures in a non-standard way. Stored Procedures are implemented in VBA, and Triggers are only available from embedded Forms. Both Triggers and Stored procedures are only available to applications built completely within the Access database management system. Client applications built with VB or C++ are not able to access these features. Starting in MS Access 2003 (Jet 4.0), there is a new syntax for creating queries with parameters, in a way that looks like creating stored procedures, but these procedures are still limited to one statement per procedure. Microsoft Access does allow forms to contain code that is triggered as changes are made to the underlying table (as long as the modifications are done only with that form), and it is common to use pass-through queries and other techniques in Access to run stored procedures in RDBMSs that support these. In ADP files (supported in MS Access 2003 and later), the database-related features are entirely different, because this type of file connects to a MSDE or Microsoft SQL Server, instead of using the Jet Engine. Thus, it supports the creation of nearly all objects in the underlying server (tables with constraints and triggers, views, stored procedures and UDF-s). However, only forms, reports, macros and modules are stored in the ADP file (the other objects are stored in the back-end database).

CHAPTER 3 ANALYSIS

ANALYSIS

3.1

Detailed Statement of Problem

3.1.1 Problem Specification


In the current system all the jobs of the vehicle route management is done manually. This Is very difficult to the operators who want to handle hundreds of trips in a day. In current system there is no way to store the details of the employees working in the buses and taxis, So many complaints against staff can arise from the passengers side. More over there is no detailed record of the vehicle's routes in which they service

3.1.2 Performance definition


Vehicle Management System is a complete solution for company's offering complete operational management of the day-to-day activities which are helpful to both the Management and the Customers. Daily Accounting Software for all types of vehicles and equipment, Transport industry Private or Public Service. Cars, taxis, coaches, vans, pick up trucks, buses, trucks, rental services etc. Most Ideal for Bus & Taxi Depots, Garages, scrap yards, vehicle recovery businesses and other vehicle management companies.

IT PERFORM 24 X 365 OPERATION CAN HELP IN RESOLVING PROBLEMS ARISES WITHOUT PRIOR WARNINGS

3.1.3 Purpose
Our proposed system serves following purposes User friendly interface Fast access to database Less error More Storage Capacity

Search facility Look and Feel Environment Quick transaction

3.2 Functional Requirements


A functional requirement defines a function of a software system on its component. A function is described as a set of inout, the behavior and output.

1. REQUIREMENTS: The system should have the requirements of the project. The developer should prepare the requirements of the project. The should prepare the requirements which are need for the software. 2. ANALYSIS: Analyze the requirements whether it provides proper operations/output and performs the task. 3. DESIGN: Project manager should design the layout of the project before going to implement time allocation; cost allocation and staff allocation will coming under design process. 4. IMPLEMENTATION: After encompassing all the diagrams, we have to generate code for each and every diagram i.e. from use case to deployment. 5. TESTING: After implementing the diagram with domain language, we have to test the particular projects. 6. MAINTAINENCE: The system should be easily updated. The system should utilize the interchangeable plugins software developed should maintain the cost and time schedule of the project.

3.3 Non Functional Requirements:


Non functional requirements define the needs in terms if performance, logical database requirements, design constraints, standard compliance, reliability, availability, security, maintainability and portability. i. PERFORMANCE REQUIREMENTS: a) Performance requirements define acceptable response times for system functionality. b) The total time for user interface screens will take no longer than two seconds. c) The login information shall be verified within the seconds. Queries shall results within five seconds.

ii. DESIGN CONSTRAINTS: a) The software shall be a standard system running in a windows environment. b) The system shall be developed using rational enterprise suite and oracle 10i database. iii. RELIABILITY: Specify the factors required to establish the required reliability of the software system at time of delivery. iv. AVAILABILITY: The system should have an availability of 99.99%. v. PORTABILITY: a) The system should be extremely via the USB drive. b) The system shall be easy to migrate or backed up via another use drive. vi. MAINTAINABILITY: a) The system shall utilize interchangeable plugins. b) The system shall be easily updateable for fixes and patches.

3.4 Use Case Model


Use Case diagrams are one of the five diagrams in the UML for modeling the dynamic aspects of systems (activity diagrams, sequence diagrams, state chart diagrams and collaboration diagrams are the four other kinds of diagrams in the UML for modeling the dynamic aspects of systems).

3.4.1 Use Case Diagram

3.4.2 Use Case Specification


VMS is a Management Information System specially designed for vehicle maintenance, job dispatching, and route planning. VMS is a desktop-based system. Followings are the product features of VMS: Bus maintenance system Route Management Employee Management Passenger Management Bus maintenance system In Vehicle module a user can add a new Vehicle details to the database. Route Management Route Management module deals with the route management of the Vehicle. Employee Management In Employee Management personal details of employee can added to database. Passenger Management Details of every passenger are stored in the system

3.5 Activity Diagram


An Activity Diagram is essentially a flow chart showing flow of control from activity to activity. They are used to model the dynamic aspects of as system. They can also be used to model the flow of an object as it moves from state to state at different points in the flow of control. Activity diagrams commonly contain Fork Start & End Symbol.

3.6 Class Diagram


Class diagrams are the most common diagrams found in modeling object-oriented systems. A class diagram shows a set of classes, interfaces, and collaborations and their relationships

CHAPTER 4 DESIGN

DESIGN
4.1 Functional Model 4.1.1 Data Flow Diagram
A Data Flow Diagram (DFD) is a diagram that describes the flow of data and the processes that change or transform data throughout a system. Its a structured analysis and design tool that can be used for flowcharting in place of, or in association with, information oriented and process oriented system flowcharts. When analysts prepare the Data Flow Diagram, they specify the user needs at a level of detail that virtually determines the information flow into and out of the system and the required data resources. This network is constructed by using a set of symbols that do not imply a physical implementation. The Data Flow Diagram reviews the current physical system, prepares input and output specification, specifies the implementation plan etc. Rules for constructing a Data Flow Diagram

Arrows should not cross each other. Squares, Circles and files must bear names. Decomposed data flow squares and circles can have same names. Choose meaningful names for dataflow. Draw all data flows around the outside of the diagram.

Some of the common data flow diagram symbols are :

Source or Destination of data

Data Flow

Process

Storage

4.2

Data Model

4.2.1 Entity Relationship Diagram

4.2.2 Database Design


The general theme behind a database is to handle information as an integrated whole. A database is a collection of interrelated data stored with minimum redundancy to serve many users quickly and effectively. After designing input and output, the analyst must concentrate on database design or how data should be organized around user requirements. The general objective is to make information access, easy quick, inexpensive and flexible for other users. During database design the following objectives are concerned:-

Controlled Redundancy Data independence Accurate and integrating More information at low cost Recovery from failure Privacy and security Performance

Ease of learning and use

TABLES USED USERS


FieldName Name Category Username Password DataType Text Text Text Text Key -

BOOKING
FieldName Booking_No Pass_No PassName Bus_RegNo SeatNo Date_of_Travel Time_of_Travel Pass_From Destination Amount DataType Number Text Text Text Text Text Text Text Text Text Key Primary -

BUSES
FieldName Bus_RegNo BusNo Model Capacity DateBought Insurance_Status Date_Insured Insurance_Expiry DataType Text Text Text Number Date/Time Text Date/Time Date/Time Key Primary -

Emp

FieldName empNo Sname Fname Lname Gender DOB Designation Telephone E_Mail Address

DataType Text Text Text Text Text Date/Time Text Number Text Text

Key Primary -

Passenger
FieldName Pass_No Pass_Name Address Tel_No Date_of_Travel Depot To Pay_Status Booked_Status DataType Text Text Text Number Date/Time Text Text Text Text Key Primary -

Payment
FieldName Payment_No Pass_No Pass_Name Payment_Mode Date_Payment Amount_Paid Received_By DataType Text Text Text Text Date/Time Currency Text Key Primary -

Route
FieldName Route_No RouteName Depot DataType Text Text Text Key Primary -

Destination Distance Fare_Charged

Text Text Number

Schedules
FieldName Route_Name empNo Driver_Name Trip_No Date_Scheduled Dept_Time DataType Text Text Text Number Date/Time Text Key -

Trips
FieldName Trip_No Bus_RegNo Route_No S_Date DataType Text Text Text Text Key Primary -

CHAPTER 5 APPLICATION INTERFACE

APPLICATION INTERFACE

5.1

Input / Output Interfaces

INPUT DESIGN
Input design is the process of converting user-oriented input to a computer based format. Input design is a part of overall system design, which requires very careful attention .Often the collection of input data is the most expensive part of the system. The main objectives of the input design are 1. Produce cost effective method of input 2. Achieve highest possible level of accuracy 3. Ensure that the input is acceptable to and understood by the staff. Input Data The goal of designing input data is to make entry easy, logical and free from errors as possible. The entering data entry operators need to know the allocated space for each field; field sequence and which must match with that in the source document. The format in which the data fields are entered should be given in the input form .Here data entry is online; it makes use of processor that accepts commands and data from the operator through a key board. The input required is analyzed by the processor. It is then accepted or rejected. Input stages include the following processes Data Recording Data Transcription Data Conversion Data Verification

Data Control Data Transmission Data Correction One of the aims of the system analyst must be to select data capture method and devices,

which reduce the number of stages so as to reduce both the changes of errors and the cost .Input types, can be characterized as. External Internal Operational Computerized Interactive Input files can exist in document form before being input to the computer. Input design is rather complex since it involves procedures for capturing data as well as inputting it to the computer.

OUTPUT DESIGN
Outputs from computer systems are required primarily to communicate the results of processing to users. They are also used to provide a permanent copy of these result for latter consultation.Computer output is the most important and direct source of information to the users. Designing computer output should proceed in an organized well through out the manner. The right output must be available for the people who find the system easy o use. The outputs have been defined during the logical design stage. If not, they should defined at the beginning of the output designing terms of types of output connect, format, response etc, Various types of outputs are External outputs Internal outputs

Operational outputs Interactive outputs Turn around outputs All screens are informative and interactive in such a way that the user can ful fill his

requirements through asking queries.

CHAPTER 6 TEST CASE DESIGN

TEST CASE DESIGN


Software testing is a critical element of software quality assurance and represents the ultimate review of specification, design and code generation. Once source code has been generated, software must be tested to uncover and correct as many errors as possible before delivery to the customer. Our goal is to design a series of test cases that have a high likelihood of finding errors. Thats where software-testing techniques come in to the picture. These techniques provide systematic guidance for designing tests that Exercise the internal logic of software components and Exercise the input and output domains of the program to uncover errors in program function, behavior and performance.
6.1

White Box Testing:


White box testing is an approach to testing where the tests are derived from knowledge of the

softwares structure and implementation .It is usually applied to relatively small program units such as sub-routines or the operations associated with an object or as small module of the system. White box testing was performed at all levels of development of Online Recruitment system. We took all care to test the code and guarantee that it meets all the specifications as well as it is logically correct. All loops were tested and all internal data structures were evaluated and verified.

6.2 Unit Testing:


Emphasizes the verification effort on the smallest unit of software design i.e. a software component or module. Unit testing is dynamic method of verification , where program is actually compiled and executed. Unit testing is performed parallely with coding phase. Unit testing tests

units or modules not the whole program.We have tested all windows individually. As the modules were build up testing was carried out simultaneously, tracking out each and every kind of input and checking the corresponding output until module is working correctly.

6.3 Integration Testing:


In integration testing a system consisting of different modules is tested for problems arising from component interaction. Integration testing should be developed from the system specification. Firstly, a minimum configuration must be integrated and tested. In our project we have done integration testing in a bottom up fashion i.e. in our project we have started constrution and testing with atomic modules. After unit testing the modules are integrated one by one and then tested for problems arising from component intraction.

6.4 System Testing


The purpose of the system testing is to consider all the likely variations to which it will be suggested and push the systems to limits. The testing process focuses on the logical intervals of the software ensuring that all statements have been tested and on functional interval is conducting tests to uncover errors and ensure that defined input will produce actual results that agree with the required results. Program level testing, modules level testing integrated and carried out.

6.5 Black box Testing


Black box testing, also called behavioral testing, and focuses on the functional requirements of the software. It helps to derive sets of input conditions that will fully exercise all of the functional requirements for a program. This testing helps in finding the errors for the following categories: 1. Incorrect or missing functions. 2. Interface errors. 3. Errors in the data structure or the external data access. 4. Performance errors. 5. Initialization errors

CHAPTER 7 OUTPUT SCREENS

OUTPUT SCREENS
7.1

Screenshots of Code Screens


LOGIN SCREEN

MAIN WINDOW

ADDING NEW USER WINDOW

UPDATE EMPLOYEE DETAILS WINDOW

NEW BUS ENTRY WINDOW

UPDATE BUS DETAILS WINDOW

ADD NEW ROUTE WINDOW

UPDATE ROUTE WINDOW

BUS DETAILS WINDOW

SCHEDULING WINDOW

BOOKING WINDOW

BUS REPORT WINDOW

EMPLOYEE REPORT WINDOW

7.2

Important Coding

//Main.java

import java.awt.EventQueue; import javax.swing.JFrame;

public class Main implements Runnable{ private final JFrame frame; public Main(JFrame frm){ this.frame=frm; }//constructor closed public void run(){ frame.setVisible(true); }//run method closed public static void main(String args[]){ new frmSplash(3000); EventQueue.invokeLater(new Main(new LoginScreen())); }//main method closed

}//class closed

//LoginScreen.java

import java.awt.Dimension;

import java.awt.Font; import java.awt.Toolkit; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.sql.Connection; import java.sql.ResultSet; import java.sql.Statement; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JComboBox; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPasswordField; import javax.swing.JTextField;

public class LoginScreen extends JFrame {

private JLabel lblUsername, lblPasswd, lblCat; public JTextField txtUser; private JPasswordField txtPasswd; private JButton btnLogin, btnCancel; private JComboBox cmbCat; private Connection con; Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();

public LoginScreen() { super("System Login"); this.getContentPane().setLayout(null); this.setSize(370, 250); this.setResizable(false); this.setLocation((screen.width - 500) / 2, ((screen.height - 350) / 2)); this.setDefaultCloseOperation(EXIT_ON_CLOSE);

lblUsername = new JLabel("Username"); lblPasswd = new JLabel("Password"); txtUser = new JTextField(); txtPasswd = new JPasswordField(); lblCat = new JLabel("Login As"); cmbCat = new JComboBox(); cmbCat.addItem("Manager"); cmbCat.addItem("Booking Clerk"); btnLogin = new JButton("Login", new ImageIcon(ClassLoader.getSystemResource("images\\Login.png"))); btnCancel = new JButton("Cancel", new ImageIcon(ClassLoader.getSystemResource("images\\Cancel.png")));

lblUsername.setBounds(40, 30, 100, 25); lblPasswd.setBounds(40, 65, 100, 25); lblCat.setBounds(40, 100, 100, 25); txtUser.setBounds(150, 30, 160, 25); txtPasswd.setBounds(150, 65, 160, 25); cmbCat.setBounds(150, 100, 160, 25);

btnLogin.setBounds(70, 150, 100, 25); btnCancel.setBounds(190, 150, 100, 25);

lblUsername.setFont(new Font("monospaced", Font.BOLD, 16)); lblPasswd.setFont(new Font("monospaced", Font.BOLD, 16)); lblCat.setFont(new Font("monospaced", Font.BOLD, 16)); cmbCat.setFont(new Font("monospaced", Font.BOLD, 16)); txtUser.setFont(new Font("monospaced", Font.CENTER_BASELINE, 16)); txtPasswd.setFont(new Font("monospaced", Font.CENTER_BASELINE, 16)); this.add(lblUsername); this.add(txtUser); this.add(lblPasswd); this.add(txtPasswd); this.add(btnLogin); this.add(btnCancel); this.add(lblCat); this.add(cmbCat); this.add(btnLogin); this.add(btnCancel);

ButtonListener listener = new ButtonListener(); btnLogin.addActionListener(listener); btnCancel.addActionListener(listener); con = DBConnection.getDBConnection(); if (con == null) { JOptionPane.showMessageDialog(null, "Error on establishing database connection", "Error", JOptionPane.ERROR_MESSAGE);

this.dispose(); } }//constructor closed

public void login() { String username = txtUser.getText(); String password = txtPasswd.getText(); String SQL; String category = cmbCat.getSelectedItem().toString(); SQL = "SELECT * FROM users WHERE username='" + username + "' AND password='" + password + "'AND Category='" + category + "'"; try { Statement stmt = con.createStatement(); stmt.execute(SQL); ResultSet rs = stmt.getResultSet(); boolean recordfound = rs.next(); if (recordfound) { LoadMDIWindow(); this.dispose(); } else { JOptionPane.showMessageDialog(null, "The system could not log you in.\n" + " Please make sure your username and password are correct", "Login Failure", JOptionPane.INFORMATION_MESSAGE); txtUser.setText(""); txtPasswd.setText(""); txtUser.requestFocus();

} } catch (Exception ex) { JOptionPane.showMessageDialog(null, "Error on login operation", "Login Error", JOptionPane.ERROR_MESSAGE); }//try catch closed }//Login() closed public void LoadMDIWindow() { if (cmbCat.getSelectedItem().equals("Manager")) { new MDIWindow().LoginManager();

} else { new MDIWindow().LoginClerk(); } }//LoginValidity() closed

private class ButtonListener implements ActionListener {

public void actionPerformed(ActionEvent e) { if (e.getSource() == btnLogin) { if (txtUser.getText() == null || txtUser.getText().equals("")) { JOptionPane.showMessageDialog(null, "Enter username", "Missing field", JOptionPane.DEFAULT_OPTION); txtUser.requestFocus(); return; } if (txtPasswd.getText() == null || txtPasswd.getText().equals("")) { JOptionPane.showMessageDialog(null, "Enter password", "Missing field", JOptionPane.DEFAULT_OPTION);

txtPasswd.requestFocus(); return; } login(); } else if (e.getSource() == btnCancel) { System.exit(0); }//if else closed }//actionPerformed() closed }//ButtonListner class closed

}//LoginScreen class closed

//MDIWindow.java

import java.awt.*; import java.text.*; import java.awt.event.*; import javax.swing.*; import java.io.*; import java.sql.*; import javax.swing.plaf.metal.*;

public class MDIWindow extends JFrame implements WindowListener {

private JMenu mnuOperations, mnuFiles, mnuReports, mnuProcesses, mnuTools, mnuHelp;

private JMenuItem mnuNewuser, mnuExit; private JMenuItem mnuBuses, mnuEmps, mnuRoutes, mnuPassengers; private JMenuItem mnuBooking, mnuScheduling, mnuPayment; private JMenuItem mnuBusRpt, mnuEmpRpt, mnuSchedRpt, mnuBookRpt; private JMenuItem mnuCalculator, mnuNotepad; private JMenuItem mnuUsrMannual; private JLabel welcome; public static JDesktopPane desktop; String StrBusinesTitle; public JButton NewJButton; Connection getConnection;

public MDIWindow() { super("Bus Scheduling System");

this.setJMenuBar(CreateJMenuBar()); this.setExtendedState(MAXIMIZED_BOTH); this.setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); this.setIconImage(new ImageIcon(ClassLoader.getSystemResource("images/appicon.png")).getImage()); this.setLocation(0, 0); this.setSize(Toolkit.getDefaultToolkit().getScreenSize()); this.addWindowListener(this);

welcome = new JLabel("Welcome: Today is " + new java.util.Date() + " ", JLabel.CENTER); welcome.setFont(new Font("monospaced", Font.BOLD, 12));

welcome.setForeground(Color.black); desktop = new JDesktopPane(); desktop.setBorder(BorderFactory.createEmptyBorder()); desktop.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE); getContentPane().add(welcome, BorderLayout.PAGE_END, JLabel.CENTER); getContentPane().add(desktop, BorderLayout.CENTER);

setVisible(true); }//Constructor closed protected JMenuBar CreateJMenuBar() { JMenuBar menubar = new JMenuBar(); /**********CREATING OPERATIONS MENU***********************/ mnuOperations = new JMenu("Operations"); mnuOperations.setForeground((Color.blue)); mnuOperations.setFont(new Font("monospaced", Font.PLAIN, 12)); mnuOperations.setMnemonic('O'); mnuOperations.setEnabled(false);

mnuNewuser = new JMenuItem("AddNew User"); mnuNewuser.setForeground(Color.blue); mnuNewuser.setFont(new Font("monospaced", Font.PLAIN, 12)); mnuNewuser.setMnemonic('L'); mnuNewuser.setIcon(new ImageIcon(ClassLoader.getSystemResource("images/users.png"))); mnuNewuser.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_L, ActionEvent.CTRL_MASK)); mnuNewuser.setActionCommand("newuser");

mnuNewuser.addActionListener(menulistener);

mnuExit = new JMenuItem("Exit"); mnuExit.setForeground(Color.blue); mnuExit.setFont(new Font("monospaced", Font.PLAIN, 12)); mnuExit.setMnemonic('E'); mnuExit.setIcon(new ImageIcon(ClassLoader.getSystemResource("images/exit.png"))); mnuExit.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.CTRL_MASK)); mnuExit.setActionCommand("exit"); mnuExit.addActionListener(menulistener);

mnuOperations.add(mnuNewuser); mnuOperations.addSeparator(); mnuOperations.add(mnuExit); menubar.add(mnuOperations);

/****************CREATING FILES MENU ********************/ mnuFiles = new JMenu("Files"); mnuFiles.setFont(new Font("monospaced", Font.PLAIN, 12)); mnuFiles.setForeground((Color.blue)); mnuFiles.setMnemonic('F'); mnuFiles.setEnabled(false);

mnuBuses = new JMenuItem("Buses"); mnuBuses.setForeground(Color.blue);

mnuBuses.setEnabled(true); mnuBuses.setFont(new Font("monospaced", Font.PLAIN, 12)); mnuBuses.setMnemonic('B'); mnuBuses.setIcon(new ImageIcon(ClassLoader.getSystemResource("images/Buses.png"))); mnuBuses.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_B, ActionEvent.CTRL_MASK)); mnuBuses.setActionCommand("buses"); mnuBuses.addActionListener(menulistener);

mnuEmps = new JMenuItem("Employees"); mnuEmps.setForeground(Color.blue); mnuEmps.setEnabled(true); mnuEmps.setFont(new Font("monospaced", Font.PLAIN, 12)); mnuEmps.setMnemonic('E'); mnuEmps.setIcon(new ImageIcon(ClassLoader.getSystemResource("images/Emps.png"))); mnuEmps.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_E, ActionEvent.CTRL_MASK)); mnuEmps.setActionCommand("employees"); mnuEmps.addActionListener(menulistener);

mnuRoutes = new JMenuItem("Routes"); mnuRoutes.setEnabled(true); mnuRoutes.setForeground(Color.blue); mnuRoutes.setFont(new Font("monospaced", Font.PLAIN, 12)); mnuRoutes.setMnemonic('R');

mnuRoutes.setIcon(new ImageIcon(ClassLoader.getSystemResource("images/Routes.png"))); mnuRoutes.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_R, ActionEvent.CTRL_MASK)); mnuRoutes.setActionCommand("routes"); mnuRoutes.addActionListener(menulistener);

mnuPassengers = new JMenuItem("Passengerss"); mnuPassengers.setForeground(Color.blue); mnuPassengers.setEnabled(false); mnuPassengers.setFont(new Font("monospaced", Font.PLAIN, 12)); mnuPassengers.setMnemonic('P'); mnuPassengers.setIcon(new ImageIcon(ClassLoader.getSystemResource("images/pass.png"))); mnuPassengers.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_P, ActionEvent.CTRL_MASK)); mnuPassengers.setActionCommand("passengers"); mnuPassengers.addActionListener(menulistener);

mnuFiles.add(mnuBuses); mnuFiles.add(mnuEmps); mnuFiles.add(mnuRoutes); mnuFiles.add(mnuPassengers); menubar.add(mnuFiles);

/********************* CREATING PROCESSES MENU ***********************/ mnuProcesses = new JMenu("Processes ");

mnuProcesses.setFont(new Font("monospaced", Font.PLAIN, 12)); mnuProcesses.setForeground((Color.blue)); mnuProcesses.setMnemonic('P');

mnuScheduling = new JMenuItem("Scheduling"); mnuScheduling.setEnabled(false); mnuScheduling.setForeground(Color.blue); mnuScheduling.setFont(new Font("monospaced", Font.PLAIN, 12)); mnuScheduling.setMnemonic('S'); mnuScheduling.setIcon(new ImageIcon(ClassLoader.getSystemResource("images/schedule.png"))); mnuScheduling.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, ActionEvent.CTRL_MASK)); mnuScheduling.setActionCommand("scheduling"); mnuScheduling.addActionListener(menulistener);

mnuBooking = new JMenuItem("Booking"); mnuBooking.setEnabled(false); mnuBooking.setForeground(Color.blue); mnuBooking.setFont(new Font("monospaced", Font.PLAIN, 12)); mnuBooking.setMnemonic('B'); mnuBooking.setIcon(new ImageIcon(ClassLoader.getSystemResource("images/Booking.png"))); mnuBooking.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_K, ActionEvent.CTRL_MASK)); mnuBooking.setActionCommand("booking"); mnuBooking.addActionListener(menulistener);

mnuPayment = new JMenuItem("Payments"); mnuPayment.setForeground(Color.blue); mnuPayment.setEnabled(false); mnuPayment.setFont(new Font("monospaced", Font.PLAIN, 12)); mnuPayment.setMnemonic('P'); mnuPayment.setIcon(new ImageIcon(ClassLoader.getSystemResource("images/Payments.png"))); mnuPayment.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_T, ActionEvent.CTRL_MASK)); mnuPayment.setActionCommand("payments"); mnuPayment.addActionListener(menulistener);

mnuProcesses.add(mnuScheduling); mnuProcesses.add(mnuBooking); mnuProcesses.add(mnuPayment); menubar.add(mnuProcesses);

/************************* CREATING REPORTS MENU ********************/ mnuReports = new JMenu("Reports "); mnuReports.setFont(new Font("monospaced", Font.PLAIN, 12)); mnuReports.setForeground(Color.blue); mnuReports.setMnemonic('R');

mnuBusRpt = new JMenuItem("Bus Report"); mnuBusRpt.setForeground(Color.blue); mnuBusRpt.setFont(new Font("monospaced", Font.PLAIN, 12));

mnuBusRpt.setMnemonic('P'); mnuBusRpt.setIcon(new ImageIcon(ClassLoader.getSystemResource("images/busreport.png"))); mnuBusRpt.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Y, ActionEvent.CTRL_MASK)); mnuBusRpt.setActionCommand("busreport"); mnuBusRpt.addActionListener(menulistener);

mnuEmpRpt = new JMenuItem("Employee Report"); mnuEmpRpt.setForeground(Color.blue); mnuEmpRpt.setFont(new Font("monospaced", Font.PLAIN, 12)); mnuEmpRpt.setMnemonic('P'); mnuEmpRpt.setIcon(new ImageIcon(ClassLoader.getSystemResource("images/empreport.png"))); mnuEmpRpt.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, ActionEvent.CTRL_MASK)); mnuEmpRpt.setActionCommand("empreport"); mnuEmpRpt.addActionListener(menulistener);

mnuSchedRpt = new JMenuItem("Scheduling Report"); mnuSchedRpt.setForeground(Color.blue); mnuSchedRpt.setFont(new Font("monospaced", Font.PLAIN, 12)); mnuSchedRpt.setMnemonic('S'); mnuSchedRpt.setIcon(new ImageIcon(ClassLoader.getSystemResource("images/schedreport.png"))); mnuSchedRpt.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q, ActionEvent.CTRL_MASK)); mnuSchedRpt.setActionCommand("schedulereport"); mnuSchedRpt.addActionListener(menulistener);

mnuBookRpt = new JMenuItem("Booking Report"); mnuBookRpt.setForeground(Color.blue); mnuBookRpt.setFont(new Font("monospaced", Font.PLAIN, 12)); mnuBookRpt.setMnemonic('B'); mnuBookRpt.setIcon(new ImageIcon(ClassLoader.getSystemResource("images/bookreport.png"))); mnuBookRpt.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Z, ActionEvent.CTRL_MASK)); mnuBookRpt.setActionCommand("bookrepoort"); mnuBookRpt.addActionListener(menulistener);

mnuReports.add(mnuBusRpt); mnuReports.add(mnuEmpRpt); mnuReports.add(mnuSchedRpt); mnuReports.add(mnuBookRpt); menubar.add(mnuReports);

/******************* CREATING TOOLS MENU ***************************/ mnuTools = new JMenu("Tools "); mnuTools.setFont(new Font("monospaced", Font.PLAIN, 12)); mnuTools.setForeground(Color.blue); mnuTools.setMnemonic('T');

mnuCalculator = new JMenuItem("Calculator"); mnuCalculator.setForeground(Color.blue); mnuCalculator.setFont(new Font("monospaced", Font.PLAIN, 12));

mnuCalculator.setMnemonic('C'); mnuCalculator.setIcon(new ImageIcon(ClassLoader.getSystemResource("images/calc.png"))); mnuCalculator.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, ActionEvent.CTRL_MASK)); mnuCalculator.setActionCommand("calculator"); mnuCalculator.addActionListener(menulistener);

mnuNotepad = new JMenuItem("Notepad"); mnuNotepad.setForeground(Color.blue); mnuNotepad.setFont(new Font("monospaced", Font.PLAIN, 12)); mnuNotepad.setMnemonic('N'); mnuNotepad.setIcon(new ImageIcon(ClassLoader.getSystemResource("images/notepad.png"))); mnuNotepad.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, ActionEvent.CTRL_MASK)); mnuNotepad.setActionCommand("notepad"); mnuNotepad.addActionListener(menulistener);

mnuTools.add(mnuCalculator); mnuTools.add(mnuNotepad); menubar.add(mnuTools);

/*********************** CREATING HELP MENU **************************/ mnuHelp = new JMenu("Help "); mnuHelp.setFont(new Font("monospaced", Font.PLAIN, 12)); mnuHelp.setForeground(Color.blue);

mnuHelp.setMnemonic('H');

mnuUsrMannual = new JMenuItem("User Manual"); mnuUsrMannual.setForeground(Color.blue); mnuUsrMannual.setFont(new Font("monospaced", Font.PLAIN, 12)); mnuUsrMannual.setMnemonic('U'); mnuUsrMannual.setIcon(new ImageIcon(ClassLoader.getSystemResource("images/help.png"))); mnuUsrMannual.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_M, ActionEvent.CTRL_MASK)); mnuUsrMannual.setActionCommand("mannual"); mnuUsrMannual.addActionListener(menulistener);

mnuHelp.add(mnuUsrMannual); menubar.add(mnuHelp); return menubar; }//CreateJMenuBar()closed

ActionListener menulistener = new ActionListener() {

public void actionPerformed(ActionEvent e) { String ActCmd = e.getActionCommand(); if (ActCmd.equalsIgnoreCase("calculator")) { try { Runtime.getRuntime().exec("calc.exe"); } catch (Exception ex) { JOptionPane.showMessageDialog(null, "Error,Cannot start calculator", "Applicaton Error", JOptionPane.ERROR_MESSAGE);

}//try catch closed } else if (ActCmd.equalsIgnoreCase("notepad")) { try { Runtime.getRuntime().exec("notepad.exe"); } catch (Exception ex) { JOptionPane.showMessageDialog(null, "Error,Cannot start notepad", "Applicaton Error", JOptionPane.ERROR_MESSAGE); }//try catch closed } else if (ActCmd.equalsIgnoreCase("newuser")) { NewUser frm = new NewUser(); desktop.add(frm); frm.setVisible(true); } else if (ActCmd.equalsIgnoreCase("exit")) { ConfirmExit(); } else if (ActCmd.equalsIgnoreCase("buses")) { Buses frm = new Buses(); desktop.add(frm); frm.setVisible(true); } else if (ActCmd.equalsIgnoreCase("employees")) { Employee frm = new Employee(); desktop.add(frm); frm.setVisible(true); } else if (ActCmd.equalsIgnoreCase("routes")) { Route frm = new Route(); desktop.add(frm); frm.setVisible(true); } else if (ActCmd.equalsIgnoreCase("passengers")) {

Passengers frm = new Passengers(); desktop.add(frm); frm.setVisible(true); } else if (ActCmd.equalsIgnoreCase("scheduling")) { Schedule frm = new Schedule(); desktop.add(frm); frm.setVisible(true); } else if (ActCmd.equalsIgnoreCase("booking")) { Booking frm = new Booking(); desktop.add(frm); frm.setVisible(true); } else if (ActCmd.equalsIgnoreCase("payments")) { Payment frm=new Payment(); desktop.add(frm); frm.setVisible(true); }else if(ActCmd.equalsIgnoreCase("busreport")){ Bus_Details frm=new Bus_Details(); desktop.add(frm); frm.setVisible(true); }else if(ActCmd.equalsIgnoreCase("empreport")){ employee_report frm=new employee_report(); desktop.add(frm); frm.setVisible(true); }else if(ActCmd.equalsIgnoreCase("schedulereport")){ Scheduling_report frm=new Scheduling_report(); desktop.add(frm);

frm.setVisible(true); }else if(ActCmd.equalsIgnoreCase("bookrepoort")){ Booking_report frm=new Booking_report(); desktop.add(frm); frm.setVisible(true); } } };

public void windowOpened(WindowEvent e) {

public void windowClosing(WindowEvent e) {

ConfirmExit(); }

public void windowClosed(WindowEvent e) { }

public void windowIconified(WindowEvent e) { }

public void windowDeiconified(

WindowEvent e) { }

public void windowActivated(WindowEvent e) { }

public void windowDeactivated(WindowEvent e) { }

private void ConfirmExit() { String ObjButtons[] = {"Yes", "No"}; int PromptResult = JOptionPane.showOptionDialog(null, "Are you sure to exit?", "Confirm exit", JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE, null, ObjButtons, ObjButtons[1]); if (PromptResult == 0) { System.exit(0); }//if closed }//ConfirmExit() closed protected boolean isLoaded(String FormTitle) { JInternalFrame Form[] = desktop.getAllFrames(); for (int i = 0; i < Form.length; i++) { if (Form[i].getTitle().equalsIgnoreCase(FormTitle)) { Form[i].show(); try { Form[i].setIcon(true); Form[i].setSelected(true); } catch (Exception e) {

} return true; } } return false; }//isLoaded() closed

public void LoginManager() { mnuOperations.setEnabled(true); mnuFiles.setEnabled(true); mnuBooking.setEnabled(true); mnuScheduling.setEnabled(true); mnuPayment.setEnabled(true); mnuRoutes.setEnabled(true); mnuEmps.setEnabled(true); mnuBuses.setEnabled(true); mnuPassengers.setEnabled(true); }//LoginManager() closed public void LoginSupervisor() { mnuFiles.setEnabled(true); mnuScheduling.setEnabled(true); mnuPayment.setEnabled(true); mnuRoutes.setEnabled(true); mnuEmps.setEnabled(true); mnuBuses.setEnabled(true);

}//LoginSupervisor() closed public void LoginClerk() { mnuBooking.setEnabled(true); mnuPayment.setEnabled(true); mnuFiles.setEnabled(true); mnuPassengers.setEnabled(true); }//LoginClerk() closed }//class closed

// DBConnection.java

import java.sql.Connection; import java.sql.DriverManager;

public class DBConnection { public static Connection getDBConnection() { Connection connection; try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); connection = DriverManager.getConnection("jdbc:odbc:Bus"); return connection; } catch (Exception ex) { return null; }//try catch closed }//getDBConnection() closed

}//class closed

//Buses.java

import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.text.*; import javax.swing.*; import java.io.*; import java.text.*; import java.sql.*; import java.awt.print.*; import javax.swing.table.AbstractTableModel;

public class Buses extends JPanel implements Printable {

private static JTable tblBusList; private JScrollPane jsp; private JButton btnAddNew, btnRefresh, btnClose, btnUpdate, btnPrint; private JPanel tablePanel; private JPanel buttonPanel; private Statement stmt; Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();

private SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy"); private static int selectedRow;

public Buses() { setSize(1000, 400); setLayout(new BorderLayout());

tblBusList = new JTable(new AbstractTable()); javax.swing.table.TableColumn column = null; for (int i = 0; i < 7; i++) { column = tblBusList.getColumnModel().getColumn(i); if (i == 4) { sdf.format(i); }//if btnClosed }//for btnClosed jsp = new JScrollPane(tblBusList); tablePanel = new JPanel(new GridLayout()); tablePanel.add(jsp);

btnAddNew = new JButton("Add New", new ImageIcon(ClassLoader.getSystemResource("Images/addnew.png"))); btnUpdate = new JButton("Update", new ImageIcon(ClassLoader.getSystemResource("Images/Update.png"))); btnRefresh = new JButton("Refresh", new ImageIcon(ClassLoader.getSystemResource("Images/Refresh.png"))); btnClose = new JButton("Close", new ImageIcon(ClassLoader.getSystemResource("Images/exit.png")));

btnPrint = new JButton("Print", new ImageIcon(ClassLoader.getSystemResource("Images/print.png"))); buttonPanel = new javax.swing.JPanel(new java.awt.FlowLayout()); buttonPanel.add(btnAddNew); buttonPanel.add(btnUpdate); buttonPanel.add(btnRefresh); buttonPanel.add(btnPrint); buttonPanel.add(btnClose);

add(tablePanel, BorderLayout.CENTER); add(buttonPanel, BorderLayout.PAGE_END);

try { stmt = DBConnection.getDBConnection().createStatement(); } catch (Exception excp) { JOptionPane.showMessageDialog(null, "Error on database connection", "Statement error", JOptionPane.ERROR_MESSAGE); }//try catch closed

reloaded(); btnAddNew.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent e) { AddEntry frm = new AddEntry(); MDIWindow.desktop.add(frm); frm.setVisible(true); try {

frm.setSelected(true); } catch (Exception ex) { } } }); btnClose.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent e) { setVisible(false); } }); btnRefresh.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e) { setVisible(false); reloaded(); setVisible(true); } }); btnPrint.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent evt) { Bus_Details frm = new Bus_Details(); MDIWindow.desktop.add(frm); frm.setVisible(true); try {

frm.setSelected(true); } catch (Exception ex) { } } }); btnUpdate.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent e) { String regNo, busNo, Model, capacity, db, is, ie, id; regNo = tblBusList.getValueAt(getSelectedRow(), 0).toString(); busNo = tblBusList.getValueAt(getSelectedRow(), 1).toString(); Model = tblBusList.getValueAt(getSelectedRow(), 2).toString(); capacity = tblBusList.getValueAt(getSelectedRow(), 3).toString(); db = tblBusList.getValueAt(getSelectedRow(), 4).toString(); is = tblBusList.getValueAt(getSelectedRow(), 5).toString(); ie = tblBusList.getValueAt(getSelectedRow(), 6).toString(); id = tblBusList.getValueAt(getSelectedRow(), 7).toString(); UpdateEntry frm = new UpdateEntry(regNo, busNo, Model, capacity, db, is, ie, id); MDIWindow.desktop.add(frm); frm.setVisible(true); } }); }//constructor closed public static int getSelectedRow() { tblBusList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION );

javax.swing.ListSelectionModel rowSel = tblBusList.getSelectionModel(); rowSel.addListSelectionListener(new javax.swing.event.ListSelectionListener() {

public void valueChanged(javax.swing.event.ListSelectionEvent e) { if (e.getValueIsAdjusting()) { return; }

javax.swing.ListSelectionModel sel = (ListSelectionModel) e.getSource(); if (!sel.isSelectionEmpty()) { selectedRow = sel.getMinSelectionIndex(); } } });

return selectedRow; }

class AbstractTable extends AbstractTableModel {

private String[] columnNames = {"RegNo", "BusNo", "Model", "Capacity", "Date purchased", "Insurance Status", "Date Insured", "Expiry Date" }; private Object[][] data = new Object[50][50];

public int getColumnCount() { return columnNames.length; }

public int getRowCount() { return data.length; }

public String getColumnName(int col) { return columnNames[col]; }

public Object getValueAt(int row, int col) { return data[row][col]; }

public void setValueAt(Object value, int row, int col) { data[row][col] = value; fireTableCellUpdated(row, col); } }

public void reloaded() { try { String sql = ("SELECT * FROM Buses ORDER BY BusNo"); int Numrow = 0;

ResultSet result = stmt.executeQuery(sql); while (result.next()) { tblBusList.setValueAt(result.getString(1).trim(), Numrow, 0); tblBusList.setValueAt(result.getString(2).trim(), Numrow, 1); tblBusList.setValueAt(result.getString(3).trim(), Numrow, 2); tblBusList.setValueAt(result.getString(4).trim(), Numrow, 3); tblBusList.setValueAt(result.getDate(5), Numrow, 4); tblBusList.setValueAt(result.getString(6).trim(), Numrow, 5); tblBusList.setValueAt(result.getDate(7), Numrow, 6); tblBusList.setValueAt(result.getDate(8), Numrow, 7); sdf.format(7); Numrow++; }//while closed } catch (SQLException sqlex) { JOptionPane.showMessageDialog(null, "Error on retrieving values", "Error", JOptionPane.ERROR_MESSAGE); }//try catch closed }//reloaded() closed public int print(Graphics g, PageFormat pageFormat, int pageIndex) throws PrinterException { Graphics2D g2 = (Graphics2D) g; g2.setColor(Color.black); int fontHeight = g2.getFontMetrics().getHeight(); int fontDesent = g2.getFontMetrics().getDescent();

//leave room for page number double pageHeight = pageFormat.getImageableHeight() - fontHeight;

double pageWidth = pageFormat.getImageableWidth(); double tableWidth = (double) tblBusList.getColumnModel().getTotalColumnWidth(); double scale = 1; if (tableWidth >= pageWidth) { scale = pageWidth / tableWidth; }

double headerHeightOnPage = tblBusList.getTableHeader().getHeight() * scale; double tableWidthOnPage = tableWidth * scale;

double oneRowHeight = (tblBusList.getRowHeight() + tblBusList.getRowMargin()) * scale; int numRowsOnAPage = (int) ((pageHeight - headerHeightOnPage) / oneRowHeight); double pageHeightForTable = oneRowHeight * numRowsOnAPage; int totalNumPages = (int) Math.ceil(((double) tblBusList.getRowCount()) / numRowsOnAPage); if (pageIndex >= totalNumPages) { return NO_SUCH_PAGE; }

g2.translate(pageFormat.getImageableX(), pageFormat.getImageableY()); g2.drawString("Page: " + (pageIndex + 1), (int) pageWidth / 2 - 35, (int) (pageHeight + fontHeight - fontDesent));//bottom center

g2.translate(0f, headerHeightOnPage); g2.translate(0f, -pageIndex * pageHeightForTable); if (pageIndex + 1 == totalNumPages) { int lastRowPrinted = numRowsOnAPage * pageIndex; int numRowsLeft = tblBusList.getRowCount() - lastRowPrinted; g2.setClip(0, (int) (pageHeightForTable * pageIndex), (int) Math.ceil(tableWidthOnPage), (int) Math.ceil(oneRowHeight * numRowsLeft)); } else { g2.setClip(0, (int) (pageHeightForTable * pageIndex), (int) Math.ceil(tableWidthOnPage), (int) Math.ceil(pageHeightForTable)); } g2.scale(scale, scale); tblBusList.paint(g2); g2.scale(1 / scale, 1 / scale); g2.translate(0f, pageIndex * pageHeightForTable); g2.translate(0f, -headerHeightOnPage); g2.setClip(0, 0, (int) Math.ceil(tableWidthOnPage), (int) Math.ceil(headerHeightOnPage)); g2.scale(scale, scale); tblBusList.getTableHeader().paint(g2);//paint header at top

return Printable.PAGE_EXISTS; } }//class closed

CHAPTER 8 CONCLUSION

CONCLUSION

7.1 Inferences Drawn


This system has been successfully designed and the project aims have been met.All the requirement analysis, System analysis, Design and coding has been completed successfully.The design and coding of this application was a very challenging task in this project. It has been a great learning experience. The experience and skills acquired during designing of this project will prove to be very useful in our future career.

7.2 Future Scope


Vehicle tracking technology can be combined with vehicle management system. This component is usually GPS-based. Once vehicle location, direction and speed are determined from the GPS components, additional tracking capabilities transmit this information to a vehicle management software application. Methods for data transmission include both terrestrial and satellite. Satellite tracking communications, while more expensive, are critical if vehicle tracking is to work in remote environments without interruption. Users can see actual, real-time locations of their fleet on a map. This is often used to quickly respond on events in the field. The analysis reporting tool includes many views such as vehicle economy, price of fuel, monthly and yearly costs and performance and plenty more

7.3 Limitations

As it is a real world application so actually we have no authorization to implement payment system so we can only show a dummy transaction for bus ticket booking. Not any security manager for testing invalid login id. Not actual transactions are made. It is just a simulation. Passengers cannot view the bus and route details by themselves, they have to enquire through the booking clerk.

USER MANUAL

USER MANUAL
Before you compile the project you have to set the ODBC connection then only it will work properly Let us see How to set ODBC connection (MS Access)
1. Click Start button +Click Settings

2. Click Control Panel

3. Select Administrative tools + Click data Sources (ODBC)

4. Then you get ODBC Data Source Administrator window (shown below) +Click Add Button

5. Create New Data Source (shown below) +select Microsoft Access Driver (*.mdb,*.accdb) + press Finish button

6. ODBC Microsoft Access Set up (shown below) + gives Data Source Name +select Database (Press select button) +select your database (shown below) + Press Ok button

7. Before you close the window make sure that your DSN name is correct or not (shown below) +Press Ok button

Now you got the DSN name (Bus) this is the way for connecting ODBC.

BIBLIOGRAPHY

BIBLIOGRAPHY

References:

www.roseindia.net www.netbeans.org www.rationalrose.com www.office.microsoft.com www.wikipedia.com Java The Complete Reference - Herbert Schildt