You are on page 1of 162

ON-LINE RAILWAY RESERVATION SYSTEM

TITLE OF THE PROJECT

SUBMITTED BY: [xxxxxxxxxxxx] [Reg No: xxxxxx]

Guided By ----Mr. xxxxxxxxxxxxxxxx

UPTEC COMPUTER CONSULTANCY LTD. CONTANTS


Name : 1

ON-LINE RAILWAY RESERVATION SYSTEM

SR.NO. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

TOPIC Certificate for A Level Preface Acknowledgement Introduction Objective, Scope And Applicability Theoretical Background Definition of problem System Analysis & Design vis--vis User Requirements System Planning (PERT Chart) Methodology Adopted System Maintenance & Evaluation Cost And Benefits Analysis Detailed Life Cycle of the Project-ERD,DFD Process Involved Methodology Used For Testing Test Report User/Operational Manual Brief Background Of The Organization Data Dictionary Reference A. Bibliography B. Website Input Output Screen Design Code Sheet

PAGE_NO. 3 4 5 6 8 10 12 13 22 29 37 38 42 48 52 55 62 65 66 69

21 22

70 98-135

PREFACE
The field of computers has taken a giant leap at the threshold of twentieth century. Computers have become an integral part of man all over the globe. The proverb Need is the mother of invention is proving equally correct in case of computers.

Name :

ON-LINE RAILWAY RESERVATION SYSTEM Computers have already had a considerable impact on many aspects of our society Medicine, law enforcement, government, banking, education, transportation, planning - these are only some of the fields in which computers are already playing the highly significant role. Over the next few years you can expect a vast increase in the range of computer applications and a corresponding increase in the effect computers will have on our daily lives. This project on Online Railway Management System deals with the automation of various activities done in the organization at various levels. Flow analysis involves repetitive trial and error computations. Depending upon the accuracy of the initial assumed values, the number of iterations and the time required for computations may become large. Computers can be used to solve network problems and other phases in designing distribution system in a number of different ways.This document describes various phases of development of Railway Online System It describes the methodology adopted in each phase, data design, external requirements, interface for the system and the code, which is through out complimented with comments for easy understanding during the maintenance phase.

ACKNOWLEDGEMENT
This project bears the imprint of many persons and it gives me great pleasure to express my heartiest gratitude towards them. I take this opportunity to express my deep sense of obligation to Mr. xxx for giving me an opportunity to undergo this training. Name : 3

ON-LINE RAILWAY RESERVATION SYSTEM I would like to show my sincere thanks to Mr. xxxxxxxxxxxxxxx for his ample guidance .He encouraged me on each and every step. Lastly, I would like to convey my reverential salutations to my friends and other member of the staff for their valuable suggestions and unending support.

Place: Lucknow Date :

INTRODUCTION

Name :

ON-LINE RAILWAY RESERVATION SYSTEM The purpose of the proposed system is to automate the whole functionality of Railway reservation, enquiry process, goods and parcel services of Indian Railways. The computerize system make our work easier very fast and very much accurate. The thinking of every person is that his work complete very quickly, easily, accurately.

ORGANIZATION FUNCTIONING:
The system perform following function: Reservation of the seat provide in Internet. Its depending on user. Administrator provides full security of database of the railway. For security of data, Administrator should be providing two paths. For accessing of information of any Train.

Name :

ON-LINE RAILWAY RESERVATION SYSTEM

User management assessment : This includes evaluation of the attitudes of senior and user managers within the organization as well as end users. Everybody has heaped accolades to the system for

giving a reliable, fast improvised with lot of ease in using system. Overall the system has changed the users working style and their throughput.

Development process: It includes evaluation of the development of

process in accordance with such yardsticks as overall development time and effort, conformance to budgets and standards, and project of management criteria. ands

Includes tools.

assessment

development

methods

By all means our development performance was fairly good as the project was completed with in budgets and there was no schedule slippage, target date was met, all along the standards that were followed were consistent.

Name :

ON-LINE RAILWAY RESERVATION SYSTEM

OBJECTIVE & SCOPE


I have developed software for an Indian railway

organization, which is used to reserve the railway coachs berths. This software helps the top official in railway

reservation and moreover we can say that it helps the railway coaches. With the above discussion a conclusion is drawn that all the components, which are covered by this project, display a good and Necessary part of railway reservation. So I say that my management to allot (reserve) the all type of

objective is to develop a railway reservation system. Now the title I give to my project is ON-LINE RAILWAY RESERVATION SYSTEM (RRS). Following points describes our Objective and requirements of the ON-LINE RAILWAY RESERVATION SYSTEM . 1. To decide the best platform, software and tools for the proposed system. 2. Provide security features in using the system like one administrator password, creating users and assigning privileges to users of the system.

Name :

ON-LINE RAILWAY RESERVATION SYSTEM 3. 4. System should be capable to keep track of detailed inventory. Various outputs (reports) should be available online any time. Details of these reports are given output section of the synopsis. 5. When administrator wants to close the current financial year the system should first prompt the user to take backup of the data files and then it should update the files for new financial year. Its facility provided by only permission of administrator. 6. With the help of this inventory system, the administrator should keep the records of different trains and different zone. 7. This system can maintain daily & periodic receipts (ticket) & payments.

USER TRAINING: Users of the proposed system had

already the feel of the system during the development stages. They were given user documentation, which gave them the exact steps to be performed for getting their job done starting from getting the terminals on. Most of the users were quick to get their job done in a right way after the very first training class. They were given the explicit advantages of the new system and also the

areas it was having shortcomings.

Name :

ON-LINE RAILWAY RESERVATION SYSTEM

PURPOSE, SCOPE AND APPLICABILITY

PURPOSE:If we maintain manually the we face many problems. That is a very complex work and take much time and that want much human power. That is not more effective and costly. With the Railwaymall management system very easily and take a very little time .That reduces human power and reduces the cost. SCOPE:This software can maintain almost all area of the Railwaymall management system. This software manages the area of employee management, Passenger management, Product management, billing report and report generator. Employee management can hold the records of employee. Employee management has shift master because various type of the employee in the Railwaymall management system. Passenger management can hold the records of the Passenger. This Railway mall has two types of Passenger. Permanent Passenger Temporary Passenger This software show the records of the Passenger and current and current credit. Product management can hold the records of product. Product management has product type master because various type of the product in the Railway management system. With the help of this software we know the current stock and expiry date of product. This software manages the manufacturer record. In this Railway management system various type of manufacturer. We can modify, delete and create the manufacturer. With the help of this software we create bill of the product. With the help of billing management we profit or loss and we about the product stock.

Name :

ON-LINE RAILWAY RESERVATION SYSTEM

THEROETICAL BACKGROUND

Theoretical Background So far we have talked about online computing and benefits from it; since our project is about Online purchasing and selling of items and involves e-commerce, let us talk about e-commerce for while and see how our project imbibes e-commerce features in it. What Is E-Ticketing? Electronic Commerce, commonly known as (electronic marketing Or ETicketing, consists of the buying and selling of product and services over electronic systems such as the Internet. Online item Store sells items to its Passengers through internet. Types of E-Ticketing website There are major three types of E-Ticketing websites: 1. Transactional Site: People who shop online are most familiar with this type of website. A transactional site can be an electronic store which sells goods directly to its Passengers. . 2. Information Deliver Site: This site generates sales by promoting corporate awareness rather than facilitating online transactions. Its function is similar to a brochure, providing information about the product or service and contact information on how to proceed with a purchase. 3. E-market Places: These sites are market-makers: they bring buyers finding and a sellers together without to the facilitate expense of transactions. building a Participation in a brokerage often provides an efficient way of Passenger proprietary transactional website. Project Online Railway belongs to Transactional site category.

Name :

10

ON-LINE RAILWAY RESERVATION SYSTEM Identifying your E-Ticket Deciding which markets to target is one of the most important decisions a potential business can take. Before reaching any decision a business should consider following points: 1. Step-by-Step approach to Market Research. 2. Studying Market research reports carefully, this would help in identifying potential market and risks involved. In this way a business can find suitable E-Ticket for their product and able to develop a strategy to minimize the risk factors.

Identifying your E-Ticket Deciding which markets to target is one of the most important decisions a potential business can take. Before reaching any decision a business should consider following points: 1. Step-by-Step approach to Market Research. 2. Studying Market research reports carefully, this would help in identifying potential market and risks involved. In this way a business can find suitable E-Ticket for their product and able to develop a strategy to minimize the risk factors.

Name :

11

ON-LINE RAILWAY RESERVATION SYSTEM

DEFINITION OF PROBLEM

Normal Railway system is having large number of entities in supply chain and profit sharing affecting the price to Passenger as well as low profit margins to the organization. Market area is limited to the availability of distributor / Dealer/ Retailer chain in specific physical area. Where as internet market availability is global. The manual system is slow, time consuming, with limited availability of brands, products and services available in local market. Manual system can support only offline Passengers with physical availability on shops. The security of data is always at risk.

Name :

12

ON-LINE RAILWAY RESERVATION SYSTEM

SYSTEM ANALYSIS
Both developer and Passenger take an active role in requirements analysis and specification. The Passenger attempts to reformulate a sometimes-nebulous concept of software function and performance into concrete detail. The developer acts as interrogator consultant and problem solver. Requirements analysis is a software engineering task that bridges the gap between system level software allocation and software design. Software Software Specification Specification

Software Software Requirements Requirements Analysis Analysis

Software Software Design Design

Analysis and a bridge between system engineering and software design. Requirement analysis enabler the system engineer to specify software function and performance indicate softwares interface with other system elements and establish constraints that software must meet. Software requirements analysis may be divided into five areas of effort: (a) (b) (c) Problem recognition. Evaluation and synthesis Modeling

Name :

13

ON-LINE RAILWAY RESERVATION SYSTEM (d) (e) Specification Review

Initially, the analyst studies the system specification and the software project plan. Problem evaluation and solution synthesis is the next major area of effort for analysis. Upon evaluating current problems and desired information (input and output) the analyst begins to synthesize one or more solutions.

IDENTIFICATION OF THE NEED


At present the company has a more than 5000 regular Passengers all over state. The hardworking marketing teams of the organization are covering them, booking their tikect and provided them with in stipulated time. Day by day as the working team is getting strong as well as the Passenger belt is also growing manifold. So the working is going to be affected with manual working i.e. manual ticket accounting, manual ticket sales accounting, and ticket inventory management as so on. So now management has decided to automate the whole functioning, so the problem facing Passengers can get relief & the working should also become smooth and transparent. Here human calculations ate always error prone; therefore s variations in calculations can change the ultimate results or sensitive outputs and hence can spoil the entire working of the system. In manually accuracy is always suspected. The existing system is completely manual.

Name :

14

ON-LINE RAILWAY RESERVATION SYSTEM The organization manually all this information is kept in books and different records are maintained manual working is definitely time consuming and error prone, which always becomes the cause of future errors. As there are a lot of details and information or records regarding to the booking detaile, booking counter, purchase ticket, ticket daily transaction, etc, which any Organization has to store so it is very difficult to store all the information as it takes a lot of time and the accuracy is very low as it is very cumbersome for the data operator to enter all the records manually in different formats. In the manual system maintaining the data in the registers (files) is very troublesome job, as it requires a lot of labour because the operator has to store the same piece of information again and again as the same record is related with different information recorded If the user needs the records, which can be kept in different, files then to search the required record from the huge database is very time consuming and needs a lot of labour. Moreover the system is not very safe as the data can be lost due to any natural and accidental happenings as moisture, fire, paper worms, wear and tear of the papers, etc.

Name :

15

ON-LINE RAILWAY RESERVATION SYSTEM

PRELIMINARY INVESTIGATION
Present system of On-Line Railway Reservation System is manual. The working of the organization May be described as: Before making this software, all details of Railway are maintained in registers. All Payments & dues are also maintained in registers. All ticker sale, daily ticket transaction, ticket sales invoice etc. are manually created. The daily-to-daily entries are also being manually.

Preliminary investigation took me to the Accounts room, where I came across the current working process. Although the process of maintaining data is not a recorded one as such there were no documents to be reviewed in order to determine efficacy of the current working process.

So I had to emphasize on the observation I made while in the office. In order to complement my onsite observations I undertook a simple interview of office bearers.

Name :

16

ON-LINE RAILWAY RESERVATION SYSTEM

FEASIBILITY STUDY
Before getting started on the new system it was important to determine the feasibility involved in the developed system so that the new system development could be develops. Feasibility is the determination of whether or not a project is not worth doing.

The project followed in making this determination is called a feasibility study. This type of study determines if a project can and should Be Taken. Once it has been determined that project is feasible, the analyst can go ahead and the prepare the project specification which finalizes project requirements.

Generally, feasibility studies are undertaken within tight time constraints and nory culminate in a written and feasibility report. The developed system is started after considering the main three types of feasibilities which are discussed below:(1)-Technical feasibility (2)-Operational feasibility (3)-Economic feasibility

Name :

17

ON-LINE RAILWAY RESERVATION SYSTEM

(1)-TECHNICAL FEASIBILITY: As we know the technical feasibility is concerned with specifying equipment and software that will successfully satisfy the user requirement. The technical needs of the system may very considerably, but might include: The facility to produce outputs in a given time. Response time under certain conditions. Ability to process a certain volume of transaction at a particular speed. Facility to communicate data to distinct location.

In examination technical feasibility, configuration of the system is given more importance than the actual make of hardware. The configuration should give the complete picture about the systems requirements: How many workstations so that are they required, could how these and units are

interconnected smoothly?

operate

communicate

Name :

18

ON-LINE RAILWAY RESERVATION SYSTEM

2)-ECONOMIC FEASIBILITY:
Economic analysis is the most frequently used technique for

evaluating the effectiveness of a proposed system. More commonly known as cost/benefits analysis the procedure is to determine the benefits and savings that are expected from a purposed system and compare with costs. If benefits out weigh cost, a decision is taken to design and implement the system otherwise further justification or alternative in the proposed system will have to be made if it is to have a chance of being approved. This is an on going effort that improves in accuracy at each phase of the system life cycle. The analysis part also clears the doubt of economic problems could be possible in developing the system. As already mentioned that the company has to just pay the developed software cost and not other investment is needed at the time of implementation of the new system as the preliminary requirement are already exist in the company.

Name :

19

ON-LINE RAILWAY RESERVATION SYSTEM

3)-OPERATIONAL FEASIBILITY:
Proposed projects are beneficial only if they can be turned into information system that will meet the operating requirements of the organization. This test of feasibility asks if the system will work when it developed and installed. Are there major barriers to implementation? Some of the important questions that are useful to test the operational feasibility of a project are given below: Is there sufficient support for the project from the implementation? From user? If the present system is well liked and used to the extent that persons will not be able to see reasons for change, there may be resistance. Are current business methods acceptable to the user? If they are not, user may welcome a change that will bring about a more operational and useful system. Will the proposed system cause harm? Will it produce poorer result in any case or area? Will the performance of staff member fall down after implementation?

Name :

20

ON-LINE RAILWAY RESERVATION SYSTEM Issue that appears to be quite minor at the early stage can grow into major problem after implementation. Therefore, it is always advisable to consider operational aspects carefully. The system is developed in keeping mind that it should be user friendly and easy to operate hence the system is operational feasible.

Name :

21

ON-LINE RAILWAY RESERVATION SYSTEM

PROTOTYPE TYPE MODAL


Often, a Passenger defines a set of general objectives for software but does not identify detailed input, processing, or output requirements. In other cases, the developer may be unsure of the efficiency of an algorithm, the adaptability of an operating system, or the form that human-machine interaction should take. In these and many other situations, a prototyping paradigm may offer the best approach. The prototyping paradigm begins with requirements gathering. Developer and Passenger meet and define the overall objectives for the software, identify whatever requirements are known, and outline areas where further definition is mandatory. A quick design then occurs. The quick design focuses on a representation of those aspects of the software that will visible to the Passenger/user (e.g., input approaches and output formats). The quick design leads to the construction of a prototype. The prototype is evaluated by the Passenger/user and is used to refine requirements for the software to be developed. Iteration occurs as the prototype is tuned to satisfy the needs of the Passenger, at the

Name :

22

ON-LINE RAILWAY RESERVATION SYSTEM same time enabling the developer to better understand what needs to be done. Ideally, the prototype serves as a mechanism for identifying software requirements. If a working prototype is built, the developer attempts to make use of existing program fragments or applies tools (e.g., report generators, window manager, etc.) that enable working programs to be generated quickly. The prototype can serve as the first system. It is true that both Passengers and developers like the prototyping paradigm. Users get a feel for the actual system and developers get to build something immediately. Yet, prototyping can also be problematic for the following reasons: 1. The Passenger sees what appears to be a working version of the software, unaware that the prototype is held together with chewing gum and baling wire, unaware that in the rush to get it working we havent considered overall software quality or long term maintainability. When informed that the product must be rebuild so that high levels of quality can be maintained, the Passenger cries foul and demands that a few fixes be applied to make the prototype a working product. Too often, software development management relents.

Name :

23

ON-LINE RAILWAY RESERVATION SYSTEM 2. The developer often makes implementation compromises in order to get a prototype working quickly. An inappropriate operating system or programming language may be used simply because it is available and known, an inefficient algorithm may be implemented simply to demonstrate capability. After a time, the developer may become familiar with these choices and forget all the reasons why they were inappropriate. The lessthan-ideal choice has now become an integral part of the system. System Reference The objective of On Line Railway Reservation System is to help the organization in automating the whole manual processing of the existing system. As the system is based on a set of complex mathematical calculations, a high level of accuracy is maintained throughout the whole processing. Manual calculations are error prone and are sometimes very time & resource consuming. The main aim is thus to make the results accurate, fast and with a minimum stress on the designer/end user.

Name :

24

ON-LINE RAILWAY RESERVATION SYSTEM

1.

Information Description
Information content representation: The main objective to develop the system is to make the accurate & efficient decisions in different tasks at different time at different situations. The existing system is manual so a member of the unit generally faces a lot of embarrassing situations many times. Now they need to automate the whole process so as to make it more easy and accurate. As they need to expand their work and hence their workload shall increase so they require a reliable, efficient and supportive system. Different people who are working under the organization handle their different tasks. Hence, to perform all the functions less than one system is required. Gathering relevant information from various people was not an easy task. It took a lot of time to understand their working, as thy were not able to explain everything properly. Therefore, a prototyping approach was followed. After much initial study, the complete picture of the system came into mind

Name :

25

ON-LINE RAILWAY RESERVATION SYSTEM and the process started. Initial designing was also made clear to the users so that they are satisfied with the content or if they require something more or enhanced. Analysis: System Analysis is the main feature of the software field. It can be said that it is a sole of any of the system. The analysis needs an expert supervision & the person should be minimum System Analysts with the experience of 5 to 7 yrs. One can use some of the different tools to analyze the system. Some of the tools we have used to analyze the problem are given below: Analysis Tool: Data collection Tools: We have collected the information regarding the current system & procedures, which are going on. These collections help us to understand the old systems know how. Charting Tools: The Graphical Representation of system & activities help us to understand the minor problems & and the flow of procedures, which can become very helpful in analysis as well as to generate the new systems requirements.

Name :

26

ON-LINE RAILWAY RESERVATION SYSTEM Dictionary Tools: This tool helps us to maintain & record the data & description of system elements through Data items, processes & data stores After the use of tools we have to analysis of a system through main four factors. Capacity: Current system: First of all we have to collect the information of current system, which help us to collect the benefits & limitations of the current system. Equipment: - Secondly we have to collect the information about hardware requirement.

Space: - This piece of information can be useful when we have to collect the information about storage space for existing system & expected storage after new system. Procedure: - Which type of procedures is going on, this study is being useful to analyze that if all procedures are doing well or if there is a need for change?

Name :

27

ON-LINE RAILWAY RESERVATION SYSTEM

SOFTWARE REQUIREMENT SPECIFICATION


The software requirements specification is produced at the culmination of the analysis task. The function and performance allocated to software as part of system engineering are refined by establishing a complete information description a detailed functional and behavioral description, an indications of performance requirements and design constraints, appropriate validation criteria and other data pertinent to requirements. 1. Introduction a. b. c. Purpose Scope Definition, Acronyms, Abbreviations d. References e. 2. Developers Responsibilities Overview

General Description a. b. C. d. Product Functions Overview User Characteristics General Constraints General Assumptions and Dependencies

3.

Specific Requirements a. b. Inputs and Outputs Functional Requirements 28

Name :

ON-LINE RAILWAY RESERVATION SYSTEM c. External Interface Requirements d. e. Performance Constraints Design Constraints (i) (ii) 4. Software Constraints Hardware Constraints

Validation and Criteria a. b. c. d. Performance bounds Classes of tests Expected Software response Special Considerations

5. 1.

Acceptance Criteria INTRODUCTION: This is the requirements document for the

project that will be used throughout the work. The system to be developed is for ticket sales, inventory purchase and financial work of railway, based on the inputs given. This document follows the IEEE standard for a requirement

specification document, with some variations. (A). Purpose: The purpose of this document is to describe the requirements of Railway. It also describes the interfaces for the system. (b). Scope:

Name :

29

ON-LINE RAILWAY RESERVATION SYSTEM This document is the only one that describes the

requirements of the system. It is meant for use by the developers and will be the basis for validating the final delivered system. Any changes made to the requirements in the future have to go through a formal change approval process. The developer is responsible for asking for clarifications, where necessary, and will not make any alterations without the permission of the client. (c). Definitions, Acronyms, and Abbreviations: Not applicable. d). References: Not applicable. (e). Developers Responsibilities Overview: The developer is responsible for (i) (ii) (iii) Developing the system Installing the software on the clients hardware, conducting any user training that might be needed for using the system, and (iv) Maintaining the system for a period of one year after installation.

Name :

30

ON-LINE RAILWAY RESERVATION SYSTEM

2. GENERAL DESCRIPTION: (A). Product Functions Overview: In Railway there is a counter for Ticket sales, Ticket counter sales, etc. and various queries of the cusomers can be solved with ease on one table. As the software provide all information regarding pharmacy. (b). User Characteristics: The main users of this system will be the Ticket counter sales department, tickeyt department and ticket stock maintenance department, who are somewhat literate with computers and can use programs efficiently. (c). General Constraints: The system should run on win 95 /98/2000 server or above. (d). General Assumptions and Dependencies: Not applicable. 3. SPECIFIC REQUIREMENTS: (A). Inputs and Outputs:

Name :

31

ON-LINE RAILWAY RESERVATION SYSTEM The system has several inputs in form of data entry and

several outputs in form of bills, reports etc. Here also, the Passenger gets the desired booking and accordingly the bills and report are generated. In local duty slip, Passenger tells their requirements and all the details regarding Tickety booking is provided on the desk. Accordingly, the booking is done and the report in form of duty slip is generated and given to the driver of that ticket (b). Functinal Requirements: It present description of each function required to solve the problem. A processing narrative is provided for each function, design constraints are stated and justified, performance characteristics are stated, and one or more diagrams are included to graphically represent the overall structure of the software and interplay among software functions and other system elements under this topic, the functional working of the various modules where give the complete picture for the data flow from one location to other. (c). External Interface Requirements: Only one user command is required. The file name must be prompted by the system in status bar. (d). Performance Constraints:

Name :

32

ON-LINE RAILWAY RESERVATION SYSTEM The reports and bills should be printed in less than 1 minute. (e). Design Constraints: The system is to run under the WINDOWS operating system. 4. VALIDATION CRITERIA:Probably the most important section of a software requirements specification is validation Criteria. The

specification of validation criteria acts as an implicit review of all other requirements. The tests must be conducted to validate function, performance and constraints. In this project I have try the various steps in testing the links and connectivity of the data Directorate of public grievances takes up a grievances where it is satisfied that eh matter has not been dealt with by the concerned SSA in a fair, just or objective manner or has been unduly delayed. It may take up such a care for investigation, call for a report and or file from the concerned SSA and ask them to reconsider the matter and to arrive at a fair decision in a time bound manner. 5. ACCEPTANCE CRITERIA Before accepting the system, the developer must demonstrate that the system works on the course data for the lat 4 semesters. The developer will have to show through test cases that all conditions are satisfied.

Name :

33

ON-LINE RAILWAY RESERVATION SYSTEM

Software and Hardware Requirement


SOFTWARE REQUIREMENTS
Programming Language Operating System Server side For documentation : Asp.Net With C# : Microsoft Windows XP : Ms-Sql-Server : MS Office 2000 or later version

HARDWARE REQUIREMENTS
Processor RAM HDD Monitor CD drive Floppy drive Key board Mouse : 1 GHz Intel Pentium or other : 128 MB : 1 GB of free hard Disk space : 15 SVGA Monitor : 32X or later : 1.44 MB 3.5 Floppy Drive : 102 keys normal keyboard : 2 or 3 buttons normal mouse.

PERIPHERAL DEVICES
Scanner Digital Camera Laser Printer (1,200 x 1,200 dpi) Dot Matrix Printer (24-pin Print Head, 136 Column)

Name :

34

ON-LINE RAILWAY RESERVATION SYSTEM

Project Planning and Scheduling


System Planning (PERT Chart) Scheduling of a software project is similar to the scheduling of any multitask engineering effort. Therefore generalized project scheduling tools and techniques are applied to software with little modification, in fact this phase of scheduling greatly helps in systematic planning of the development of software, thus resulting in an efficient software product Program Evaluation and Review Technique (PERT) is a project scheduling method that can be applied to software development. This technique is driven by information already developed in earlier project planning activities: o Estimates of efforts o A decomposition of product function o The selection of the appropriate process model o The selection of project type and task set PERT provides the quantitative tools that allow the software planner to o Determine the critical path-the chain of tasks that determines the duration of the project o Establish most likely time estimates for individual tasks by applying statistical models o Calculates boundary time that defines the time window for a particular task.

Name :

35

ON-LINE RAILWAY RESERVATION SYSTEM PERT duration estimates: Optimistic time (a): Time an activity will take if everything goes perfectly Most likely time (m): Most realistic time estimate to complete the activity Pessimistic time (b): Time activities take if everything goes wrong From these we calculate the expected time (t) for the task. The time estimates are often assumed to follow the beta probability distribution: Expected time t = (a + 4m + b) 6 In this project: a= 170 days b= 190 days m=180 days Thus, Expected time t = = (170 + 4*180 + 190) 6 180

The tabular description is given below:System Planning (PERT Chart) PERT Chart (Project Evolution Review Technique) Maximum Allotted Days 16 4 4 4 4 25 10 10 2 1 1 1 1 1 4

S.No. 1

ACTIVITIES Scope Definition *List The Problems *Define Scope *Develop Project Plan *Present Project Plan Problem Analysis *Analyze Current System *Problem Statement

Extra Days 4

Name :

36

ON-LINE RAILWAY RESERVATION SYSTEM *Propose Solution(s) 3 Requirement Analysis *Identify Requirements *Analyze Requirements Feasibility Study Conduct Feasibility analysis Logical Design Prepare DFDs Physical Design Database Design Construction & Testing Coding Testing Installation & Delivery 5 19 9 10 10 10 10 10 15 15 65 45 20 10 10 170 24 1. Scope Definition: The first phase a typical project is scope Definition. The purpose of scope definition is to define problem (but not to solve it) and establish size and boundaries of the project. Relevance of project is also reflected here. 2. Problem analysis: The Problem analysis phase studies the existing system and analyzes the findings to provide project team with more thorough understanding of the problems that triggered the project. The purpose of this stage is to pin-point all the problems in the existing system and after conducting thorough analysis analyst can recommend possible solution(s). 3. Requirement analysis: During this stage analyst approaches the users to find out what they need or want from the new system, carefully avoiding any discussion of technology or technical implementation. User requirements are analyzed in terms of functional and nonfunctional requirements. 4. Feasibility Study: The purpose of feasibility study is to decide whether or not proposed system(s) is worthwhile. 5 2 2 5 2 2 2 1 2 2 1 3

Name :

37

ON-LINE RAILWAY RESERVATION SYSTEM Proposed systems are compared with each other; economic, Technical and operational feasibility test are done at this stage. This stage makes us able to choose desired solution/system to solve give problems. 5. Logical Design: At this stage we prepare logical designs; for example, Data flow diagrams (DFDs). Logical Designs should be interpreted as Technology Independent, meaning that pictures illustrate the system independent of any possible technical solutions- hence we model requirements that must be fulfilled by any technical solution we might want to consider. 6. Physical Design: The purpose of physical design is to transform business requirements into physical design specification that will guide system construction. Database designing is done at this stage. There are two extreme philosophies of physical design: Design by Specification: Physical System models and detailed specifications are produced as a series of written blueprints for construction. Design by Prototyping: Incomplete but functioning applications or subsystems (called prototypes) are constructed and refine based on feedback from user and other designers. 7. Construction & Testing: The purpose of this phase is twofold: (1) to build and test a system that fulfills business requirements and physical design specification and (2) to implement the interfaces between new system and existing system. Additionally, Final Documentation will be developed in preparation for training and system operation. Coding and testing are two important sub stages of this phase. 8. Installation and Delivery: The purpose of this stage is to provide smooth transition from the old system to the new system and help user to cope with normal start-up problems. Installation and delivery phase serves to deliver the system into operation.

Name :

38

ON-LINE RAILWAY RESERVATION SYSTEM

Scope Definition
1-Sep-10/22-sep-10 Duration 16 days

PROJECTEVALUATION AND REVIEW TECHNIQUE Pert Network Chart

Problem Analysis
19-Sep-10/22-Oct-10 Duration 25 days

Requirements Analysis
20-oct-10/13-Nov-10 Duration 13 days

Feasibility Study
13-Nov-10/26-Nov-10 Duration 10 days

Logical Design
24-Nov-10/6Dec10 Duration 10 days

Physical Design
4-Dec-10/24-Dec-10 Duration 10 days

Construction &Testing
24-Dec-10/27-Feb-11 Duration 65 days

Installation & Delivery


27-Feb-11/12-Mar-11 Duration 10 days

Name :

39

ON-LINE RAILWAY RESERVATION SYSTEM

System Planning GANT CHART What is Gantt chart?


A Gantt chart is a horizontal bar chart developed as a production control tool in 1917 by Henry L. Gantt, an American engineer and social scientist. Frequently used in project management, a Gantt chart provides a graphical illustration of a schedule that helps to plan, coordinate, and track specific tasks in a project. As seen below this type of chart shows the start and end of a number of tasks and shows their timing relationship relative to each other. The bar for each task stretches from the starting date of the task to the end of the task. The bars can be color coded to show if the task is running behind schedule or based on resources required for the task.

Task Name
Scope Definition Problem Analysis

Gantt chart

Requirement Analysis Feasibility Study

Logical Design Physical Design Construction & Testing Installation &Delivery

Sep10

oct10

nov10

dec10

jan11

feb11

mar11

Time

Name :

40

ON-LINE RAILWAY RESERVATION SYSTEM

Methodology adopted, System Implementation & Details of Hardware & Software used. Methodology Adopted
A software development process is a structure imposed on the development of a software product. There are several models for such processes, each describing approach/methodology to a variety of tasks that take place during the process. Some most common software development process models are listed below: i) Waterfall Model. ii) Spiral Model. iii) Prototyping Model. The prototyping model was most suited for our project. Let us see how prototyping model works. Why Prototyping Model was adopted?: In our situation where user were not clear about their requirements, we decided that the prototyping model would be the best approach to be adopted. Prototyping Model: The prototyping paradigm begins with the requirement gathering. Developers meet customers and define the overall objectives for the software, identify need requirements and outlines areas where further definition is necessary. A design then occurs. A prototype or model based on the gathered requirements for software is then prepared. It is then evaluated by the user and is used to define requirements for the software to be developed. Iteration occurs as the prototype is turned to satisfy the needs of the customer, at same time enabling the developers to better understand what needs to be done. Steps followed in prototyping model: The process of prototyping involves the following steps 1. Identify basic requirements Determine basic requirements including the input and output information desired. Details, such as security, can typically be ignored.

Name :

41

ON-LINE RAILWAY RESERVATION SYSTEM 2. Develop Initial Prototype The initial prototype is developed that includes only user interfaces. 3. Review The customers, including end-users, examine the prototype and provide feedback on additions or changes. 4. Revise and Enhance the Prototype Using the feedback both the specifications and the prototype can be improved. Negotiation about what is within the scope of the contract/product may be necessary. If changes are introduced then a repeat of steps #3 ands #4 may be needed. Advantages of using prototyping Model: 1. Misunderstanding between software users and developers are exposed. 2. Missing services may be detected and confusing services may be identified. 3. A working system is available early in the process. 4. The prototype may serve as a basis for deriving a system specification.

Name :

42

ON-LINE RAILWAY RESERVATION SYSTEM

System Implementation
Implementation includes all those activities that take place to convert from old system to new one. The new system may be completely new, replacing an existing manual or automated system or it may be major modification to an existing system. In either case, proper implementation becomes necessary so that a reliable system based on the requirements of the organization can be provided. Successful implementation may not guarantee improvement in the organization using the new system, but improper installation will prevent it. There are three stages in an implementation process: Training Personnel Application of Conversion procedure Post implementation review a) Training Personnel: Running of the system successfully depend on the user of the computer software. Training the users includes basic operability features such as rules and regulations for operating the software to optimum benefit. It is a feature where a line is drawn showing the similarities between the existing system, which the user is quite adapt with and the new system. The user is shown the benefits which now he gets through a computerized process. He is made to understand the cohesion between the present system and the new system. With a better understanding of the present system a user is more capable of understanding a system which has strong linkages to the present one. This is what is emphasized during the training stage. Successful culmination of training means that the user has a better understanding of the new system vis--vis the older one and the benefits the newer one offers over the older one. Since a user is already adapt to computer, understanding other basic features including maintenance of data security and integrity is not a difficult task. The training is conducted on-the-site as the users of the proposed system are quite busy and cannot spare time for off-site training. b) Application of Conversion procedure: Parallel System: This is the safest method for converting the system from old to new one. Users continue to operate the old system in the usual manner but they start using the new system alongside. The method is safest one Name : 43

ON-LINE RAILWAY RESERVATION SYSTEM because it ensures that in case of any problems during the first real time operations of the new system, the organization can still fall back on the older one. c) Post implementation review: After the system is implemented and conversion is complete the review plan is conducted to determine whether the system is meeting expectations and where improvements are needed. System is measured against pre-defined requirements. Thorough study is done to determine whether the new system requires re-designing or not. Information required for it, begins with the review plan, during which user views are kept into consideration.

System Maintenance & Evaluation

Once a system has been installed and fully operational, the systems maintenance task begins. Under this, the system is made to operate properly. Say for example; if some server related error occurs while website is operating the maintenance staff has to sort out the errors and to make website fully functional again in least possible time. Maintenance tasks are assigned to a special team consisting of programmers and network experts. Thus the responsibility of the system is transferred from the development team to the maintenance team. The maintenance programming teams job involves; 1. Keeping website operational at all time. 2. Monitoring of websites operations. 3. Monitoring Network traffic (that is; client requests) 4. Modifying website in response to new user requirements. Types of System maintenance: There are three types of system maintenance; 1. Corrective Maintenance: Corrective maintenance is performed to correct any errors in newly implemented system. The errors that may be of following type: errors related to program logic, system errors, user errors etc. 2. Adaptive Maintenance: Adaptive maintenance is performed to cope up with the changing requirements of the market and organization. It is performed with a view to keeping the website up-to-date with current business needs and technology. Name : 44

ON-LINE RAILWAY RESERVATION SYSTEM 3. Perfective Maintenance: Perfective maintenance is performed to further improve the efficiency of the working system. Modifying data structures, backing records and eliminating temporary work files are of the methods for improving overall system efficiency.

Name :

45

ON-LINE RAILWAY RESERVATION SYSTEM

Cost Estimation of the Project

COST-BENEFIT ANALYSIS
The Primary objective of cost-benefit analysis is to find out whether it is economically worthwhile to invest in the proposed project. If the return on the investment is high, then the project is considered economically worthwhile. The three types of cost and benefits are: 5. Tangible or Intangible. 6. Fixed or Variable. 7. Direct or Indirect. 1. Tangible or Intangible: Tangible means that which is definite and can therefore be determined in advance. Tangible cost means that it is known and can be estimated quite accurately. For example; cost of salaried of employee. Intangible cost refers to something which is known to exist, but financial value of which cannot be accurately assessed. For example; the cost of breakdown of an on-line system for one hour would cause the organization loose its profit, but exact cost cannot be estimated immediately. Tangible benefits can be ascertain accurately for example, completing job in less time would consider a tangible benefit whereas intangible benefits can not be ascertain, for example; benefits from companies Good will cannot be ascertain easily. 2. Fixed or variable: Costs that do not change are fixed costs. For example; hosting charges paid by company for website. Cost can also be variable. Variable cost are those costs are those that are incurred periodically and vary with the volume of work. For example; Memory used by website may vary form time to time. Web charges are based on the amount of memory used. Fixed benefits are constant and do not change. For example; decreasing the number of employees by 20%, due to the use of computer based system. These types of benefit come under fixed benefits. Variable benefits, on other hand are realized on an irregular basis. For example; profits earn form stock clearing sale. 3. Direct and Indirect: Direct costs are those costs directly associated with the system that are incurred in buying equipment, employing people, cost of consumable items Name : 46

ON-LINE RAILWAY RESERVATION SYSTEM etc. indirect costs are the result of operations that are not directly associated with a given system or activity. For example; cost incurred during maintenance of website. Benefits can also be direct or indirect. A new system that handles 25% more transactions per day comes under direct benefits. Indirect benefits are achieved as a by-product of another activity or system. For example; advertising tags appearing on website and benefits gained from it. Cost Estimation models Cost estimation models are mathematical algorithms or parametric equations used to estimate the costs of a product or project. The results of the models are typically necessary to obtain approval to proceed, and are factored into business plans, budgets, and other financial planning and tracking mechanisms.

The most commonly used cost estimation model is COnstructive COst Model (Also known as COCOMO). COCOMO is an algorithmic Software Cost Estimation Model developed by Barry Boehm. The estimation of cost of the project is a difficult task but we can estimate the cost of the project by various methods.

Name :

47

ON-LINE RAILWAY RESERVATION SYSTEM I am using the COCOMO (Constructive Cost Model).
The model has following hierarchy: -

Model 1: - The

basic

COCOMO

model

computed

software

development effort land cost as a function of program size expressed in estimated lines of code. Model 2: - The intermediate COCOMO model computer software development effort as a function of program size and a set of cost drivers that include subjective assessments of product, hardware personnel and project attributes. Model 3: - The advanced COCOMO model incorporates all

characteristics of the

intermediate version with an assessment of step (analysis, design etc.) of the

the cost drivers impact on each software engineering process.

The COCOMO model is defined for three classes of software projects are: -

COCOMO II is a model that allows one to estimate the cost, effort, and schedule when planning a new software development activity. The most fundamental calculation in the COCOMO II model is the use of the Effort Equation to estimate the number of PersonMonths required to develop a project. Most of the other COCOMO II

Name :

48

ON-LINE RAILWAY RESERVATION SYSTEM results, including the estimates for Requirements and Maintenance, are derived from this quantity.

COCOMO II Effort Equation The COCOMO II model makes its estimates of required effort (measured in Person-Months PM) based primarily on your estimate of the software project's size (as measured in thousands of SLOC, KSLOC)): With approximately 5000 Source Lines of Code (SLOC), Effort = 2.94 * EAF * (KSLOC)E = 2.94 * 1.0115 * (5) 1.0997 = 17.46 Person-Months Where EAF Drivers E Is an exponent derived from the five Scale Drivers Is the Effort Adjustment Factor derived from the Cost

COCOMO II Schedule Equation: The COCOMO II schedule equation predicts the number of months required to complete your software project. The duration of a project is based on the effort predicted by the effort equation: Substituting the exponent of 0.3179 that is calculated from the scale drivers, Duration = 3.67 * (Effort)SE Name : 49

ON-LINE RAILWAY RESERVATION SYSTEM = 3.67 * (17.46) 0.3179 = 9.12 Months Where Effort SE Is the effort from the COCOMO II effort equation Is the schedule equation exponent derived from the five

Scale Drivers

Final Cost
Cost= Effort * Hours per Person Month * Labour Rate With 192 hours per person month and labour rate of Rs. 35 per hour Cost= 17.46 * 140 * 40 = Rs. 97776.00

Name :

50

ON-LINE RAILWAY RESERVATION SYSTEM

DATA MODEL, CONTROL FLOW DIAGRAM, ERDIAGRAM DATA FLOW DIAGRAM:The data flow diagram shows the flow of data with in any system. It is an important tool for designing phase of software engineering. Larry Constantine first developed it. It represents graphical view of flow of data. Its also known as BUBBLE CHART. The purpose of DFD is major transformation that will become in system design symbols used in DFD:In the DFD, four symbols are used and they are as follows. 1. A square defines a source (originator) or destination of system data.

2. An arrow identifies data flow-data in motion. It is 2a pipeline through which information flows.

3. A circle or a bubble (Some people use an oval bubble) represents a process that transfers informing data flows into outgoing data flows.

4. An open rectangle is a data store-data at rest, or a temporary repository of data.

Name :

51

ON-LINE RAILWAY RESERVATION SYSTEM

Context Level Data Flow Diagram: This level shows the overall context of the system and its operating environment and shows the whole system as just one process. Online book store is shown as one process in the context diagram; which is also known as zero level DFD, shown below. The context diagram plays important role in understanding the system and determining the boundaries. The main process can be broken into sub-processes and system can be studied with more detail; this is where 1st level DFD comes into play.

DATA FLOW DIAGRAM

Reports Online Railway Management System

Request for Ticket USER/EMPLOYEE

Log in Detail Administrator Acknowledgment Request for Reports

Daily Booking/Cancel detail Receipt

Define Responsibilities/Create new User

Payment Request for Ticket Passenger Tickets Bills

Name :

Context Level Diagram of Railway Management System

52

ON-LINE RAILWAY RESERVATION SYSTEM First Level DFD:

This level (level 1) shows all processes at the first level of numbering, data stores, external entities and the data flows between them. The purpose of this level is to show the major high-level processes of the system and their interrelation. A process model will have one, and only one, level-1 diagram. A level-1 diagram must be balanced with its parent context level diagram, i.e. there must be the same external entities and the same data flows, these can be broken down to more detail in the level 1. 1st level DFD for online book store is given below; detail in the level 1. 1st level DFD for online Railway Reservation is given below;

Name :

53

ON-LINE RAILWAY RESERVATION SYSTEM

Login process Administrator Login

1.1 Admin Details (Entry Details) User Creation Process

Check Valid User

Tickets Store into Ticket File

1.3 1.2 New User Creation Process Ticket Booking Process Use transaction

Recruit Employee

Ticket Detail

1.4 Employee Management Emp Details Employee File Flight Detail 1.5 Ticket Booking Process Store Sales Information into file User Booking/Cancel Ticket

1.6 Report Gen Process

Request for report

User/Employee

Ticket Sales

Name :

54

On-Line Railway ON-LINE RAILWAY RESERVATION SYSTEM Managemen t

ER-DIAGRAMS

Entity-relationship model:The entity-relationship model or entity-relationship diagram (ERD) is a data model or diagram for high-level descriptions of conceptual data model, and it provides a graphical notation for representing such data models in the form of entity-relationship diagrams. Such models are typically used in the first stage of information-system design; they are used, for example, to describe information needs and/or the type of information that is to be stored in the database during the requirement analysis. The datamodelling technique, however, can be used to describe any ontology (i.e. an overview and classifications of used terms and their relationships) for a certain universe of discourse (i.e. area of interest). In the case of the design of an information system that is based on a database, the conceptual data model is, at a later stage (usually called logical design), mapped to a logical data model, such as the relational model; this in turn is mapped to a physical model during physical design. Note that sometimes, both of these phases are referred to as "physical design". There are a number of conventions for entityrelationship diagrams (ERDs). The classical notation is described in the remainder of this article, and mainly relates to conceptual modelling. There are a range of notations more typically employed in logical and physical database design.

Name :

55

ON-LINE RAILWAY RESERVATION SYSTEM

ENTITY RELATIONSHIP DIAGRAM


ER_DIAGRAM

Administrator

1 Check 1

Railway

1 Require Service

Repo rting n Employee

Handle Trans n

n m Book/ Cancel Name m Bill m Ticket PNRNO Passenger

m Type

Book/Canc el

Datee

PNRNO

Bill No

Total Bill

ER Diagram For Railway Management System

Name :

56

ON-LINE RAILWAY RESERVATION SYSTEM

PROCESS INVOLVED
The processes that makes online book store functional are described bellow: 1. Member Control and management System: This process is responsible for managing and controlling members. Following are the activities controlled by this process: 1. It handles registration requests. 2. It handles All Log-Ins and Log Outs. 3. It enables admin to block or delete user form website. 4. It enables admin to view details of all registered users. The following context diagram member control and management system is given below:

2. Ticket control and management system: This process is responsible for handling following activities: 1. 2. 3. 4. Add new Ticket(s) on to the system. Delete existing Item(s) form the system. Editing details and other information relating to Items. Helps preparing bills by providing relevant information ticket Price.

Name :

57

ON-LINE RAILWAY RESERVATION SYSTEM

Important functions of this process are shown in the following diagram:

Name :

58

ON-LINE RAILWAY RESERVATION SYSTEM

Billing System

Add/Edit/Delete Items Request Information

ADMIN

Product& Price Information

Ticket Control & Management System

View Item Details

3. Billing System: The billing process is responsible for handling following activities: 1. It generates customer bill and records the details of bills for further processing. 2. It provides useful information about items ordered, price, name, address of customer and their contact details etc. 3. It helps admin to manage customer orders. The following diagram would helps in understanding the functions of billing system:

Name :

59

ON-LINE RAILWAY RESERVATION SYSTEM

4. Searching System: The searching process is responsible for handling search requests and generates appropriate search result(s). The working of search system can be understood by following diagram.

Name :

60

ON-LINE RAILWAY RESERVATION SYSTEM

5. Message System: The messaging system provides following facilities; 1. Sending Messages to different members. 2. Records important contacts in address book. 3. Receiving messages into respective inboxes. 4. Helps user & admin to manage their messages. The following diagram shows the working of messaging system:

Name :

61

ON-LINE RAILWAY RESERVATION SYSTEM

Methodology used for testing

What is software testing? Software testing is a critical element of software quality assurance and represents the ultimate review of specification, design and coding. This is an activity carried out to uncover all possible errors. Purpose of testing The purpose of software testing is to ensure whether the software functions appear to be working according to specifications and performance requirements. Testing Guidelines to be followed o All tests should be traceable to customer requirements. o Test should be planned long before testing begins. o Exhaustive testing is not possible. o Testing should begin in the small and progress towards in the large. Approach to software testing There are two general approaches for software testing: 1. Black box Testing: Black box testing treats the software as a Black Box without any knowledge of internal implementation. The black box testing is used to demonstrate that the software functions are operational. Black box testing is also known as functional testing. The major focus of black box testing is on functions, operations, external interfaces external data and information. Black box testing tries to fiend errors in the following categories: (1) Incorrect or missing functions, (2) interface errors, (3) errors in data structure or external database access, (4) performance errors and (5) initialization and termination errors.

Name :

62

ON-LINE RAILWAY RESERVATION SYSTEM

2. White Box Testing: In white box testing the procedural details are closely examined. In this testing the internals of software are tested to make sure that they operate according to specifications and designs. Thus major focus of white box testing is on internal structures, logic paths, control flow, data flow, loops, conditions, etc. White box testing is also known as structural testing. Testing Strategy Adopted Testing strategy adopted by us is described in great details in following section; Testing strategies for conventional software are: o Unit Testing. o Integration Testing. o System Testing. o Acceptance testing. Following diagram describes them bellow;

1. Unit Testing: In unit testing individual components are tested independently to ensure their quality. The focus is to uncover the errors in design and
Name : 63

ON-LINE RAILWAY RESERVATION SYSTEM

implementation. Various tests that are conducted during this phase are: 1. Module interfaces are tested for proper information flow in and out of the program. 2. Local data are examined to ensure that integrity is maintained. 3. Boundary Conditions are tested to ensure that the module operates properly at boundaries established to limit or restrict processing. 4. All the basic (independent) paths are tested for ensuring that all statements in the module have been executed only once. 5. All error handling paths must be tested. 2. Integration Testing: A group of dependent components are tested together to ensure their quality of integration. The focus of integration testing is to uncover errors in: 1. Design and construction of software architecture. 2. Integrated functions or operations. 3. Interfaces and interaction between them. 4. Resource integration and environment integration. 3. System Testing: The System test is a series of test conducted for fully computer based system. Various type of tests are conducted: 1. Recovery testing. 2. Security testing. 3. Stress testing. 4. Performance testing. 4. Acceptance Testing: The acceptance testing is a kind of testing conducted to ensure that software works correctly in user work environment. Types of acceptance testing: 1. Alpha test: Alpha testing takes place at developers site and involves testing of the operational system by internal staff before it is released to external customer.
Name : 64

ON-LINE RAILWAY RESERVATION SYSTEM

2. Beta test: Beta testing takes place at customers sites and involves testing by group of customers who use the system at their own location and provide feedback.

Test Report
Note: Testing is done for all the modules contained in our project; only important modules were discussed in this test report. Objective: The objective of this report is to define strategy and methodology used to plan, organize and execute testing of our web project and finally listing out result of the testing to interested parties. Glen Myers states a number of rules that serve as testing objectives. 1. Testing is a process of executing a program with intent of finding an error(s). 2. A good test case is one that has a high probability of finding an as yet discovered error. Preparation of this report is done keeping these objectives and guideline in mind.
Name : 65

ON-LINE RAILWAY RESERVATION SYSTEM

Methodology Adopted Clients Needs Testing Acceptance

Requirements

System Testing

Design Testing

Integration

Code

Unit Testing

Test cases applied during testing What is Test Case? A test case is a set of conditions or variables and inputs that are developed for particular goal or objectives to be achieved on a certain application to judge its capabilities or features. Thus; it is important develop valid test cases to achieve good testing standards. Test Case 1:

Name :

66

ON-LINE RAILWAY RESERVATION SYSTEM

Objective of this test case is to identify conditions that are optimum for testing of code on following parameters: Validation checks: Through validation checks we ensure that no garbage/invalid value is supplied to the program, but if user intentionally or un-intentionally does supply such values then, question arises, how our code reacts to it? Thus, we decide to test each program/module with range of invalid values and extreme inputs to test their durability of program code. Code Logic & Data flow: Programs takes input in order to produce output. For example; we supplied two numeric values to a program that suppose to add these vales and produce sum of two numbers, but somehow output produced was product of two numbers. Thus code logic needs to be tested to ensure functionality of code. A typical program contains variables, methods, logical operators and conditional statements that works together to produce desired output. Data passes through method, operators and conditional statements to produce valid output; some type of inputs can cause obstruction in dataflow. For example: when value of i reaches 4 print method should be called: int i ; for(i=0;i<4;i++) { if( i == 4) { Print(i); // This statement will not get executed; because condition in For Loop works only for values less than 4. Though program code works but logic and dataflow is not implemented fully. } } The above example clearly shows how program logic can affects dataflow. Thus we need to check both. Events and Errors: Event is a condition that arises from users action, such as; pressing of button or click
Name : 67

ON-LINE RAILWAY RESERVATION SYSTEM

of mouse generates an event. All events generated by user must be logically and properly dealt with. Now imagine pressing a send Mail button and nothing happens? Our project contains lots of buttons, checkboxes and textboxes; now suppose, if any one of them fails to act then functionality of web application as a whole gets reduced. Thus we need to check all controls Form by Form to ensure proper event handling mechanism is in place. Error can be of many types (managed and unmanaged errors); in general when a program fails to produce desired output an error message should be generated to notify user about the nature and type of error. For example: user is sending message to someone but messaging module generates an error saying Unable To Send Message in this case user is not being informed about the nature or cause of error, thus such error handling technique is not be acceptable. In above example error message should be more specific like this: Error: Your Message has No Subject. Thus we gong to check all possible error conditions generated by our code in order to ensure proper error handling mechanism is in place. Test Case 2: Objective of this test case is to identify conditions that are optimum for testing of integrated modules and system architecture. Data Base Architecture & Data Integrity: Data base design is one of important area that needs to be test before final product is handed to customer. At this level we need to check whether database has been design in conformity with relational data base management rules. It is always advisable to take due care in designing database architecture because after coding is done it becomes difficult to change database design. However following points were kept in mind during testing:
Name : 68

ON-LINE RAILWAY RESERVATION SYSTEM

1. Is database design is in accordance requirement specifications. 2. Check whether Integrity rules are followed (See whether Checks were implemented at entry level so that only unique and NonNull values are stored in primary key ) 3. Systematic Treatment of NULL Values. 4. Smooth functioning of SQL select, update, insert and delete commands must be observed. Working of Integrated Modules and their Functionalities: An application is made up of small modules that interact with each other to produce desired results. For Example inventory system interacts with billing system in order to update its inventory list; similarly accounting systems interacts with billing system to keep track of individual transaction. Thus a system must be tested as a whole in order to establish its functionality. Following points must be observed during testing: 1. Session values are maintained during page transitions. 2. Session values must be destroyed as soon as user logs off. 3. Activity of one Module should not interfere with the activity of other modules; unless required. 4. Ensure that proper Data flow is taking place between modules without any obstruction. 5. Hyperlinks and Link buttons are working in orderly fashion. Interfaces and user interaction: User interface is a combination of menus, screen design, keyboard commands and language, which together creates the way a user interacts with system. Testing of interface becomes more relevant because this is what user would see
Name : 69

ON-LINE RAILWAY RESERVATION SYSTEM

and interact. Interface is tested by answering following questions: 1. Is GUI providing sufficient instruction to user? GUI should contain self explanatory controls that guides user through application. For example; Click Ok To Save Record, Press Exit to quit etc. Tool tips should be used to give reasonable information regarding controls. 2. Does GUI gives confirmation on successful activity or generates appropriate error message otherwise? 3. Is simple and easy language (grammatical English) is used while building GUI? Technical terminology should be avoided. Abbreviations should be avoided for example; avoid using: ESC for escape, REM for remove, SAV for Save. 4. Web pages contain appropriate hyperlinks to navigate through site? 5. GUI Must be in accordance with user requirements and must be user friendly. 6. Is Proper Feedback is taken by developers while designing user Interface? Test Case 3: Objective of this test case is to identify conditions that are optimum for testing entire system on following parameters: Recovery: Recovery testing is a system test that forces the software to fail in various ways and verifies the recovery is performed correctly. In case of website,
Name : 70

ON-LINE RAILWAY RESERVATION SYSTEM

this test is not possible until site is formally placed on web server (Provided by Web Hosting Companies). Latest server technology is available today; Data Backup and system recovery are some basic and mandatory features provided by this technology. Security: Security testing verifies that system protection mechanism prevents improper penetration or data alteration. In case of web application security becomes prime concern of developers to provide best available security measures. Weak areas of an application where hackers would likely attack must be identified and thoroughly checked for security loopholes, these areas are: 1. User Log-In. 2. Admin Log-In. 3. Password Recovery System. To protect web application for threats like virus and worms, use of specialize anti virus software can be used at various levels. Stress: Stress testing executes a system in the demands resources in abnormal quantity, frequently or volume. 1. Operating Different Modules at same time. 2. Giving Extreme Inputs. 3. Regular Operation on any single module with increased frequency. Performance: Performance has always been a great concern and a driving force of computer evolution. Performance evaluation of a software system usually includes: resource usage, throughput, and stimulus response time and queue lengths detailing the average or maximum number of tasks waiting to be serviced by selected resources. Typical resources that need to be considered include network bandwidth requirements, CPU cycles, disk space, disk access operations, and memory usage.

Name :

71

ON-LINE RAILWAY RESERVATION SYSTEM

In case web application it is difficult to judge performance. Problems in judging performance of Web Application: 1. Performance depends on network bandwidth and type of internet connection used by user. 2. Performance of web application may differ with number of requests made to host server. Internet traffic may affect the overall performance of web application. 3. Hard to test performance on any one criteria; because different users use different CPU and modem. Test Constraints: We were not able to test Web application on actual server. Thus we were unable to discover following: 1. How internet traffic affect our web application? 2. How many client requests an application can handle at a time? 3. Can system maintain all functionalities on internet? Report Findings and Corrections Performed: While testing the application we found that proper validation checks were not implemented in registration module, book/product entry module. Reporting module for billing system was not working properly. Other modules like searching and messaging contained minor coding errors. Each web form was separately checked to uncover any possible code error or GUI miss-functioning; several pages like aboutus.aspx, contactus.aspx and previewBill.aspx had no navigating links. Apart from this; no major errors were discovered in other modules of the application. Recommendations made after testing were implemented promptly; correction measures taken are listed below:

Name :

72

ON-LINE RAILWAY RESERVATION SYSTEM

1. Necessary validation checks were applied in Registration Module and book/product entry module. Both modules were checked again for any possible errors; but no errors were discovered. 2. Coding errors found in searching and messaging module were fixed and tested again to ensure proper functionality. 3. Entire Billing system was thoroughly checked and missing functionalities in its reporting module were fixed. All web pages were checked for missing site navigation links and proper hyperlinks/link buttons were added to ensure easy site navigation.

Name :

73

ON-LINE RAILWAY RESERVATION SYSTEM

User Manual About Online Railway Management: Users of Online Railway Management can be categorized as followings; privileges and access right differ form user to user. Guest: All unregistered persons visiting our site are treated as guests. Guests have very limited privileges. Member: When any guest registers itself on our website he/she becomes a member. He or she can enjoy certain privileges provided by our site. Admin: Owner of site is usually known as Administrator (also known as admin). Admin has ultimate rights and privileges that no other user can have. Rights and Privileges of different user can be viewed in following table:
Log User In/Chan ge Passwor Guest: d No Yes Yes No No No No No Browsi ng Privileges & Rights Searching Purchasi Messagi ng ng Block User s Delet e Users Update Websit e

Memb er Admin

Yes

Yes

Yes

Yes

Yes

No

No

No

Yes

Yes

Yes

N/A

Yes

Yes

Yes

Yes

Getting Started

Name :

74

ON-LINE RAILWAY RESERVATION SYSTEM

Step 1: Start your web browser (Internet explorer, Opera or Fire Fox) Make sure that your internet connection is on. Step 2: Type Home page address in address bar of your web browser.

Name :

75

ON-LINE RAILWAY RESERVATION SYSTEM

How to Search for Railway(s)? Step 1: Locate search textbox on top Left side of Home page . Step 2: Specify the items in the search textbox and click on search button. If search is successful then search result would be displayed, otherwise an error message would be displayed. Search can be done by giving any of these: Item Name. Becoming Member of Railway Management How to register yourself with us? Step1: As you open our web page (Home.aspx) you would notice an hyperlink on the top right corner of the page saying : Sign Up. Step 2: Click on the sign Up link. Step 3: Registration Form would appear on your screen. Fill up the form and click on submit button. Congratulations! You have become registered member of Shopping, user control panel would appear.

How to Log In and Out of Railway? Log In: Press Sign In link on top right corner of Home page. Type User Name and Password and click submit. Log Out: Log Out button can be found on Home.aspx page. Click on the log out button to logout.

Name :

76

ON-LINE RAILWAY RESERVATION SYSTEM

Brief background of the organization where the student has developed the project. Lakshya Services is a language training Institute in which different type of project is handled with the help of different language. The address of this institute is Lakshya Services 16,Rana Pratap Marg Hazaratganj Lucknow.

Name :

77

ON-LINE RAILWAY RESERVATION SYSTEM

DATA STRUCTURE Admin Field User_name Password Type Char(20) Char(20) Admin Send Message Field From1 To1 Sub Msg Date1 Type CHAR(15) CHAR(15) CHAR(50) CHAR(300) CHAR(15) TRAIN MASTER

Field

Input

Error Message

Train Name Train Direction Arrival Time Source Arrival Time Destination Departure Time Source Departure Time Destination

Blank Entry Blank Entry Blank Entry Blank Entry Blank Entry Blank Entry

Input Train Name Select Direction Input Time Input Time Input Time Input Time

Name :

78

ON-LINE RAILWAY RESERVATION SYSTEM

Class Master Field Train Type Train Name Error Message Select Train Type Input Train Name

Input Blank Entry Blank Entry

Booking Field Train Type Train No Train Name Station From Station To Category Date Of Booking Time Of Booking Error Message Select Train Type Input Train No Input Train Name Input Source Station Name Input Destination Station Name Select Category Input Date Of Booking Input Time Of Booking

Input Blank Entry Alpha Blank Entry Blank Entry Blank Entry Blank Entry Blank Entry Blank Entry

Name :

79

ON-LINE RAILWAY RESERVATION SYSTEM Cancelletion Field Pnr No. Source To Destination To Train Type Train No. Category Date Of Booking Time Of Booking Error Message Input Pnr No. Input Source to Input designation Input Train Type Input Train No. Input Category Input Date Of Booking Input Time Of Booking

Input Alpha Blank Entry Blank Entry Blank Entry Alpha Blank Entry Blank Entry Blank Entry

Name :

80

ON-LINE RAILWAY RESERVATION SYSTEM

REPORTS

The proposed system should be capable to give various simple & complex reports as output. The various outputs are:

Ticket Status Report: This report generates through day-to-day transactions, which will guide the administrator, the current picture of the current position of reservation of all the trains.

Passenger Bill Generation Report: This report will generate the bill online at the time of reservation confirmed by the web site. The bill shows the complete detail of the reservation.

Waiting Room Status Report: This Report shows the exact position of booked or vacant waiting rooms.

Cancellation Report: This report shows the cancellation status of the reserved seats to different Passengers.

Name :

81

ON-LINE RAILWAY RESERVATION SYSTEM

REFRANCE BIBLOGRAPHY:Designing and implementation phase: 1. Software engineering: a practitioners approach by roger s pressman. 2. System analysis and design by Elias m. Ewad. 3. DBMS : Bipin C Desai Coding phase: 1. Asp.Net6.0 programming Black Book by Steven Holzner 2. Mastering Asp.Net6.0 by Evangelos Petroutsos

WEBSITE:-

www.railway.com www.railinfol.com

Name :

82

ON-LINE RAILWAY RESERVATION SYSTEM

OUTPUT DESIGNING

Name :

83

ON-LINE RAILWAY RESERVATION SYSTEM

New User

Name :

84

ON-LINE RAILWAY RESERVATION SYSTEM

Forget Password

Name :

85

ON-LINE RAILWAY RESERVATION SYSTEM

User Login

Name :

86

ON-LINE RAILWAY RESERVATION SYSTEM

User Message Send

Name :

87

ON-LINE RAILWAY RESERVATION SYSTEM

Train Schedule

Name :

88

ON-LINE RAILWAY RESERVATION SYSTEM

Change Password

Name :

89

ON-LINE RAILWAY RESERVATION SYSTEM

Enquiry Page

Name :

90

ON-LINE RAILWAY RESERVATION SYSTEM

Fare List

Name :

91

ON-LINE RAILWAY RESERVATION SYSTEM

Seat Availability

Name :

92

ON-LINE RAILWAY RESERVATION SYSTEM

Admin Page

Name :

93

ON-LINE RAILWAY RESERVATION SYSTEM

admin Login Page

Name :

94

ON-LINE RAILWAY RESERVATION SYSTEM

Booking Page

Name :

95

ON-LINE RAILWAY RESERVATION SYSTEM

Cancelletion Page

Name :

96

ON-LINE RAILWAY RESERVATION SYSTEM

Train details

Name :

97

ON-LINE RAILWAY RESERVATION SYSTEM

Train schedule Setting Page

Name :

98

ON-LINE RAILWAY RESERVATION SYSTEM

Set Fare List

Name :

99

ON-LINE RAILWAY RESERVATION SYSTEM

Admin Change Password

Name :

100

ON-LINE RAILWAY RESERVATION SYSTEM

Discount page

Name :

101

ON-LINE RAILWAY RESERVATION SYSTEM

Seat Entry Page

Name :

102

ON-LINE RAILWAY RESERVATION SYSTEM

Admin send Message

Name :

103

ON-LINE RAILWAY RESERVATION SYSTEM

Admin Receive Message

Name :

104

ON-LINE RAILWAY RESERVATION SYSTEM

CODING
1. Admin Page
using using using using using using using using using using System; System.Data; System.Configuration; System.Collections; System.Web; System.Web.Security; System.Web.UI; System.Web.UI.WebControls; System.Web.UI.WebControls.WebParts; System.Web.UI.HtmlControls;

public partial class Admin : System.Web.UI.Page { Class1 c = new Class1(); protected void Page_Load(object sender, EventArgs e) { Label3.Char = " "; } protected void Button1_Click(object sender, EventArgs e) { //Response.Redirect("admin_login.aspx"); c.cm.Connection = c.con; c.cm.CommandChar = "select * from admin where user_name='" + CharBox1.Char + "' and password='" + CharBox2.Char + "'"; c.adp.SelectCommand = c.cm; c.adp.Fill(c.ds, "admin"); if (c.ds.Tables["admin"].Rows.Count == 0) { Label3.Char ="Wrong User/Password"; Name : 105 // adopt query

ON-LINE RAILWAY RESERVATION SYSTEM CharBox2.Char = ""; CharBox1.Char = ""; } else { Response.Redirect("admin_login.aspx"); } } } 2.Admin change Password using using using using using using using using using using System; System.Data; System.Configuration; System.Collections; System.Web; System.Web.Security; System.Web.UI; System.Web.UI.WebControls; System.Web.UI.WebControls.WebParts; System.Web.UI.HtmlControls;

public partial class Admin_Change : System.Web.UI.Page { Class1 c = new Class1(); protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { // change admin c.cm.Connection = c.con; c.cm.CommandChar = "select * from admin where user_name='" + CharBox1.Char + "' and password='" + CharBox2.Char + "'"; c.adp.SelectCommand = c.cm; c.adp.Fill(c.ds, "admin");

Name :

106

ON-LINE RAILWAY RESERVATION SYSTEM

if (c.ds.Tables["admin"].Rows.Count > 0) { c.cm.CommandChar = "update admin set password='" + CharBox3.Char + "' where user_name='" + CharBox1.Char + "' and password='" + CharBox2.Char + "'"; c.cm.ExecuteNonQuery(); Response.Write("Password Changed"); } else { Response.Write("wrong Old User/Password "); } } } 3.Admin send Message using using using using using using using using using using System; System.Data; System.Configuration; System.Collections; System.Web; System.Web.Security; System.Web.UI; System.Web.UI.WebControls; System.Web.UI.WebControls.WebParts; System.Web.UI.HtmlControls;

public partial class admin_Send : System.Web.UI.Page { Class1 c = new Class1(); protected void Page_Load(object sender, EventArgs e) { CharBox3.Char = DateTime.Now.Date.Day + "/" + DateTime.Now.Date.Month + "/" + DateTime.Now.Date.Year; } protected void Button1_Click(object sender, EventArgs e) { c.cm.Connection = c.con; Name : 107

ON-LINE RAILWAY RESERVATION SYSTEM c.cm.CommandChar = "insert into admin_Send values('" + CharBox1.Char + "','" + CharBox6.Char + "','" + CharBox5.Char + "','" + CharBox4.Char + "','" + CharBox3.Char + "')"; c.cm.ExecuteNonQuery(); Response.Write("Message Sent Successfuly"); } } 4.Admin train Schedule using using using using using using using using using using System; System.Data; System.Configuration; System.Collections; System.Web; System.Web.Security; System.Web.UI; System.Web.UI.WebControls; System.Web.UI.WebControls.WebParts; System.Web.UI.HtmlControls;

public partial class Admin_Train_Schedule : System.Web.UI.Page { Class1 c = new Class1(); int i; protected void Page_Load(object sender, EventArgs e) { c.cm.Connection = c.con; if (!IsPostBack) {

c.cm.CommandChar = "select distinct(trainno) from train_details"; c.adp.SelectCommand = c.cm; c.adp.Fill(c.ds, "train_details"); DropDownList1.Items.Clear(); for (i = 0; i <= c.ds.Tables["train_details"].Rows.Count - 1; i++) {

Name :

108

ON-LINE RAILWAY RESERVATION SYSTEM

DropDownList1.Items.Add(c.ds.Tables["train_details"].Rows[i].ItemAr ray[0].ToString()); } for (i = 1; i <= 12; i++) { DropDownList2.Items.Add(i.ToString() DropDownList6.Items.Add(i.ToString() } for (i = 1; i <= 60; i++) { DropDownList4.Items.Add(i.ToString() DropDownList7.Items.Add(i.ToString() } } } protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { c.cm.CommandChar = "select from1,trainname from train_details where trainno='" + DropDownList1.Char + "'"; c.adp.SelectCommand = c.cm; c.adp.Fill(c.ds, "train_details"); DropDownList3.Items.Clear(); DropDownList3.Items.Add("Select"); CharBox1.Char = c.ds.Tables["train_details"].Rows[i].ItemArray[1].ToString(); for (i = 0; i <= c.ds.Tables["train_details"].Rows.Count - 1; i+ +) { DropDownList3.Items.Add(c.ds.Tables["train_details"].Rows[i].ItemAr ray[0].ToString());

); );

); );

Name :

109

ON-LINE RAILWAY RESERVATION SYSTEM

} } protected void Button1_Click(object sender, EventArgs e) { // save string xx,yy; xx=DropDownList2.Char +":"+DropDownList4.Char +":"+ DropDownList5.Char ; yy=DropDownList6.Char +":"+ DropDownList7.Char +":"+ DropDownList8.Char ; c.cm.CommandChar = "select * from train_schedule where trainno='" + DropDownList1.Char + "' and from1='" + DropDownList3.Char + "'"; c.adp.SelectCommand = c.cm; c.ds.Clear(); c.adp.Fill(c.ds, "train_schedule"); if (c.ds.Tables["train_schedule"].Rows.Count == 0) { c.cm.CommandChar = "insert into train_schedule values('" + DropDownList1.Char + "','"+ CharBox1.Char +"', '" + DropDownList3.Char + "','" + xx + "','" + yy + "')"; c.cm.ExecuteNonQuery(); Response.Write("Train Schedule recorded"); } else { c.cm.CommandChar ="update train_schedule set arr_time='"+ xx +"',dep_time='"+ yy +"' where trainno='" + DropDownList1.Char + "' and from1='" + DropDownList3.Char + "'"; c.cm.ExecuteNonQuery(); Response.Write("Train Schedule Updated"); } } } 5.Booking Page

Name :

110

ON-LINE RAILWAY RESERVATION SYSTEM using using using using using using using using using using System; System.Data; System.Configuration; System.Collections; System.Web; System.Web.Security; System.Web.UI; System.Web.UI.WebControls; System.Web.UI.WebControls.WebParts; System.Web.UI.HtmlControls;

public partial class Booking : System.Web.UI.Page { Class1 c = new Class1(); int i; double dd; DataSet ds1 = new DataSet(); protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { c.cm.Connection = c.con; c.cm.CommandChar = "select distinct(trainno) from farelist"; c.adp.SelectCommand = c.cm; c.adp.Fill(c.ds, "farelist"); DropDownList1.Items.Add("Select"); for (i = 0; i <= c.ds.Tables["farelist"].Rows.Count - 1; i++) { DropDownList1.Items.Add(c.ds.Tables["farelist"].Rows[i].ItemArray[0 ].ToString()); } c.cm.CommandChar = "delete from temp"; c.cm.ExecuteNonQuery(); Name : 111

ON-LINE RAILWAY RESERVATION SYSTEM

CharBox5.Char = DateTime.Now.Date.Day + "/" + DateTime.Now.Date.Month + "/" + DateTime.Now.Date.Year; for (i = 1; i <= 31; i++) { DropDownList7.Items.Add(i.ToString()); } for (i = 1; i <= 12; i++) { DropDownList8.Items.Add(i.ToString() ); } for (i = 2010; i <= 2050; i++) { DropDownList9.Items.Add(i.ToString() ); } } } protected void DropDownList4_SelectedIndexChanged(object sender, EventArgs e) { } protected void Button3_Click(object sender, EventArgs e) { //add c.cm.Connection = c.con; c.cm.CommandChar ="insert into temp values('"+ CharBox6.Char +"','"+ CharBox7.Char +"','"+ DropDownList4.Char +"',"+ CharBox8.Char +")"; c.cm.ExecuteNonQuery(); c.cm.CommandChar = "select * from temp"; c.adp.SelectCommand = c.cm; c.adp.Fill(c.ds, "temp"); GridView1.DataSource =c.ds ; Name : 112

ON-LINE RAILWAY RESERVATION SYSTEM GridView1.DataBind(); CharBox6.Char = ""; CharBox7.Char = ""; } protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { c.cm.Connection = c.con; c.cm.CommandChar = "select distinct(from1) from farelist where trainno='"+ DropDownList1.Char +"'"; c.adp.SelectCommand = c.cm; c.adp.Fill(c.ds, "farelist"); DropDownList5.Items.Clear(); DropDownList5.Items.Add("Select"); for (i = 0; i <= c.ds.Tables["farelist"].Rows.Count - 1; i++) { DropDownList5.Items.Add(c.ds.Tables["farelist"].Rows[i].ItemArray[0 ].ToString()); } c.cm.CommandChar = "select trainname from train_details where trainno='" + DropDownList1.Char + "'"; c.adp.SelectCommand = c.cm; c.adp.Fill(c.ds, "train_details"); CharBox4.Char = c.ds.Tables["train_details"].Rows[0].ItemArray[0].ToString(); } protected void DropDownList5_SelectedIndexChanged(object sender, EventArgs e) Name : 113

ON-LINE RAILWAY RESERVATION SYSTEM { c.cm.Connection = c.con; c.cm.CommandChar = "select distinct(to1) from farelist where trainno='" + DropDownList1.Char + "' and from1='"+ DropDownList5.Char +"'"; c.adp.SelectCommand = c.cm; c.adp.Fill(c.ds, "farelist"); DropDownList6.Items.Clear(); DropDownList6.Items.Add("Select"); for (i = 0; i <= c.ds.Tables["farelist"].Rows.Count - 1; i++) { DropDownList6.Items.Add(c.ds.Tables["farelist"].Rows[i].ItemArray[0 ].ToString()); } } protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e) { c.cm.Connection = c.con; c.cm.CommandChar = "select * from farelist where trainno='" + DropDownList1.Char.Trim() + "' and from1='" + DropDownList5.Char.Trim() + "' and to1='"+ DropDownList6.Char +"' and type='"+ DropDownList2.Char.Trim() +"'"; c.adp.SelectCommand = c.cm; c.adp.Fill(c.ds, "farelist"); if (c.ds.Tables["farelist"].Rows.Count > 0) { CharBox8.Char = c.ds.Tables["farelist"].Rows[0].ItemArray[4].ToString(); } else { CharBox8.Char = "0"; Name : 114

ON-LINE RAILWAY RESERVATION SYSTEM } } protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e) { c.cm.Connection = c.con; c.cm.CommandChar = "select * from discount where class_name='" + DropDownList2.Char + "' and quota='" + DropDownList3.Char.Trim() + "'"; c.adp.SelectCommand = c.cm; c.adp.Fill(c.ds, "discount"); if (c.ds.Tables["discount"].Rows.Count > 0) { CharBox2.Char = c.ds.Tables["discount"].Rows[0].ItemArray[2].ToString(); } else { CharBox2.Char = "0"; } } protected void Button4_Click(object sender, EventArgs e) { // total double total, d, t, x; c.cm.Connection = c.con; c.cm.CommandChar = "select sum(fare) from temp"; c.adp.SelectCommand = c.cm; c.adp.Fill(c.ds, "temp");

Name :

115

ON-LINE RAILWAY RESERVATION SYSTEM total = Convert.ToInt32(c.ds.Tables["temp"].Rows[0].ItemArray[0].ToString( )); c.cm.CommandChar = "select count(*) from temp"; c.adp.SelectCommand = c.cm; c.ds.Clear(); c.adp.Fill(c.ds, "temp"); t= Convert.ToInt32(c.ds.Tables["temp"].Rows[0].ItemArray[0].ToString( )); //// d = Convert.ToInt32(CharBox2.Char); x = (d * t* .01); x = total * x; total = total - x; CharBox3.Char = total.ToString(); } protected void Button1_Click(object sender, EventArgs e) { //booking string dd = ""; dd = DropDownList7.SelectedItem.Char + "/" + DropDownList8.SelectedItem.Char + "/" + DropDownList9.SelectedItem.Char; DataSet ds1=new DataSet (); int i; c.cm.Connection = c.con; c.cm.CommandChar = "select * from booking where pnrno='"+ CharBox1.Char +"'"; Name : 116

ON-LINE RAILWAY RESERVATION SYSTEM

c.adp.SelectCommand = c.cm; c.ds.Clear(); c.adp.Fill(c.ds, "booking"); c.cm.CommandChar = "select * from temp"; c.adp.SelectCommand = c.cm; ds1.Clear(); c.adp.Fill(ds1, "temp"); if (c.ds.Tables["booking"].Rows.Count == 0) { for (i = 0; i <= ds1.Tables["temp"].Rows.Count-1; i++) { c.cm.CommandChar = "insert into booking values('" + CharBox1.Char + "','" + DropDownList1.Char + "','" + DropDownList5.Char + "','" + DropDownList6.Char + "','" + CharBox4.Char + "','" + CharBox5.Char + "','"+ dd +"','" + DropDownList2.Char + "','" + DropDownList3.Char + "','" + ds1.Tables["temp"].Rows[i].ItemArray[0].ToString() + "','" + ds1.Tables["temp"].Rows[i].ItemArray[1].ToString() + "','" + ds1.Tables["temp"].Rows[i].ItemArray[2].ToString() + "','" + CharBox2.Char + "','" + CharBox8.Char + "','" + CharBox3.Char + "','"+ "true"+"')"; c.cm.ExecuteNonQuery(); } Label15.Char = "Booking Recorded Sucessfully"; c.cm.CommandChar = "delete from temp"; c.cm.ExecuteNonQuery(); c.cm.CommandChar = "select * from temp"; c.adp.SelectCommand = c.cm; c.adp.Fill(c.ds, "temp"); Name : 117

ON-LINE RAILWAY RESERVATION SYSTEM GridView1.DataSource = c.ds; GridView1.DataBind(); } else { Label15.Char = "PNR No already Exist"; } } }

6.Admin Booling using using using using using using using using using using System; System.Data; System.Configuration; System.Collections; System.Web; System.Web.Security; System.Web.UI; System.Web.UI.WebControls; System.Web.UI.WebControls.WebParts; System.Web.UI.HtmlControls;

public partial class Booking : System.Web.UI.Page { Class1 c = new Class1(); int i; double dd; DataSet ds1 = new DataSet(); protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { c.cm.Connection = c.con; c.cm.CommandChar = "select distinct(trainno) from farelist";

Name :

118

ON-LINE RAILWAY RESERVATION SYSTEM c.adp.SelectCommand = c.cm; c.adp.Fill(c.ds, "farelist"); DropDownList1.Items.Add("Select"); for (i = 0; i <= c.ds.Tables["farelist"].Rows.Count - 1; i++) { DropDownList1.Items.Add(c.ds.Tables["farelist"].Rows[i].ItemArray[0 ].ToString()); } c.cm.CommandChar = "delete from temp"; c.cm.ExecuteNonQuery(); CharBox5.Char = DateTime.Now.Date.Day + "/" + DateTime.Now.Date.Month + "/" + DateTime.Now.Date.Year; for (i = 1; i <= 31; i++) { DropDownList7.Items.Add(i.ToString()); } for (i = 1; i <= 12; i++) { DropDownList8.Items.Add(i.ToString() ); } for (i = 2010; i <= 2050; i++) { DropDownList9.Items.Add(i.ToString() ); } } } protected void DropDownList4_SelectedIndexChanged(object sender, EventArgs e) { } Name : 119

ON-LINE RAILWAY RESERVATION SYSTEM protected void Button3_Click(object sender, EventArgs e) { //add c.cm.Connection = c.con; c.cm.CommandChar ="insert into temp values('"+ CharBox6.Char +"','"+ CharBox7.Char +"','"+ DropDownList4.Char +"',"+ CharBox8.Char +")"; c.cm.ExecuteNonQuery(); c.cm.CommandChar = "select * from temp"; c.adp.SelectCommand = c.cm; c.adp.Fill(c.ds, "temp"); GridView1.DataSource =c.ds ; GridView1.DataBind(); CharBox6.Char = ""; CharBox7.Char = ""; } protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { c.cm.Connection = c.con; c.cm.CommandChar = "select distinct(from1) from farelist where trainno='"+ DropDownList1.Char +"'"; c.adp.SelectCommand = c.cm; c.adp.Fill(c.ds, "farelist"); DropDownList5.Items.Clear(); DropDownList5.Items.Add("Select"); for (i = 0; i <= c.ds.Tables["farelist"].Rows.Count - 1; i++) { DropDownList5.Items.Add(c.ds.Tables["farelist"].Rows[i].ItemArray[0 ].ToString());

Name :

120

ON-LINE RAILWAY RESERVATION SYSTEM } c.cm.CommandChar = "select trainname from train_details where trainno='" + DropDownList1.Char + "'"; c.adp.SelectCommand = c.cm; c.adp.Fill(c.ds, "train_details"); CharBox4.Char = c.ds.Tables["train_details"].Rows[0].ItemArray[0].ToString(); } protected void DropDownList5_SelectedIndexChanged(object sender, EventArgs e) { c.cm.Connection = c.con; c.cm.CommandChar = "select distinct(to1) from farelist where trainno='" + DropDownList1.Char + "' and from1='"+ DropDownList5.Char +"'"; c.adp.SelectCommand = c.cm; c.adp.Fill(c.ds, "farelist"); DropDownList6.Items.Clear(); DropDownList6.Items.Add("Select"); for (i = 0; i <= c.ds.Tables["farelist"].Rows.Count - 1; i++) { DropDownList6.Items.Add(c.ds.Tables["farelist"].Rows[i].ItemArray[0 ].ToString()); } } protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e) { c.cm.Connection = c.con;

Name :

121

ON-LINE RAILWAY RESERVATION SYSTEM c.cm.CommandChar = "select * from farelist where trainno='" + DropDownList1.Char.Trim() + "' and from1='" + DropDownList5.Char.Trim() + "' and to1='"+ DropDownList6.Char +"' and type='"+ DropDownList2.Char.Trim() +"'"; c.adp.SelectCommand = c.cm; c.adp.Fill(c.ds, "farelist"); if (c.ds.Tables["farelist"].Rows.Count > 0) { CharBox8.Char = c.ds.Tables["farelist"].Rows[0].ItemArray[4].ToString(); } else { CharBox8.Char = "0"; } } protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e) { c.cm.Connection = c.con; c.cm.CommandChar = "select * from discount where class_name='" + DropDownList2.Char + "' and quota='" + DropDownList3.Char.Trim() + "'"; c.adp.SelectCommand = c.cm; c.adp.Fill(c.ds, "discount"); if (c.ds.Tables["discount"].Rows.Count > 0) { CharBox2.Char = c.ds.Tables["discount"].Rows[0].ItemArray[2].ToString(); } else { CharBox2.Char = "0"; } } Name : 122

ON-LINE RAILWAY RESERVATION SYSTEM protected void Button4_Click(object sender, EventArgs e) { // total double total, d, t, x; c.cm.Connection = c.con; c.cm.CommandChar = "select sum(fare) from temp"; c.adp.SelectCommand = c.cm; c.adp.Fill(c.ds, "temp"); total = Convert.ToInt32(c.ds.Tables["temp"].Rows[0].ItemArray[0].ToString( )); c.cm.CommandChar = "select count(*) from temp"; c.adp.SelectCommand = c.cm; c.ds.Clear(); c.adp.Fill(c.ds, "temp"); t= Convert.ToInt32(c.ds.Tables["temp"].Rows[0].ItemArray[0].ToString( )); //// d = Convert.ToInt32(CharBox2.Char); x = (d * t* .01); x = total * x; total = total - x; CharBox3.Char = total.ToString(); } Name : 123

ON-LINE RAILWAY RESERVATION SYSTEM protected void Button1_Click(object sender, EventArgs e) { //booking string dd = ""; dd = DropDownList7.SelectedItem.Char + "/" + DropDownList8.SelectedItem.Char + "/" + DropDownList9.SelectedItem.Char; DataSet ds1=new DataSet (); int i; c.cm.Connection = c.con; c.cm.CommandChar = "select * from booking where pnrno='"+ CharBox1.Char +"'"; c.adp.SelectCommand = c.cm; c.ds.Clear(); c.adp.Fill(c.ds, "booking"); c.cm.CommandChar = "select * from temp"; c.adp.SelectCommand = c.cm; ds1.Clear(); c.adp.Fill(ds1, "temp"); if (c.ds.Tables["booking"].Rows.Count == 0) { for (i = 0; i <= ds1.Tables["temp"].Rows.Count-1; i++) { c.cm.CommandChar = "insert into booking values('" + CharBox1.Char + "','" + DropDownList1.Char + "','" + DropDownList5.Char + "','" + DropDownList6.Char + "','" + CharBox4.Char + "','" + CharBox5.Char + "','"+ dd +"','" + DropDownList2.Char + "','" + DropDownList3.Char + "','" + ds1.Tables["temp"].Rows[i].ItemArray[0].ToString() + "','" + ds1.Tables["temp"].Rows[i].ItemArray[1].ToString() + "','" + ds1.Tables["temp"].Rows[i].ItemArray[2].ToString() + "','" + Name : 124

ON-LINE RAILWAY RESERVATION SYSTEM CharBox2.Char + "','" + CharBox8.Char + "','" + CharBox3.Char + "','"+ "true"+"')"; c.cm.ExecuteNonQuery(); } Label15.Char = "Booking Recorded Sucessfully"; c.cm.CommandChar = "delete from temp"; c.cm.ExecuteNonQuery(); c.cm.CommandChar = "select * from temp"; c.adp.SelectCommand = c.cm; c.adp.Fill(c.ds, "temp"); GridView1.DataSource = c.ds; GridView1.DataBind(); } else { Label15.Char = "PNR No already Exist"; } } }

6. Cancel using using using using using System; System.Data; System.Configuration; System.Collections; System.Web; 125

Name :

ON-LINE RAILWAY RESERVATION SYSTEM using using using using using System.Web.Security; System.Web.UI; System.Web.UI.WebControls; System.Web.UI.WebControls.WebParts; System.Web.UI.HtmlControls;

public partial class Cancel : System.Web.UI.Page { Class1 c = new Class1(); int i; protected void Page_Load(object sender, EventArgs e) { string xx = (DateTime.Now.Date.Day + "/" + DateTime.Now.Date.Month + "/" + DateTime.Now.Date.Year); //DateTime yy = Convert.ToDateTime(xx); //yy = yy.Date; if (!IsPostBack) { c.cm.Connection = c.con; c.cm.CommandChar = "select distinct(pnrno) from booking where (journey_date)>='" + (xx) + "' and status='"+ "true" +"'"; c.adp.SelectCommand = c.cm; c.adp.Fill(c.ds, "booking"); DropDownList1.Items.Clear(); DropDownList1.Items.Add("Select"); for (i = 0; i <= c.ds.Tables["booking"].Rows.Count - 1; i++) { DropDownList1.Items.Add(c.ds.Tables["booking"].Rows[i].ItemArray[ 0].ToString()); } Name : 126

ON-LINE RAILWAY RESERVATION SYSTEM } } protected void Button2_Click(object sender, EventArgs e) { // save c.cm.Connection = c.con; c.cm.CommandChar = "insert into cancel values('" + DropDownList1.Char + "','" + DropDownList2.Char + "' ,'" + CharBox7.Char + "','" + CharBox6.Char + "','" + CharBox5.Char + "','" + CharBox4.Char + "','" + CharBox3.Char + "','" + CharBox2.Char + "')"; c.cm.ExecuteNonQuery(); Response.Write("cancelled"); c.cm.CommandChar = "update booking set status='false' where pnrno='" + DropDownList1.Char + "' and trainno='" + DropDownList2.Char + "'"; c.cm.ExecuteNonQuery(); CharBox5.Char = ""; CharBox6.Char = ""; CharBox7.Char = ""; CharBox3.Char = ""; CharBox2.Char = ""; DropDownList1.Items.RemoveAt(DropDownList1.SelectedIndex); DropDownList2.Items.RemoveAt(DropDownList2.SelectedIndex); } protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { c.cm.Connection = c.con; c.cm.CommandChar = "select distinct(trainno) from booking where pnrno='" + DropDownList1.Char + "'"; c.adp.SelectCommand = c.cm; c.adp.Fill(c.ds, "booking"); DropDownList2.Items.Clear(); DropDownList2.Items.Add("Select");

Name :

127

ON-LINE RAILWAY RESERVATION SYSTEM for (i = 0; i <= c.ds.Tables["booking"].Rows.Count - 1; i++) { DropDownList2.Items.Add(c.ds.Tables["booking"].Rows[i].ItemArray[ 0].ToString()); } } protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e) { double amt= 0.0,t=0.0; c.cm.Connection = c.con; c.cm.CommandChar = "select * from booking where pnrno='" + DropDownList1.Char + "' and trainno='"+ DropDownList2.Char +"'"; c.adp.SelectCommand = c.cm; c.adp.Fill(c.ds, "booking"); if (c.ds.Tables["booking"].Rows.Count > 0) { CharBox7.Char = c.ds.Tables["booking"].Rows[0].ItemArray[4].ToString(); CharBox6.Char = c.ds.Tables["booking"].Rows[0].ItemArray[2].ToString(); CharBox5.Char = c.ds.Tables["booking"].Rows[0].ItemArray[3].ToString(); CharBox4.Char = c.ds.Tables["booking"].Rows[0].ItemArray[5].ToString(); } string xx = c.ds.Tables["booking"].Rows[0].ItemArray[6].ToString(); string yy = DateTime.Now.Date.Day + "/" + DateTime.Now.Date.Month + "/" + DateTime.Now.Date.Year; amt = Convert.ToDouble (c.ds.Tables["booking"].Rows[0].ItemArray[14].ToString()); if (xx == yy) Name : 128

ON-LINE RAILWAY RESERVATION SYSTEM { t = amt - (amt * .2); CharBox3.Char = (amt * .2).ToString(); } else { t = amt - (amt * .1); CharBox3.Char = (amt * .1).ToString(); } CharBox2.Char = t.ToString();

} }

8.Change Pass Word using using using using using using using System; System.Data; System.Configuration; System.Collections; System.Web; System.Web.Security; System.Web.UI; 129

Name :

ON-LINE RAILWAY RESERVATION SYSTEM using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class change_password : System.Web.UI.Page { Class1 c = new Class1(); protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { c.cm.Connection = c.con; c.cm.CommandChar = "select * from registration where userid='" + CharBox1.Char + "' and password='" + CharBox2.Char + "'"; c.adp.SelectCommand = c.cm; c.adp.Fill(c.ds, "registration"); if (c.ds.Tables["registration"].Rows.Count > 0) { c.cm.CommandChar = "update registration set password='" + CharBox3.Char + "' where userid='" + CharBox1.Char + "' and password='" + CharBox2.Char + "'"; c.cm.ExecuteNonQuery(); Response.Write("Password Changed"); } else { Response.Write("wrong Old User/Password "); } } } 9.Discount Page

Name :

130

ON-LINE RAILWAY RESERVATION SYSTEM using using using using using using using using using using System; System.Data; System.Configuration; System.Collections; System.Web; System.Web.Security; System.Web.UI; System.Web.UI.WebControls; System.Web.UI.WebControls.WebParts; System.Web.UI.HtmlControls;

public partial class Discount : System.Web.UI.Page { Class1 c = new Class1(); protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { //save c.cm.Connection = c.con;

c.cm.CommandChar = "select * from discount where class_name='" + DropDownList1.Char + "' and quota='" + DropDownList2.Char + "'"; c.adp.SelectCommand = c.cm; c.adp.Fill(c.ds, "discount"); if (c.ds.Tables["discount"].Rows.Count == 0) { c.cm.CommandChar = "insert into discount values('" + DropDownList1.Char + "','" + DropDownList2.Char + "'," + CharBox1.Char + ")"; c.cm.ExecuteNonQuery(); Response.Write("Discount Recorded"); Name : 131

ON-LINE RAILWAY RESERVATION SYSTEM } else { c.cm.CommandChar = "update discount set discount=" + CharBox1.Char + " where class_name='" + DropDownList1.Char + "' and quota='" + DropDownList2.Char + "'"; c.cm.ExecuteNonQuery(); Response.Write("Discount Update"); } } } 10.Enquiry Page using using using using using using using using using using System; System.Data; System.Configuration; System.Collections; System.Web; System.Web.Security; System.Web.UI; System.Web.UI.WebControls; System.Web.UI.WebControls.WebParts; System.Web.UI.HtmlControls;

public partial class Enquery : System.Web.UI.Page { Class1 c = new Class1(); int i; protected void Page_Load(object sender, EventArgs e) {

c.cm.Connection = c.con;

Name :

132

ON-LINE RAILWAY RESERVATION SYSTEM protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { c.cm.CommandChar = "select distinct(trainno) from train_details where traintype='"+ DropDownList1.Char +"' and trainno in(select trainno from train_schedule)"; c.adp.SelectCommand = c.cm; c.adp.Fill(c.ds, "train_details"); DropDownList2.Items.Clear(); DropDownList2.Items.Add("Select"); for (i = 0; i <= c.ds.Tables["train_details"].Rows.Count - 1; i+ +) { DropDownList2.Items.Add(c.ds.Tables["train_details"].Rows[i].ItemAr ray[0].ToString()); } CharBox1.Char = ""; CharBox3.Char = ""; CharBox4.Char = ""; } protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e) { c.cm.CommandChar = "select * from train_schedule where trainno='" + DropDownList2.Char + "'"; c.adp.SelectCommand = c.cm; c.ds.Clear(); c.adp.Fill(c.ds, "train_schedule"); if (c.ds.Tables["train_schedule"].Rows.Count > 0) { CharBox1.Char = c.ds.Tables["train_schedule"].Rows[0].ItemArray[1].ToString(); //CharBox4.Char = c.ds.Tables["train_schedule"].Rows[0].ItemArray[3].ToString(); Name : 133

ON-LINE RAILWAY RESERVATION SYSTEM //CharBox3.Char = c.ds.Tables["train_schedule"].Rows[0].ItemArray[4].ToString(); } else { CharBox1.Char = ""; CharBox3.Char = ""; CharBox4.Char = ""; } DropDownList3.Items.Clear(); DropDownList3.Items.Add("Select"); for (i = 0; i <= c.ds.Tables["train_schedule"].Rows.Count - 1; i+ +) { DropDownList3.Items.Add(c.ds.Tables["train_schedule"].Rows[i].Item Array[2].ToString()); } } protected void Button1_Click(object sender, EventArgs e) { } protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e) { c.cm.CommandChar = "select * from train_schedule where trainno='" + DropDownList2.Char + "' and from1='"+ DropDownList3.Char +"'"; c.adp.SelectCommand = c.cm; c.ds.Clear(); c.adp.Fill(c.ds, "train_schedule"); if (c.ds.Tables["train_schedule"].Rows.Count > 0) {

Name :

134

ON-LINE RAILWAY RESERVATION SYSTEM

CharBox4.Char = c.ds.Tables["train_schedule"].Rows[0].ItemArray[3].ToString(); CharBox3.Char = c.ds.Tables["train_schedule"].Rows[0].ItemArray[4].ToString(); } else { CharBox1.Char = ""; CharBox3.Char = ""; CharBox4.Char = ""; } } } 11.Fare List using using using using using using using using using using System; System.Data; System.Configuration; System.Collections; System.Web; System.Web.Security; System.Web.UI; System.Web.UI.WebControls; System.Web.UI.WebControls.WebParts; System.Web.UI.HtmlControls;

public partial class Fare_list : System.Web.UI.Page { Class1 c = new Class1(); int i; protected void Page_Load(object sender, EventArgs e) { c.cm.Connection = c.con; if (!IsPostBack) { c.cm.CommandChar = "select distinct(trainno) from farelist"; c.adp.SelectCommand = c.cm; Name : 135

ON-LINE RAILWAY RESERVATION SYSTEM

c.adp.Fill(c.ds, "farelist"); DropDownList2.Items.Clear(); DropDownList2.Items.Add("Select"); for (i = 0; i <= c.ds.Tables["farelist"].Rows.Count - 1; i++) { DropDownList2.Items.Add(c.ds.Tables["farelist"].Rows[i].ItemArray[0 ].ToString()); } } } protected void Button1_Click(object sender, EventArgs e) { c.cm.CommandChar = "select * from farelist where trainno='" + DropDownList2.Char + "' and type='"+ DropDownList1.Char +"' and from1='"+ DropDownList3.Char +"' and to1='"+ DropDownList4.Char +"'"; c.adp.SelectCommand = c.cm; c.ds.Clear(); c.adp.Fill(c.ds, "farelist"); CharBox1.Char = c.ds.Tables["farelist"].Rows[0].ItemArray[4].ToString(); } protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e) { c.cm.CommandChar = "select distinct(type) from farelist where trainno='"+ DropDownList2.Char +"'"; c.adp.SelectCommand = c.cm; c.adp.Fill(c.ds, "farelist"); DropDownList1.Items.Clear(); DropDownList1.Items.Add("Select"); for (i = 0; i <= c.ds.Tables["farelist"].Rows.Count - 1; i++) {

Name :

136

ON-LINE RAILWAY RESERVATION SYSTEM

DropDownList1.Items.Add(c.ds.Tables["farelist"].Rows[i].ItemArray[0 ].ToString()); } } protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { c.cm.CommandChar = "select distinct(from1) from farelist where trainno='" + DropDownList2.Char + "' and type='"+ DropDownList1.Char +"'"; c.adp.SelectCommand = c.cm; c.adp.Fill(c.ds, "farelist"); DropDownList3.Items.Clear(); DropDownList3.Items.Add("Select"); for (i = 0; i <= c.ds.Tables["farelist"].Rows.Count - 1; i++) { DropDownList3.Items.Add(c.ds.Tables["farelist"].Rows[i].ItemArray[0 ].ToString()); } } protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e) { c.cm.CommandChar = "select distinct(to1) from farelist where trainno='" + DropDownList2.Char + "' and type='" + DropDownList1.Char + "' and from1='"+ DropDownList3.Char +"'"; c.adp.SelectCommand = c.cm; c.adp.Fill(c.ds, "farelist"); DropDownList4.Items.Clear(); DropDownList4.Items.Add ("Select"); for (i = 0; i <= c.ds.Tables["farelist"].Rows.Count - 1; i++) {

Name :

137

ON-LINE RAILWAY RESERVATION SYSTEM

DropDownList4.Items.Add(c.ds.Tables["farelist"].Rows[i].ItemArray[0 ].ToString()); } } } 12.fare Page using using using using using using using using using using System; System.Data; System.Configuration; System.Collections; System.Web; System.Web.Security; System.Web.UI; System.Web.UI.WebControls; System.Web.UI.WebControls.WebParts; System.Web.UI.HtmlControls;

public partial class Fare : System.Web.UI.Page { Class1 c = new Class1(); int i; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { c.cm.Connection = c.con; c.cm.CommandChar = "select distinct(trainno) from train_details"; c.adp.SelectCommand = c.cm; c.adp.Fill(c.ds, "train_details");

Name :

138

ON-LINE RAILWAY RESERVATION SYSTEM for (i = 0; i <= c.ds.Tables["train_details"].Rows.Count - 1; i++) { DropDownList2.Items.Add(c.ds.Tables["train_details"].Rows[i].ItemAr ray[0].ToString()); } } } protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e) { c.cm.Connection = c.con; c.cm.CommandChar = "select from1,to1 from train_details where trainno='"+DropDownList2.Char +"'"; c.adp.SelectCommand = c.cm; c.adp.Fill(c.ds, "train_details"); DropDownList3.Items.Clear(); DropDownList4.Items.Clear(); DropDownList3.Items.Add("Select"); DropDownList4.Items.Add("Select"); for (i = 0; i <= c.ds.Tables["train_details"].Rows.Count - 1; i+ +) { DropDownList3.Items.Add(c.ds.Tables["train_details"].Rows[i].ItemAr ray[0].ToString()); DropDownList4.Items.Add(c.ds.Tables["train_details"].Rows[i].ItemAr ray[0].ToString()); }

Name :

139

ON-LINE RAILWAY RESERVATION SYSTEM c.cm.CommandChar = "select from1,to1 from train_details where trainno='" + DropDownList2.Char + "'"; c.adp.SelectCommand = c.cm; c.ds.Clear(); c.adp.Fill(c.ds, "train_details"); DropDownList4.Items.Add(c.ds.Tables["train_details"].Rows[0].ItemA rray[1].ToString()); } protected void Button1_Click(object sender, EventArgs e) { // save c.cm.Connection = c.con; c.cm.CommandChar = "select * from farelist where trainno='" + DropDownList2.Char + "' and type='" + DropDownList1.Char + "' and from1='"+ DropDownList3.Char +"' and to1='"+ DropDownList4.Char +"'"; c.adp.SelectCommand = c.cm; c.adp.Fill(c.ds, "farelist"); if (c.ds.Tables["farelist"].Rows.Count == 0) { c.cm.CommandChar = "insert into farelist values('" + DropDownList2.Char + "','" + DropDownList1.Char + "','" + DropDownList3.Char + "','" + DropDownList4.Char + "'," + CharBox2.Char + ")"; c.cm.ExecuteNonQuery(); Response.Write("Fare Recorded"); } else { c.cm.CommandChar = "update farelist set fare=" + CharBox2.Char + " where trainno='" + DropDownList2.Char + "' and Name : 140

ON-LINE RAILWAY RESERVATION SYSTEM type='" + DropDownList1.Char + "' and from1='" + DropDownList3.Char + "' and to1='" + DropDownList4.Char + "'"; c.cm.ExecuteNonQuery(); Response.Write("Fare Update"); } } protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e) { if (DropDownList4.SelectedIndex <= DropDownList3.SelectedIndex) { Response.Write("Destination should be greater then Source station"); } } protected void Button3_Click(object sender, EventArgs e) { } protected void DropDownList4_SelectedIndexChanged(object sender, EventArgs e) { if (DropDownList4.SelectedIndex <= DropDownList3.SelectedIndex) { Response.Write("Destination should be greater then Source station"); } } } 13.Forget Password using using using using using using using using System; System.Data; System.Configuration; System.Collections; System.Web; System.Web.Security; System.Web.UI; System.Web.UI.WebControls; 141

Name :

ON-LINE RAILWAY RESERVATION SYSTEM using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class Forget : System.Web.UI.Page { Class1 c = new Class1(); protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { // search c.cm.Connection = c.con; c.cm.CommandChar = "select * from registration where question='" + DropDownList1.Char + "' and answer='" + CharBox1.Char + "' and email='"+ CharBox2.Char +"' and dateofbirth='"+ CharBox3.Char +"'"; c.adp.SelectCommand = c.cm; c.adp.Fill(c.ds, "registration"); if (c.ds.Tables["registration"].Rows.Count == 0) { Label1.Char = "Wrong Information"; CharBox2.Char = ""; CharBox1.Char = ""; } else { Label1.Char = "Your Password is " + c.ds.Tables["registration"].Rows[0].ItemArray[1].ToString(); } // adopt query

} }

Name :

142

ON-LINE RAILWAY RESERVATION SYSTEM 14. Seat Availability using using using using using using using using using using System; System.Data; System.Configuration; System.Collections; System.Web; System.Web.Security; System.Web.UI; System.Web.UI.WebControls; System.Web.UI.WebControls.WebParts; System.Web.UI.HtmlControls;

public partial class get_sheet : System.Web.UI.Page { Class1 c = new Class1(); int i; protected void Page_Load(object sender, EventArgs e) { c.cm.Connection = c.con; if (!IsPostBack) { c.cm.CommandChar = "select distinct(trainno) from train_details"; c.adp.SelectCommand = c.cm; c.adp.Fill(c.ds, "train_details"); for (i = 0; i <= c.ds.Tables["train_details"].Rows.Count - 1; i++) { DropDownList1.Items.Add(c.ds.Tables["train_details"].Rows[i].ItemAr ray[0].ToString()); }

Name :

143

ON-LINE RAILWAY RESERVATION SYSTEM } } protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { c.cm.CommandChar = "select * from train_details where trainno='"+ DropDownList1.SelectedItem.Char +"'"; c.adp.SelectCommand = c.cm; c.adp.Fill(c.ds, "train_details"); if (c.ds.Tables["train_details"].Rows.Count > 0) { CharBox1.Char = (c.ds.Tables["train_details"].Rows[i].ItemArray[2].ToString()); } } protected void Button1_Click(object sender, EventArgs e) { c.cm.Connection = c.con; c.cm.CommandChar = "select * from seat where trainno='" + DropDownList1.Char + "' and class='" + DropDownList2.Char + "'"; c.adp.SelectCommand = c.cm; c.adp.Fill(c.ds, "seat"); if (c.ds.Tables["seat"].Rows.Count == 0) { c.cm.CommandChar = "insert into seat values('" + DropDownList1.Char + "','" + CharBox1.Char + "','" + DropDownList2.Char + "',"+ CharBox2.Char + ")"; c.cm.ExecuteNonQuery(); Response.Write("Seat Recorded"); } else Name : 144

ON-LINE RAILWAY RESERVATION SYSTEM { c.cm.CommandChar = "update seat set total_seat=" + CharBox2.Char + " where trainno='" + DropDownList1.Char + "' and class='" + DropDownList2.Char + "'"; c.cm.ExecuteNonQuery(); Response.Write("Seat Update"); } } } 15.Home Page using using using using using using using using using System; System.Data; System.Configuration; System.Web; System.Web.Security; System.Web.UI; System.Web.UI.WebControls; System.Web.UI.WebControls.WebParts; System.Web.UI.HtmlControls;

public partial class _Default : System.Web.UI.Page { Class1 c = new Class1(); protected void Page_Load(object sender, EventArgs e) { Literal1.Char = "<marquee><B><h1>Online Railway Reservation System</h1></b></marquee>"; } protected void Button1_Click(object sender, EventArgs e) { // search c.cm.Connection = c.con; c.cm.CommandChar = "select * from registration where userid='" + CharBox1.Char + "' and password='"+ CharBox2.Char +"'"; c.adp.SelectCommand = c.cm; // adopt query

Name :

145

ON-LINE RAILWAY RESERVATION SYSTEM

c.adp.Fill(c.ds, "registration"); if (c.ds.Tables["registration"].Rows.Count == 0) { Label4.Char ="Wrong User/Password"; CharBox2.Char = ""; CharBox1.Char = ""; } else { Response.Redirect("user_login.aspx"); }

} protected void LinkButton4_Click(object sender, EventArgs e) { } protected void LinkButton2_Click(object sender, EventArgs e) { } } 16.Message Send using using using using using using using using using using System; System.Data; System.Configuration; System.Collections; System.Web; System.Web.Security; System.Web.UI; System.Web.UI.WebControls; System.Web.UI.WebControls.WebParts; System.Web.UI.HtmlControls;

Name :

146

ON-LINE RAILWAY RESERVATION SYSTEM public partial class Massage_send : System.Web.UI.Page { Class1 c = new Class1(); protected void Page_Load(object sender, EventArgs e) { CharBox3.Char = DateTime.Now.Date.Day + "/" + DateTime.Now.Date.Month + "/" + DateTime.Now.Date.Year; CharBox6.Char = "admin@railway.com"; } protected void CharBox1_CharChanged(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { // string xx = DropDownList3.Char + "/" + DropDownList4.Char + "/" + DropDownList5.Char; c.cm.Connection = c.con; c.cm.CommandChar = "insert into Message_Send values('" + CharBox1.Char + "','" + CharBox6.Char + "','" + CharBox5.Char + "','" + CharBox4.Char + "','" + CharBox3.Char + "')"; c.cm.ExecuteNonQuery(); Response.Write("Message Sent Successfuly"); } } 17.Seat using using using using using using using using using using System; System.Data; System.Configuration; System.Collections; System.Web; System.Web.Security; System.Web.UI; System.Web.UI.WebControls; System.Web.UI.WebControls.WebParts; System.Web.UI.HtmlControls;

Name :

147

ON-LINE RAILWAY RESERVATION SYSTEM public partial class seat_availability : System.Web.UI.Page { Class1 c = new Class1(); int i; string xx; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { c.cm.Connection = c.con; c.cm.CommandChar = "select distinct(trainno) from train_details"; c.adp.SelectCommand = c.cm; c.adp.Fill(c.ds, "train_details"); for (i = 0; i <= c.ds.Tables["train_details"].Rows.Count - 1; i++) { DropDownList3.Items.Add(c.ds.Tables["train_details"].Rows[i].ItemAr ray[0].ToString()); }

for (i = 1; i <= 31; i++) { DropDownList4.Items.Add(i.ToString()); } for (i = 1; i <= 12; i++) { DropDownList8.Items.Add(i.ToString()); } for (i = DateTime.Now.Year; i <= DateTime.Now.Year + 5; i+ +) { Name : 148

ON-LINE RAILWAY RESERVATION SYSTEM DropDownList5.Items.Add(i.ToString()); } } } protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e) { c.cm.Connection = c.con; c.cm.CommandChar = "select from1,to1 from train_details where trainno='" + DropDownList3.Char + "'"; c.adp.SelectCommand = c.cm; c.adp.Fill(c.ds, "train_details"); DropDownList6.Items.Clear(); DropDownList7.Items.Clear(); DropDownList6.Items.Add("Select"); DropDownList7.Items.Add("Select"); for (i = 0; i <= c.ds.Tables["train_details"].Rows.Count - 1; i+ +) { DropDownList6.Items.Add(c.ds.Tables["train_details"].Rows[i].ItemAr ray[0].ToString()); DropDownList7.Items.Add(c.ds.Tables["train_details"].Rows[i].ItemAr ray[0].ToString()); } c.cm.CommandChar = "select from1,to1 from train_details where trainno='" + DropDownList3.Char + "'"; c.adp.SelectCommand = c.cm; c.ds.Clear(); c.adp.Fill(c.ds, "train_details"); DropDownList7.Items.Add(c.ds.Tables["train_details"].Rows[0].ItemA rray[1].ToString()); } protected void Button1_Click(object sender, EventArgs e) Name : 149

ON-LINE RAILWAY RESERVATION SYSTEM { int total = 0,p=0,seat=0; c.cm.Connection = c.con; xx=DropDownList4.Char + "/" + DropDownList8.Char +"/"+ DropDownList5.Char ; c.cm.CommandChar = "select * from booking where trainno='" + DropDownList3.Char + "' and Journey_date='"+ xx +"' and class='"+ DropDownList1.SelectedItem.Char +"'"; c.adp.SelectCommand = c.cm; c.ds.Clear(); c.adp.Fill(c.ds, "booking"); total = c.ds.Tables["booking"].Rows.Count; c.cm.CommandChar = "select * from seat where trainno='" + DropDownList3.Char + "' and class='" + DropDownList1.SelectedItem.Char + "'"; c.adp.SelectCommand = c.cm; c.ds.Clear(); c.adp.Fill(c.ds, "seat"); if (c.ds.Tables["seat"].Rows.Count > 0) { p= Convert.ToInt32(c.ds.Tables["seat"].Rows[0].ItemArray[3].ToString() ); seat = p - total; } else { seat = Convert.ToInt32(c.ds.Tables["seat"].Rows[0].ItemArray[3].ToString() ); } Label2.Char = "Total Seat Available is " + seat; } }

Name :

150

ON-LINE RAILWAY RESERVATION SYSTEM 18. Train Details using using using using using using using using using using System; System.Data; System.Configuration; System.Collections; System.Web; System.Web.Security; System.Web.UI; System.Web.UI.WebControls; System.Web.UI.WebControls.WebParts; System.Web.UI.HtmlControls;

public partial class Train_details : System.Web.UI.Page { Class1 c = new Class1(); int i; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { c.cm.Connection = c.con; c.cm.CommandChar = "select distinct(trainno) from train_details"; c.adp.SelectCommand = c.cm; c.adp.Fill(c.ds, "train_details"); for (i = 0; i <= c.ds.Tables["train_details"].Rows.Count - 1; i++) { DropDownList3.Items.Add(c.ds.Tables["train_details"].Rows[i].ItemAr ray[0].ToString()); } DropDownList3.Items.Add("New Train"); }

Name :

151

ON-LINE RAILWAY RESERVATION SYSTEM } protected void Button1_Click(object sender, EventArgs e) { c.cm.Connection = c.con; if (DropDownList3.Char == "New Train") { c.cm.CommandChar = "select * from train_details where trainno='" + CharBox2.Char + "'"; c.adp.SelectCommand = c.cm; c.adp.Fill(c.ds, "train_details"); if (c.ds.Tables["train_details"].Rows.Count > 0) { Label1.Char = "Train No already Exist!!!1"; } else{ c.cm.CommandChar = "insert into train_details values('" + DropDownList1.Char + "','" + CharBox2.Char + "','" + CharBox3.Char + "','" + DropDownList2.Char + "','" + CharBox5.Char + "','" + CharBox6.Char + "','" + CharBox7.Char + "')"; c.cm.ExecuteNonQuery(); Label1.Char = "New Train added"; } } else { if (DropDownList3.Visible == true) { c.cm.CommandChar = "select * from train_details where trainno='" + DropDownList3.Char + "' and from1='" + CharBox5.Char + "' and to1='" + CharBox6.Char + "'"; } else {

Name :

152

ON-LINE RAILWAY RESERVATION SYSTEM c.cm.CommandChar = "select * from train_details where trainno='" + CharBox2.Char + "' and from1='" + CharBox5.Char + "' and to1='" + CharBox6.Char + "'"; } c.adp.SelectCommand = c.cm; c.adp.Fill(c.ds, "train_details"); if (c.ds.Tables["train_details"].Rows.Count == 0) { c.cm.CommandChar = "insert into train_details values('" + DropDownList1.Char + "','" + DropDownList3.Char + "','" + CharBox3.Char + "','" + DropDownList2.Char + "','" + CharBox5.Char + "','" + CharBox6.Char + "','" + CharBox7.Char + "')"; c.cm.ExecuteNonQuery(); Label1.Char = "New Train added"; } else { Label1.Char = "Train No With this stopage is already exist!!!!"; } } } protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e) { if (DropDownList3.Char == "New Train") { DropDownList3.Visible = false; } else { DropDownList3.Visible = true; } Name : 153

ON-LINE RAILWAY RESERVATION SYSTEM

c.cm.Connection = c.con; c.cm.CommandChar = "select * from train_details where trainno='" + DropDownList3.Char + "'"; c.adp.SelectCommand = c.cm; c.adp.Fill(c.ds, "train_details"); if (c.ds.Tables["train_details"].Rows.Count > 0) { CharBox3.Char = c.ds.Tables["train_details"].Rows[0].ItemArray[2].ToString(); } } protected void Button2_Click(object sender, EventArgs e) { CharBox2.Visible = false; DropDownList3.Visible = true; c.cm.Connection = c.con; c.cm.CommandChar = "select distinct(trainno) from train_details"; c.adp.SelectCommand = c.cm; c.adp.Fill(c.ds, "train_details"); DropDownList3.Items.Clear(); for (i = 0; i <= c.ds.Tables["train_details"].Rows.Count - 1; i+ +) { DropDownList3.Items.Add(c.ds.Tables["train_details"].Rows[i].ItemAr ray[0].ToString()); } DropDownList3.Items.Add("New Train"); Name : 154

ON-LINE RAILWAY RESERVATION SYSTEM } } 19.Train Schedule using using using using using using using System; System.Data; System.Configuration; System.Collections; System.Web; System.Web.Security; System.Web.UI;

using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class train_schedule : System.Web.UI.Page { Class1 c = new Class1(); int i; DataSet ds1 = new DataSet(); protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { c.cm.Connection = c.con; c.cm.CommandChar = "select distinct(trainno) from train_schedule order by trainno"; c.adp.SelectCommand = c.cm; c.ds.Clear(); c.adp.Fill(c.ds, "train_schedule"); DropDownList1.Items.Clear(); for (i = 0; i <= c.ds.Tables["train_schedule"].Rows.Count - 1; i++) {

Name :

155

ON-LINE RAILWAY RESERVATION SYSTEM

DropDownList1.Items.Add(c.ds.Tables["train_schedule"].Rows[i].Item Array[0].ToString()); } // fill train name c.cm.CommandChar = "select distinct(trainname) from train_schedule "; c.adp.SelectCommand = c.cm; ds1.Clear(); c.adp.Fill(ds1, "train_schedule"); DropDownList2.Items.Clear(); for (i = 0; i <= ds1.Tables["train_schedule"].Rows.Count - 1; i++) { DropDownList2.Items.Add(ds1.Tables["train_schedule"].Rows[i].Item Array[0].ToString()); } } } protected void Button1_Click(object sender, EventArgs e) { c.cm.Connection = c.con; if (RadioButton1.Checked == true) { c.cm.CommandChar = "select * from train_schedule where trainno='" + DropDownList1.Char + "'";

Name :

156

ON-LINE RAILWAY RESERVATION SYSTEM c.adp.SelectCommand = c.cm; c.ds.Clear(); c.adp.Fill(c.ds, "train_schedule"); GridView1.DataSource = c.ds.Tables["train_schedule"]; GridView1.DataBind(); } else if (RadioButton2.Checked == true) { c.cm.CommandChar = "select * from train_schedule where trainname='" + DropDownList2.Char + "'"; c.adp.SelectCommand = c.cm; c.ds.Clear(); c.adp.Fill(c.ds, "train_schedule"); GridView1.DataSource = c.ds.Tables["train_schedule"]; GridView1.DataBind(); } } protected void Button3_Click(object sender, EventArgs e) { } protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e) { // DropDownList1.SelectedIndex = DropDownList2.SelectedIndex; } } 20.Registration Page using using using using using using System; System.Data; System.Configuration; System.Collections; System.Web; System.Web.Security; 157

Name :

ON-LINE RAILWAY RESERVATION SYSTEM using using using using System.Web.UI; System.Web.UI.WebControls; System.Web.UI.WebControls.WebParts; System.Web.UI.HtmlControls;

public partial class Registration : System.Web.UI.Page { int i; Class1 c = new Class1(); protected void Page_Load(object sender, EventArgs e) { for (i = 1; i <= 31; i++) { DropDownList3.Items.Add(i.ToString() ); } for (i = 1; i <= 12; i++) { DropDownList4.Items.Add(i.ToString()); } for (i = 1950; i <= DateTime.Now.Year ; i++) { DropDownList5.Items.Add(i.ToString()); } } protected void CharBox4_CharChanged(object sender, EventArgs e) { } protected void Button2_Click(object sender, EventArgs e) {

Name :

158

ON-LINE RAILWAY RESERVATION SYSTEM

protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { // save string xx = DropDownList3.Char + "/" + DropDownList4.Char + "/" + DropDownList5.Char; c.cm.Connection = c.con; c.cm.CommandChar = "insert into registration values('" + CharBox1.Char + "','" + CharBox2.Char + "','" + DropDownList1.Char + "','" + CharBox4.Char + "','" + CharBox5.Char + "','" + CharBox6.Char + "','" + DropDownList2.Char + "','" + xx + "','" + CharBox7.Char + "','" + CharBox8.Char + "','" + CharBox9.Char + "','" + CharBox10.Char + "','" + CharBox11.Char + "')"; c.cm.ExecuteNonQuery(); Response.Write("Registration Successfuly"); } }

Name :

159

ON-LINE RAILWAY RESERVATION SYSTEM

Name :

160

ON-LINE RAILWAY RESERVATION SYSTEM

Name :

161

ON-LINE RAILWAY RESERVATION SYSTEM

Name :

162

You might also like