SlideShare uma empresa Scribd logo
1 de 163
Baixar para ler offline
PROJECT REPORT ON
“ONLINE TOURS & TRAVELS”
SUBMITTED TO
UNIVERSITY OF MUMBAI
SUBMITTED BY
MR.AMIT AJIT PATIL
ROLL NO: 172
GUIDED BY:
PROF.SHILPA RODRIGUES
T.Y.B.SC. (INFORMATION TECHNOLOGY)
FOR ACADEMIC YEAR 2013-2014
LATE SHRI VISHNU WAMAN THAKUR CHARITABLE TRUST’S
BHASKAR WAMAN THAKUR COLLEGE OF SCIENCE,
YASHWANT KESHAV PATIL COLLEGE OF COMMERCE,
VIDYA DAYANAND PATIL COLLEGE OF ARTS.
VIRAR (W).
I
DEPARTMENT OF INFORMATION TECHNOLOGY
Late Shri Vishnu Waman Thakur Charitable Trust’s
Bhaskar Waman Thakur College of Science,
Yashwant Keshav Patil College of Commerce,
Vidya Dayanand Patil College of Arts.
Virar (W).
PROJECT ON
SUBMITED BY
AMIT AJIT PATIL
T.Y.B.Sc. (Information Technology)
UNIVERSITY OF MUMBAI
Year [2013-2014]
II
III
IV
Mob: 9892867282
To whomsoever it may concern
This is to certify that project entitled “Online Tours and Travels”
undertaken at Prafulla Tours and Travels Andheri (West).
Completed by Mr. Amit Ajit Patil. The student of VIVA College, Virar as the
partial fulfillment of B.Sc.I.T (Information Technology) degree examination
project.
It is further certified that he has completed all the required phase of the project
given to his in the specified time line.
This Certificate is being issued to him own request for certificate purpose
only.
Authorized Signature
V
ACKNOWLEDGEMENT
I am very grateful to our Principal for providing us with an environment to
complete my project successfully.
I am deeply indebted to Prof. Sampada Deshmukh Head of I.T
Department, VIVA College who modelled us both technically and morally for
achieving greater success in life.
I express our sincere thanks to all our lecturers, for their constant
encouragement and support throughout our course, especially for the useful
suggestions given during the course of the project period.
I am grateful to my internal guide Prof. Shilpa Rodrigues Lecturer, for
being instrumental in the completion of our project with her complete guidance.
I would like to thank Mr. Prafulla Parab (Owner-Prafulla Travels) for
his unwavering support and guidance during the entire course of this project
work.
I also thank all the staff members of our college and technicians for their
help in making this project a successful one. Finally, we take this opportunity to
extend our deep appreciation to our family and friends, for all that they meant
to me during the crucial times of the completion of my project.
Mr. Amit Ajit Patil
VI
INDEX
Sr.no Topic Page
No.
1 Introduction of project 1
2 Organization Overview 3
2.1 Current System & limitation 5
2.2 Scope of Proposed System and its Advantage 7
3 Planning Phase 8
3.1 Feasibility Study 9
3.2 Fact Finding Techniques 11
3.3 Milestones 14
3.4 Stack holders 15
4 Front-end and Back-end 17
5 Hardware and Software Requirements 19
6 System Design and Development 22
6.1 Gantt Chart 23
6.2 E-R Diagram 24
6.3 Event Table 25
6.4 UML Diagram
6.4.1 Use Case Diagram 26
6.4.2 Class Diagram 27
6.4.3 Sequence Diagram 28
6.4.4 Activity Diagram 31
6.4.5 State Diagram 32
6.4.6 Menu Tree 33
6.4.7 CRUD Table 34
7 Tables with Attribute and Constraints 35
8 Screen Layout with Test Data and Source Code 41
9 Validation 137
10 Test Cases 143
11 Report 146
12 Future Enhancement 151
13 Conclusion 153
14 Bibliography and Preferences 155
VII
Introduction of project
1
Online Tours & Travels
I have developed this system using ASP.NET as Front End and MS SQL Server
2008 R2 at Back End project.
This System has to maintain the records of:
 CUSTOMER INFORMATION.
 AGENT INFORMATION.
 DRIVER INFORMATION.
 BOOKING INFORMATION.
 SCHEDULE INFORMATION.
 PAYMENT INFORMATION.
 ROUTE INFORMATION.
 BUS/CAR INFORMATION.
I have provided some useful reports, which are useful in analyzing the
efficiency of the system and performance of company.
2
Current System & limitation
Scope of Proposed System and its Advantage
Organization Overview
3
Company Profile
Company Name: - Prafulla Travels (Cab Service Provider)
Location: - 7 Bunglow, Varsova, Andheri (W), Mumbai
Employees: - 45
Prafulla Travels Tours Travels Company is owned by Mr. Prafulla Parab.
This organization is established in 1995 and today they are heaving a very
successful market .Company provide a services in Tourism industry from last
one decade and they have a very satisfied customer’s .The Company heaving its
Head office at Andheri. The company contains 19 Buses. They are also
providing car facilities and they have 15 cars. And company also willing to
expand their business.
Intelligent Transportation Arranger is Transport Management Information
cum Automation System this project is aimed at automation of a Travel
Agency. Objective of the project is to develop customize software package for
Travel Agencies. The system also provides a comprehensive mechanism of
transport maintenance for any travel agency. Trans-Manager is designed to help
wide range of travel agencies come together and provide service to the
customer. This System comprehensive functionality helps the agencies expand
their horizons in the field of providing transport maintenance to the
management.
The Intelligent Transportation Arranger deals with the automation of the
Transport information System. This project explains about the transporters how
exactly the maintenance of the transport system works, whether the transport
may be of Passengers or Goods. The System clearly deals with all the
information of the Transporters; firstly they define the transportation type and
their name. Next it deals with the operation, how exactly the system works and
who are all involved in the system.
4
Current System
The current System of a company is very ancient and need to be replace as
companies business is expanding. One of the biggest disadvantages of the current
system is that lacking of online booking system each time a agent need to call in
office to check the available seats and then he can booked it. Even he booked the
seats he needs to submit that amount in office within one month.
All the existing system is traditional and lack of use of technology,
therefore the process is very time consuming and lengthy as paper work is there.
This was creating problem in maintain data record at the end like profit and
loss, total expansion etc.
5
Limitation of Current System
1) Managing and keeping records of all customer, Buses are not included and they
keep some record manually.
2) Business is not on the web which was biggest Disadvantages.
3) Customer can book the car or bus by visiting to the office or to the nearest branch
which was a very tedious job.
4) Not good communication between the different branches so there is lacking of
coordination between them.
5) Bus record is not maintained properly.
6) There exist communication gap between staff, customer, agent and management.
6
Proposed System & its advantages
1) Help in reducing the file work.
2) Huge time will be saved.
3) Database is maintained so properly so that managing and keeping record is very
easy.
4) System is fully integrated.
5) Quicker access of information to the administrator.
6) All types of information is available at anywhere at any time as System now is
online.
7) As it is now on web it surely increase the growth of the business and profit will
automatically increase.
8) Ultimately customer is center point in this system.
9) Booking system is very much effective and maintain only one data so there is no
duplication of data.
7
Feasibility Study
Fact Finding Techniques
Milestones
Stack holders
Planning Phase
8
Feasibility Study
The very first phase in any system developing life cycle is preliminary
investigation. In the preliminary study we examine the project feasibility.
This project has been tested in the following areas of feasibility
 Operation Feasibility
 Technical Feasibility
 Economic Feasibility
Operational Feasibility:
It was decided that the proposed system could be created as a web based system
that be operated by all the clients.
 The system is designed in such a way that it is easy to operate.
 The system does not involve any complex operations. It handles only simple
data oriented functions.
 It is aimed at giving an easy way to generate reports.
 The functional accessibility is also structured in such a way it won’t take much
time for anyone to get accustomed with the system.
 Amount of knowledge and expertise required for being able to use this system
is not much more than what it requires to operate a computer system.
 The Client must have only the basic knowledge of web browsers.
Hence there is no need of any special person with any particular
qualification or expertise in any filed to use the MY-WEB-TRENDS system.
9
Technical Feasibility:
It was decided that the MY-WEB-TRENDS system was technically feasible
because of the following
 The system has very simple structure and easy to understand body.
 Also software used to build the system is simple enough in their usage and
functionality.
 To operate this system only a web browser is needed. The system is platform
independent and browser independent and supports all kinds of web browsers
like Internet Explorer, Mozilla Firefox, etc.
 The system can be expanded if so decided.
 This system is technically more secure.
Economic Feasibility:
The Economic Feasibility of the system is mainly concerned with its financial
aspects. It determines whether the investment that goes into the implementation
of the project is recoverable or not. The Cost Benefit Analysis is a commonly
used method in evaluating the effectiveness of the system.
 The cost of developing this system currently includes the minimum software
cost to develop and run the system.
The most of the software used in the system development is freely available
on the Web.
10
FACT FINDING TECHNIQUES
We mainly used three fact finding techniques to find out for ourselves the
correct information on basis of which we will built software.
There fact finding techniques are extremely important because these are
fact on basis of which we can build the software that comprises of a friendly
environment to customer to work with.
These is the reason why fact finding is an important activity.
The techniques which were used by us include:
 Interview &Questionnaire
 Document Sampling
 Work Site Observation
Interview & Questionnaire:
This is considered as one of the best fact finding technique. This include
direct interaction with the customer. It is considered as the best technique,
because it is the only way the user can reveal the details & fact about his past,
present & expected working, requirements, technologies .These are the
information which give us the description of the systems, we have to we have to
implement our logic and our own ideas & make this description to turn to
reality, to work as module which the user desire.
Questionnaire:
 Open-Ended Questions
 Close-Ended Questions
Open-Ended Questions:-
Q. How does your current process work?
Q. What are the main modules and attributes of your current System?
Q. What are limitation of current process?
11
Close-Ended Questions:-
Q. What is your Organization name?
Q. Do the Organization have any branches?
Q. At what respected position do your work in your organization?
Q. On which platform your work manual report is prepared?
Q. Is your current system economically, functionally and technically feasible?
Q. How many days it takes to submit my new proposed software?
Q. What if my software provides you ease and is less time consuming with
more effects?
Reviews:-
1) How does your current process work?
Ans: All the information about employee are stored in the files similarly the
customer details are stored in customer file.
2) What are the main modules and attributes of your current System?
Ans: New register details, complaint details, payment, booking and report
are the main modules etc. are the attributes.
3) What are limitation of current process?
Ans: Functionality it’s a complex procedure, technically it’s difficult,
lengthy and time consuming.
4) What is your Organization name?
Ans: Prafulla Travels.
5) Do the Organization have any branches?
Ans: Yes.
6) At what respected position do your work in your organization?
Ans: Employee.
7) On which platform your work manual report is prepared?
Ans: MS-Excel, MS-Word.
8) Is your current system economically, functionally and technically
feasible?
Ans: No.
9) How many days it takes to submit my new proposed software?
Ans: 10-15 days.
12
10) What if my software provides you ease and is less time consuming
with more effects?
Ans: Well and Good.
11) What if the time duration to submit my new proposed project?
Ans: within year.
Work Site Observation:
Through observation of the information about various activities that are
carried out during various transactions that take place during the sales &
purchase processes.
This method is useful to observe how the documents are handled, how
the processes are carried out and whether all the specified steps are carried out.
Actual procedures are compared with the method actually used. We also study
try to find out how these processes can be carried out with help of the new
techniques available or there need to alter the current techniques.
Documentation Searching:
We went through various docs like invoices, orders, quotations etc. to
understand the necessary fields to be included in the reports and forms about
sales and purchase transactions.
13
PHASES DESCRIPTION DURATION/
TIME(Days)
1. Planning In this phase, I planned out what is
my project all about and what is
organization needs and expectation
from this project.
14 Days
2. Requirement In this phase, I identified the
requirements of my project which
would be best suitable.
20 Days
3. Analysis I Analyzed the whole system and
made of note things to be
automated.
25 Days
4. Database
Design
In this phase, I made clear the
database tables that would be
required & designed them.
19 Days
5. Form Design &
Report Design
In this phase, I have designed all the
project forms & project reports.
18 Days
6. Coding In this phase, I have started my hard
coding of my project.
40 Days
7. Test &
Implementation
After my coding phase is completed
I started with testing of my
software. I have implemented my
software in the organization.
15 Days
MILESTONE
14
STACK HOLDER
Stake Holders are the person who has success in the system. Stake
Holders are main source of information.
Following are the Stake Holders of the organization:
1) Administrator:-
The administrator includes the performance or management
of business operations and decision making as well as the efficient
organization of people and other resources to direct activities toward
common goals and objectives.
2) Agent:-
An Agent is one who acts for, or in the place of, another, by authority from
him; one entrusted with the business of another.
3) Customer/User:-
A customer (sometimes known as a client, buyer, or purchaser) is the
recipient of a good, service, product, or idea, obtained from a seller, vendor,
or supplier for a monetary or other valuable consideration. Customers are
generally categorized into two types:
 An intermediate customer or trade customer (more informally: "the
trade") who is a dealer that purchases goods for re-sale.
 An ultimate customer who does not in turn re-sell the things bought but
either passes them to the consumer or actually is the consumer.
15
4) Driver:-
The term refers to the person who is in charge of the motor (of the electric
car) in the same sense as a railroad engineer is in charge of the engine.
5) Employee:-
An employee contributes labor and/or expertise to an endeavor of an
employer and is usually hired to perform specific duties which are packaged
into a job.
16
Front-end and Back-end
17
TECHNOLOGIES
Software Environment Development Language
Presentation Layer HTML,CSS
Front-End ASP.NET
Back-End MS SQL SERVER 2008 R2
18
Hardware and Software
Requirements
19
HARDWARE AND SOFTWARE
REQUIREMENTS
Hardware Requirement:
 Pentium 4/Due Core & above
 128MB RAM (Minimum).
 VGA monitor/LED/LCD

Software Requirements:
 Operating system: Microsoft Windows 98/2000/XP/Vista/Windows 7.
 Platform of development: Visual Studio2010, Adobe Photoshop.
 Database: MS SQL SERVER 2008 R2
 Web Browser: Windows Internet Explorer 6.0 and above, Mozilla Firefox,
etc.
20
Background OF Technologies
Why we Used ASP.NET Language?
ASP.NET is one of the most exciting web development technologies on
offer today. Here was a powerful platform with lots of built-in functionality,
astonishing performance levels, and one of the best IDEs around: Visual Studio.
ASP.NET showed the way for the faster, easier, and more disciplined
development of dynamic web sites, and the results were impressive.
Some features of ASP.NET are as follows:
 ASP.NET lets you use your favorite programming language, or at least one
that’s close to it. The .NET Framework currently supports over 40
languages, and many of these may be used to build ASP.NET web sites.
The most popular choices are C# and Visual Basic (or VB).
 ASP.NET pages are compiled, not interpreted The code is compiled into
efficient binary files, which can be run very quickly, again and again,
without the overhead involved in re-reading the page each time.
 ASP.NET has full access to the functionality of the .NET Framework.
Support for XML, web services, database interaction, email, regular
expressions, and many other technologies are built right into it.
 ASP.NET allows you to separate the server-side code in your pages from
the HTML layout.
 ASP.NET makes it easy to reuse common User Interface elements in many
web forms.
 You can get excellent tools that assist in developing ASP.NET web
applications. Visual Web Developer 2010 is a free, powerful visual editor
that includes features such as code auto completion, code formatting,
database integration functionality, a visual HTML editor, debugging, and
more.
ASP.NET is a fantastic technology that enables you to develop web sites and
applications with very little hassle. Developing web applications was never this
easy, yet even though it may appear simple, there is real power and depth to this
technology that enables it to host even the most complex applications available
today.
21
Gantt chart
E-R Diagram
Event Table
Use Case Diagram
Class Diagram
Sequence Diagram
Activity Diagram
State Diagram
Menu Tree
CRUD Table
System Flow Chart
Structure Chart
System Design and
Development
22
Gantt chart
23
E-R Diagram
24
Event Table
25
Use Case Diagram
26
Class Diagram
27
Sequence Diagram
 Sequence Diagram for Admin:
28
 Sequence Diagram for Agent:
29
 Sequence Diagram for Customer:
30
Activity Diagram
31
State Diagram
32
Menu Tree
33
CRUD Table
34
Tables with Attribute
and Constraints
35
Tables with Attribute and Constraints
1) Admin Table:-
2) Agent Detail Table:-
3) Car Status Table:-
36
4) Bus Booking Detail Table:-
5) Bus Details Table:-
6) Car List Table:-
37
7) Car Calculation Table:-
8) Car Booking Table:-
9) Suggestion Table:-
38
10) Driver Table:-
11) Fare Details Table:-
12) Scheduled Table:-
39
13) Payment Table:-
14) Route Info Table:-
15) Seat Table:-
40
Screen Layout with Test
Data and Source Code
41
FORM NAME:-AdminLogin
Login form is designed to authenticate the Administrator. With Correct
Username and Password, AdminPanel is accessible.
42
CODE:-
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
public partial class AdminLogin : System.Web.UI.Page
{
Datautility dclass = new Datautility();
DataSet ds = new DataSet();
protected void Page_Load(object sender, EventArgs e)
{}
protected void Login1_Authenticate1(object sender, AuthenticateEventArgs e)
{
Session["adminid"] = Login1.UserName;
string check = "select * from Admin where Email_id='" + Login1.UserName + "' and
password='" + Login1.Password + "' and user_type='Admin'";
ds = dclass.GetDataSet(check);
Boolean validuser;
validuser = false;
String usertype = "";
if (ds.Tables[0].Rows.Count > 0)
{
validuser = true;
Session["adminid"] = ds.Tables[0].Rows[0]["Email_id"].ToString();
usertype = ds.Tables[0].Rows[0]["user_type"].ToString();
}
if (validuser == true)
{
if (usertype == "Admin")
{
Response.Redirect("AdminPanel.aspx");
}
}
else
{
e.Authenticated = false;
}
}
}
43
FORM NAME:-AdminPanel
This is main window for current Administrator in the
Online Tours & Travel Software. AdminPanel is accessible only after proper
Login by Administrator.
44
45
46
47
CODE:-
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;
public partial class AdminPanel : System.Web.UI.Page
{
Datautility d = new Datautility();
static string b, c, f, g, h;
protected void Page_Load(object sender, EventArgs e)
{
if (Session["adminid"] == null)
{
Response.Redirect("AdminLogin.aspx");
}
if (!IsPostBack)
{
filldropdown();
fillbus();
BindADsplan();
bindroute();
bindfare();
bindschedule();
//binddriver();
bindcar();
bindcarcal();
bindcarcalnotify();
binddriver();
}
}
protected void binddriver()
{
string st = "select count(*) from Agent_Details";
d.ExecuteScalar1(st);
string query = "Select * from Agent_Details";
DataSet ds = new DataSet();
ds = d.GetDataSet(query);
if (ds.Tables[0].Rows.Count > 0)
48
{
GridView5.Visible = true;
GridView5.DataSource = ds;
GridView5.DataBind();
}
else
{
GridView5.Visible = false;
GridView5.Columns.Clear();
}
}
public void fillbus()
{
SqlConnection con = new
SqlConnection(ConfigurationManager.ConnectionStrings["connection"].ConnectionString);
SqlCommand cmd = new SqlCommand("Select bus_no from bus_Details", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
DropDownList4.DataTextField = ds.Tables[0].Columns["bus_no"].ToString();
DropDownList4.DataValueField = ds.Tables[0].Columns["bus_no"].ToString();
DropDownList4.DataSource = ds.Tables[0];
DropDownList4.DataBind();
DropDownList4.Items.Insert(0, new ListItem("-- Please Select --", "0"));
DropDownList1.DataTextField = ds.Tables[0].Columns["bus_no"].ToString();
DropDownList1.DataValueField = ds.Tables[0].Columns["bus_no"].ToString();
DropDownList1.DataSource = ds.Tables[0];
DropDownList1.DataBind();
DropDownList1.Items.Insert(0, new ListItem("-- Please Select --", "0"));
}
public void filldropdown()
{
SqlConnection con = new
SqlConnection(ConfigurationManager.ConnectionStrings["connection"].ConnectionString);
SqlCommand cmd = new SqlCommand("Select * from Route_Info", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
DropDownList6.DataTextField = ds.Tables[0].Columns["RouteName"].ToString();
DropDownList6.DataValueField = ds.Tables[0].Columns["RouteName"].ToString();
DropDownList6.DataSource = ds.Tables[0];
DropDownList6.DataBind();
49
DropDownList7.DataTextField = ds.Tables[0].Columns["RouteName"].ToString();
DropDownList7.DataValueField = ds.Tables[0].Columns["RouteName"].ToString();
DropDownList7.DataSource = ds.Tables[0];
DropDownList7.DataBind();
}
protected void Button1_Click(object sender, EventArgs e)
{
string query = "Select * from bus_Details";
DataSet ds = new DataSet();
ds = d.GetDataSet(query);
if (ds.Tables[0].Rows.Count > 0)
{
if (ds.Tables[0].Rows[0]["bus_no"].ToString() == TextBox1.Text)
{
MsgBoxShow("Bus Already exist");
}
else
{
string insertbus = "insert into bus_Details(bus_no,busname,bustype) values";
insertbus += " ('" + TextBox1.Text.ToUpper() + "','" + TextBox3.Text + "','" +
DropDownList3.SelectedItem.Text + "')";
d.ExecuteSql(insertbus);
MsgBoxShow("Bus added");
TextBox1.Text = "";
TextBox3.Text = "";
DropDownList3.SelectedIndex = 0;
BindADsplan();
}
}
}
protected void Button7_Click(object sender, EventArgs e)
{
if (Button7.Text == "Update")
{
if (DropDownList4.SelectedIndex.ToString() == "0")
{
MsgBoxShow("Please Select Bus No");
}
else
{
Double km = Convert.ToDouble(TextBox7.Text);
Double fare_km = Convert.ToDouble(TextBox4.Text);
Double totalfare = km * fare_km;
50
ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "Insert", "Total(" +
totalfare + ");", true);
string updtfare = "update Fare_details set bus_no='" + DropDownList4.SelectedItem.Text +
"',Bustype='" + TextBox8.Text + "',source='" + DropDownList6.SelectedItem.Text + "',";
updtfare += "destination='" + DropDownList7.SelectedItem.Text + "',km='" + TextBox7.Text
+ "',fare_km='" + TextBox4.Text + "',totalfare='" + totalfare.ToString() + "' where fare_id='"
+ b + "'";
d.ExecuteSql(updtfare);
Label32.Text = "fare updated";
DropDownList4.SelectedIndex = 0;
DropDownList6.SelectedIndex = 0;
DropDownList7.SelectedIndex = 0;
TextBox8.Text = "";
TextBox7.Text = "";
TextBox4.Text = "";
Button7.Text = "Submit";
}
}
else
{
if (DropDownList4.SelectedIndex.ToString() == "0")
{
MsgBoxShow("Please Select Bus No");
}
else
{
string st = "select count(*) from Fare_details ";
d.ExecuteScalar1(st);
string query = "Select * from Fare_details";
DataSet ds = new DataSet();
ds = d.GetDataSet(query);
if (ds.Tables[0].Rows.Count > 0)
{
if (ds.Tables[0].Rows[0]["bus_no"].ToString() == DropDownList4.SelectedItem.Text &&
ds.Tables[0].Rows[0]["source"].ToString() == DropDownList6.SelectedItem.Text &&
ds.Tables[0].Rows[0]["destination"].ToString() == DropDownList7.SelectedItem.Text)
{
MsgBoxShow("Fare Already Set");
}
else
{
Double km = Convert.ToDouble(TextBox7.Text);
Double fare_km = Convert.ToDouble(TextBox4.Text);
Double totalfare = km * fare_km;
ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "showalert", "Total(" +
totalfare + ");", true);
51
string insertfare = "insert into
Fare_details(bus_no,Bustype,source,destination,km,fare_km,totalfare) values";
insertfare += " ('" + DropDownList4.SelectedItem.Text + "','" + TextBox8.Text + "','" +
DropDownList6.SelectedItem.Text + "','" + DropDownList7.SelectedItem.Text + "','" +
TextBox7.Text + "','" + TextBox4.Text + "','" + totalfare.ToString() + "')";
d.ExecuteSql(insertfare);
Label32.Text = "fare set";
DropDownList4.SelectedIndex = 0;
DropDownList6.SelectedIndex = 0;
DropDownList7.SelectedIndex = 0;
TextBox8.Text = "";
TextBox7.Text = "";
TextBox4.Text = "";
}
}
}
}
bindfare();
}
protected void Button2_Click(object sender, EventArgs e)
{
string insertroute = "insert into Route_Info(RouteName) values";
insertroute += "('" + TextBox6.Text + "')";
d.ExecuteSql(insertroute);
TextBox6.Text = "";
MsgBoxShow("Route added");
bindroute();
}
protected void Button3_Click(object sender, EventArgs e)
{
if (Button3.Text == "Update")
{
if (DropDownList1.SelectedIndex.ToString() == "0" ||
DropDownList2.SelectedIndex.ToString() == "0" ||
DropDownList5.SelectedIndex.ToString() == "0")
{
MsgBoxShow("Bus No or Source Or Destination Not Selected");
}
else
{
string updtSchedule = "Update scheduled set Bus_no='" + DropDownList1.SelectedItem.Text
+ "',source='" + DropDownList2.SelectedItem.Text + "',destination='" +
DropDownList5.SelectedItem.Text + "',";
updtSchedule += "fare='" + TextBox28.Text + "',coach_type='" + TextBox25.Text +
"',departing_time='" + TextBox12.Text + "',pick_up_point='" + TextBox13.Text +
"',journy_time='" + TextBox9.Text + "' where Schedule_id='" + c + "'";
52
d.ExecuteSql(updtSchedule);
MsgBoxShow("Scheduled Updated");
DropDownList1.SelectedIndex = 0;
DropDownList2.SelectedIndex = 0;
DropDownList5.SelectedIndex = 0;
TextBox28.Text = "";
TextBox25.Text = "";
TextBox12.Text = "";
TextBox13.Text = "";
TextBox9.Text = "";
Button3.Text = "Submit";
}
}
else
{
if (DropDownList1.SelectedIndex.ToString() == "0" ||
DropDownList2.SelectedIndex.ToString() == "0" ||
DropDownList5.SelectedIndex.ToString() == "0")
{
MsgBoxShow("Bus No or Source Or Destination Not Selected");
}
else
{
string insertSchedule = "insert into
scheduled(Bus_no,source,destination,fare,coach_type,departing_time,pick_up_point,journy_t
ime) values";
insertSchedule += "('" + DropDownList1.SelectedItem.Text + "','" +
DropDownList2.SelectedItem.Text + "','" + DropDownList5.SelectedItem.Text + "','" +
TextBox28.Text + "','" + TextBox25.Text + "','" + TextBox12.Text + "','" + TextBox13.Text
+ "','" + TextBox9.Text + "')";
d.ExecuteSql(insertSchedule);
MsgBoxShow("Bus Scheduled");
DropDownList1.SelectedIndex = 0;
DropDownList2.SelectedIndex = 0;
DropDownList5.SelectedIndex = 0;
TextBox28.Text = "";
TextBox25.Text = "";
TextBox12.Text = "";
TextBox13.Text = "";
TextBox9.Text = "";
}
}
bindschedule();
}
protected void Button4_Click(object sender, EventArgs e)
{
53
if (Button4.Text == "Update")
{
string updtdriver = "Update dbo.Agent_Details set agent_name='" + TextBox14.Text +
"',address='" + TextBox15.Text + "',agent_pin='" + TextBox19.Text + "',contact_no= '" +
TextBox30.Text + "',balance_amt='" + TextBox27.Text + "',Email_id='" + TextBox34.Text +
"',passwrod='" + TextBox35.Text + "' where agent_id='" + f + "'";
d.ExecuteSql(updtdriver);
//string updateagent = "Update dbo.Admin set user_type='Agent', Email_id='" +
TextBox34.Text + "',password='" + TextBox35.Text + "'";
//d.ExecuteSql(updateagent);
MsgBoxShow("Driver info Updated");
TextBox14.Text = "";
TextBox15.Text = "";
TextBox19.Text = "";
TextBox27.Text = "";
TextBox30.Text = "";
TextBox34.Text = "";
TextBox35.Text = "";
Button4.Text = "Submit";
}
else
{
string insertdriver = "insert into
dbo.Agent_Details(agent_name,address,agent_pin,contact_no,balance_amt,Email_id,passwro
d) values";
insertdriver += "('" + TextBox14.Text + "','" + TextBox15.Text + "','" + TextBox19.Text +
"','" + TextBox30.Text + "','" + TextBox27.Text + "','" + TextBox34.Text + "','" +
TextBox35.Text + "')";
d.ExecuteSql(insertdriver);
//string insertagent = "insert into Admin values('Agent','" + TextBox34.Text + "','" +
TextBox35.Text + "')";
//d.ExecuteSql(insertagent);
MsgBoxShow("Driver Added");
TextBox14.Text = "";
TextBox15.Text = "";
TextBox19.Text = "";
TextBox27.Text = "";
TextBox30.Text = "";
TextBox35.Text = "";
}
binddriver();
}
protected void Button5_Click(object sender, EventArgs e)
{
if (Button5.Text == "Update")
{
54
string updtcar = "update Car_List set car_no='" + TextBox16.Text + "',Description='" +
TextBox17.Text + "',capacity='" + TextBox18.Text + "',per_km='" + TextBox20.Text + "',";
updtcar += "per_km_with_ac='" + TextBox21.Text.ToUpper() + "',night_allowwence='" +
TextBox22.Text + "' where car_id='" + g + "'";
d.ExecuteSql(updtcar);
MsgBoxShow("Car info Updated");
TextBox16.Text = "";
TextBox17.Text = "";
TextBox18.Text = "";
TextBox20.Text = "";
TextBox21.Text = "";
TextBox22.Text = "";
Button5.Text = "Submit";
}
else
{
string query = "Select * from Car_List";
DataSet ds = new DataSet();
ds = d.GetDataSet(query);
if (ds.Tables[0].Rows.Count > 0)
{
if (ds.Tables[0].Rows[0]["car_no"].ToString() == TextBox16.Text)
{
MsgBoxShow("Car Already exist");
}
else
{
string insertcar1 = "insert into car_status(car_no,car_type,status) values";
insertcar1 += "('" + TextBox16.Text.ToUpper() + "','" + TextBox17.Text + "','unbooked')";
d.ExecuteSql(insertcar1);
string insertcar = "insert into
Car_List(car_no,Description,capacity,per_km,per_km_with_ac,night_allowwence) values";
insertcar += "('" + TextBox16.Text.ToUpper() + "','" + TextBox17.Text + "','" +
TextBox18.Text + "','" + TextBox20.Text + "','" + TextBox21.Text + "','" + TextBox22.Text
+ "')";
d.ExecuteSql(insertcar);
MsgBoxShow("Car Added");
TextBox16.Text = "";
TextBox17.Text = "";
TextBox18.Text = "";
TextBox20.Text = "";
TextBox21.Text = "";
TextBox22.Text = "";
}
}
}
55
bindcar();
}
protected void Button6_Click(object sender, EventArgs e)
{
string query = "Select * from Admin where user_type='Admin'";
DataSet ds = new DataSet();
ds = d.GetDataSet(query);
if (ds.Tables[0].Rows.Count > 0)
{
if (ds.Tables[0].Rows[0]["password"].ToString() == TextBox23.Text)
{
string updtpass = "update Admin set password='" + TextBox24.Text + "' where
user_type='Admin'";
d.ExecuteSql(updtpass);
Label33.Text = "Password Updated";
Label33.ForeColor = System.Drawing.Color.Green;
}
else
{
Label33.Text = "Please enter proper password";
Label33.ForeColor = System.Drawing.Color.Red;
}
}
}
protected void Button8_Click(object sender, EventArgs e)
{
if (Button8.Text == "Update")
{
string totnightallowence = "";
string seletnightall = "select * from Car_List where car_no='" + TextBox5.Text + "'";
DataSet ds = d.GetDataSet(seletnightall);
if (ds.Tables[0].Rows.Count > 0)
{
int nightall = Convert.ToInt32(ds.Tables[0].Rows[0]["night_allowwence"].ToString());
int days1 = nightall * Convert.ToInt32(TextBox32.Text);
totnightallowence = days1.ToString();
}
string startkm = TextBox10.Text;
string endkm = TextBox11.Text;
int totkm = Convert.ToInt32(endkm) - Convert.ToInt32(startkm);
int totamt = totkm * Convert.ToInt32(TextBox29.Text) +
Convert.ToInt32(totnightallowence);
int paytotamt = totkm * Convert.ToInt32(TextBox29.Text) +
Convert.ToInt32(totnightallowence) - Convert.ToInt32(TextBox31.Text);
string updtcalcal = "update Car_Cal set starting_km='" + TextBox10.Text + "',ending_km='"
+ TextBox11.Text + "',";
56
updtcalcal += "amt='" + paytotamt.ToString() + "',Ac_NonAc='" + TextBox26.Text +
"',perkm='" + TextBox29.Text + "',advamt='" + TextBox31.Text + "',";
updtcalcal += "car_no='" + TextBox5.Text + "',noofdays='" + TextBox32.Text +
"',totalnightallowence='" + totnightallowence + "',totalkm='" + totkm.ToString() +
"',totamt='" + totamt.ToString() + "' where booking_no='" + TextBox2.Text + "'";
d.ExecuteSql(updtcalcal);
MsgBoxShow("Fare Calculated updated");
ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", "var Mleft =
(screen.width/2)-(760/2);var Mtop = (screen.height/2)-
(700/2);window.open('carmessage2.aspx?bid=" + TextBox2.Text + "', null,
'height=400,width=460,status=yes,toolbar=no,scrollbars=yes,menubar=no,location=no,top='
+Mtop+', left='+Mleft+'' );", true);
TextBox2.Text = "";
TextBox5.Text = "";
TextBox10.Text = "";
TextBox11.Text = "";
TextBox26.Text = "";
TextBox29.Text = "";
TextBox32.Text = "";
TextBox31.Text = "";
Button8.Text = "Submit";
Button8.Enabled = true;
}
else
{
string totnightallowence = "";
string seletnightall = "select * from Car_List where car_no='" + TextBox5.Text + "'";
DataSet ds = d.GetDataSet(seletnightall);
if (ds.Tables[0].Rows.Count > 0)
{
int nightall = Convert.ToInt32(ds.Tables[0].Rows[0]["night_allowwence"].ToString());
int days1 = nightall * Convert.ToInt32(TextBox32.Text);
totnightallowence = days1.ToString();
}
string startkm = TextBox10.Text;
string endkm = TextBox11.Text;
int totkm = Convert.ToInt32(endkm) - Convert.ToInt32(startkm);
int totamt = totkm * Convert.ToInt32(TextBox29.Text) +
Convert.ToInt32(totnightallowence);
int paytotamt = totkm * Convert.ToInt32(TextBox29.Text) +
Convert.ToInt32(totnightallowence) - Convert.ToInt32(TextBox31.Text);
string insertcalcal = "insert into
Car_Cal(booking_no,starting_km,ending_km,amt,Ac_NonAc,perkm,totalkm,advamt,car_no,
noofdays,totalnightallowence,totamt) values";
57
insertcalcal += "('" + TextBox2.Text + "','" + TextBox10.Text + "','" + TextBox11.Text + "','"
+ paytotamt.ToString() + "','" + TextBox26.Text + "','" + TextBox29.Text + "','" +
totkm.ToString() + "','" + TextBox31.Text + "','" + TextBox5.Text + "','" + TextBox32.Text +
"','" + totnightallowence + "','" + totamt.ToString() + "')";
d.ExecuteSql(insertcalcal);
string uodtsts = "update carbooking set sts='inactive' where booking_no='" + TextBox2.Text
+ "'";
d.ExecuteSql(uodtsts);
MsgBoxShow("Fare Calculated");
ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", "var Mleft =
(screen.width/2)-(760/2);var Mtop = (screen.height/2)-
(700/2);window.open('carmessage2.aspx?bid=" + TextBox2.Text + "', null,
'height=400,width=460,status=yes,toolbar=no,scrollbars=yes,menubar=no,location=no,top='
+Mtop+', left='+Mleft+'' );", true);
TextBox2.Text = "";
TextBox5.Text = "";
TextBox10.Text = "";
TextBox11.Text = "";
TextBox26.Text = "";
TextBox29.Text = "";
TextBox32.Text = "";
TextBox31.Text = "";
Button8.Enabled = false;
}
bindcarcal();
bindcarcalnotify();
}
protected void DropDownList4_IndexChanged(object sender, EventArgs e)
{
string str = "select * from bus_Details where bus_no='" + DropDownList4.SelectedItem.Text
+ "'";
DataSet ds = d.GetDataSet(str);
if (ds.Tables[0].Rows.Count > 0)
{
TextBox8.Text = ds.Tables[0].Rows[0]["bustype"].ToString();
}
}
protected void Dropdownlist1_indexchanged(object sender, EventArgs e)
{
string str = "select distinct source from Fare_details where bus_no='" +
DropDownList1.SelectedItem.Text + "'";
DataSet ds = d.GetDataSet(str);
if (ds.Tables[0].Rows.Count > 0)
58
{
DropDownList2.Items.Clear();
DropDownList2.Items.Insert(0, new ListItem("-- Please Select --", "0"));
DropDownList2.DataTextField = ds.Tables[0].Columns["source"].ToString();
DropDownList2.DataValueField = ds.Tables[0].Columns["source"].ToString();
DropDownList2.DataSource = ds.Tables[0];
DropDownList2.DataBind();
}
string str1 = "select distinct destination from Fare_details where bus_no='" +
DropDownList1.SelectedItem.Text + "'";
DataSet ds1 = d.GetDataSet(str1);
if (ds1.Tables[0].Rows.Count > 0)
{
DropDownList5.Items.Clear();
DropDownList5.Items.Insert(0, new ListItem("-- Please Select --", "0"));
DropDownList5.DataTextField = ds1.Tables[0].Columns["destination"].ToString();
DropDownList5.DataValueField = ds1.Tables[0].Columns["destination"].ToString();
DropDownList5.DataSource = ds1.Tables[0];
DropDownList5.DataBind();
}
string str2 = "select * from Fare_details where bus_no='" +
DropDownList1.SelectedItem.Text + "'";
DataSet ds2 = d.GetDataSet(str2);
if (ds2.Tables[0].Rows.Count > 0)
{
TextBox25.Text = ds2.Tables[0].Rows[0]["Bustype"].ToString();
}
}
protected void Dropdownlist2_indexchanged(object sender, EventArgs e)
{
string str = "select * from Fare_details where bus_no='" + DropDownList1.SelectedItem.Text
+ "' and source='" + DropDownList2.SelectedItem.Text + "' and destination='" +
DropDownList5.SelectedItem.Text + "'";
DataSet ds = d.GetDataSet(str);
if (ds.Tables[0].Rows.Count > 0)
{
TextBox28.Text = ds.Tables[0].Rows[0]["totalfare"].ToString();
}
}
protected void Dropdownlist5_indexchanged(object sender, EventArgs e)
{
string str = "select * from Fare_details where bus_no='" + DropDownList1.SelectedItem.Text
+ "' and source='" + DropDownList2.SelectedItem.Text + "' and destination='" +
DropDownList5.SelectedItem.Text + "'";
DataSet ds = d.GetDataSet(str);
59
if (ds.Tables[0].Rows.Count > 0)
{
TextBox28.Text = ds.Tables[0].Rows[0]["totalfare"].ToString();
}
}
private void MsgBoxShow(string msg)
{
StringBuilder sb = new StringBuilder();
sb.Append("alert('");
sb.Append(msg.Replace("n", "n").Replace("r", "").Replace("'", "'"));
sb.Append("');");
ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "showalert", sb.ToString(),
true);
}
protected void BindADsplan()
{
string st = "select count(*) from bus_Details ";
d.ExecuteScalar1(st);
string query = "Select * from bus_Details";
DataSet ds = new DataSet();
ds = d.GetDataSet(query);
if (ds.Tables[0].Rows.Count > 0)
{
GridView4.Visible = true;
GridView4.DataSource = ds;
GridView4.DataBind();
}
else
{
GridView4.Visible = false;
GridView4.Columns.Clear();
}
}
protected void bindroute()
{
string st = "select count(*) from Route_Info ";
d.ExecuteScalar1(st);
string query = "Select * from Route_Info";
DataSet ds = new DataSet();
ds = d.GetDataSet(query);
if (ds.Tables[0].Rows.Count > 0)
{
GridView1.Visible = true;
GridView1.DataSource = ds;
GridView1.DataBind();
60
}
else
{
GridView1.Visible = false;
GridView1.Columns.Clear();
}
}
protected void bindfare()
{
string st = "select count(*) from Fare_details";
d.ExecuteScalar1(st);
string query = "Select * from Fare_details order by bus_no";
DataSet ds = new DataSet();
ds = d.GetDataSet(query);
if (ds.Tables[0].Rows.Count > 0)
{
GridView2.Visible = true;
GridView2.DataSource = ds;
GridView2.DataBind();
}
else
{
GridView2.Visible = false;
GridView2.Columns.Clear();
}
}
protected void bindschedule()
{
string st = "select count(*) from scheduled";
d.ExecuteScalar1(st);
string query = "Select * from scheduled order by bus_no";
DataSet ds = new DataSet();
ds = d.GetDataSet(query);
if (ds.Tables[0].Rows.Count > 0)
{
GridView3.Visible = true;
GridView3.DataSource = ds;
GridView3.DataBind();
}
else
{
GridView3.Visible = false;
GridView3.Columns.Clear();
}
}
61
protected void bindcar()
{
string st = "select count(*) from Car_List";
d.ExecuteScalar1(st);
string query = "Select * from Car_List";
DataSet ds = new DataSet();
ds = d.GetDataSet(query);
if (ds.Tables[0].Rows.Count > 0)
{
GridView6.Visible = true;
GridView6.DataSource = ds;
GridView6.DataBind();
}
else
{
GridView6.Visible = false;
GridView6.Columns.Clear();
}
}
protected void bindcarcal()
{
string st = "select count(*) from Car_Cal";
d.ExecuteScalar1(st);
string query = "Select * from Car_Cal";
DataSet ds = new DataSet();
ds = d.GetDataSet(query);
if (ds.Tables[0].Rows.Count > 0)
{
GridView7.Visible = true;
GridView7.DataSource = ds;
GridView7.DataBind();
}
else
{
GridView7.Visible = false;
GridView7.Columns.Clear();
}
}
protected void bindcarcalnotify()
{
string st = "select count(*) from carbooking where date_upto='" +
DateTime.Now.ToShortDateString() + "' and sts='active'";
d.ExecuteScalar1(st);
string query = "Select * from carbooking where date_upto='" +
DateTime.Now.ToShortDateString() + "' and sts='active'";
DataSet ds = new DataSet();
62
ds = d.GetDataSet(query);
if (ds.Tables[0].Rows.Count > 0)
{
DataList1.Visible = true;
DataList1.DataSource = ds;
DataList1.DataBind();
}
else
{
DataList1.Visible = false;
}
}
protected void GridView4_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView4.PageIndex = e.NewPageIndex;
BindADsplan();
}
protected void GridView4_RowEditing(object sender, GridViewEditEventArgs e)
{
GridView4.EditIndex = e.NewEditIndex;
BindADsplan();
}
protected void GridView4_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
int userid = Convert.ToInt32(GridView4.DataKeys[e.RowIndex].Value.ToString());
TextBox bus_no1 = (TextBox)GridView4.Rows[e.RowIndex].FindControl("bus_no1");
TextBox Totalseats1 = (TextBox)GridView4.Rows[e.RowIndex].FindControl("Totalseats1");
TextBox busname1 = (TextBox)GridView4.Rows[e.RowIndex].FindControl("busname1");
DropDownList bustype1 =
(DropDownList)GridView4.Rows[e.RowIndex].FindControl("bustype1");
string update = "update bus_Details set bus_no='" + bus_no1.Text.ToUpper() +
"',busname='" + busname1.Text + "',bustype='" + bustype1.SelectedItem.Text + "' where
bus_id='" + userid + "'";
d.ExecuteSql(update);
GridView4.EditIndex = -1;
BindADsplan();
}
protected void GridView4_RowCancelingEdit(object sender, GridViewCancelEditEventArgs
e)
{
GridView4.EditIndex = -1;
BindADsplan();
}
protected void GridView4_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
63
int userid =
Convert.ToInt32(GridView4.DataKeys[e.RowIndex].Values["bus_id"].ToString());
string del = "delete from bus_Details where bus_id='" + userid +"'";
d.ExecuteSql(del);
BindADsplan();
}
protected void GridView4_RowCommand(object sender, GridViewCommandEventArgs e)
{
}
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView1.PageIndex = e.NewPageIndex;
bindroute();
}
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
int userid =
Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Values["Route_id"].ToString());
string del = "delete from Route_Info where Route_id='" + userid + "'";
d.ExecuteSql(del);
bindroute();
}
protected void GridView2_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView2.PageIndex = e.NewPageIndex;
bindfare();
}
protected void GridView2_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
int userid =
Convert.ToInt32(GridView2.DataKeys[e.RowIndex].Values["fare_id"].ToString());
string del = "delete from Fare_details where fare_id='" + userid + "'";
d.ExecuteSql(del);
bindfare();
}
protected void GridView3_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView3.PageIndex = e.NewPageIndex;
bindschedule();
}
protected void GridView3_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
int userid =
Convert.ToInt32(GridView3.DataKeys[e.RowIndex].Values["Schedule_id"].ToString());
string del = "delete from scheduled where Schedule_id='" + userid + "'";
d.ExecuteSql(del);
64
bindschedule();
}
protected void GridView5_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView5.PageIndex = e.NewPageIndex;
binddriver();
}
protected void GridView5_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
int userid =
Convert.ToInt32(GridView5.DataKeys[e.RowIndex].Values["agent_id"].ToString());
string del = "delete from Agent_Details where agent_id='" + userid + "'";
d.ExecuteSql(del);
binddriver();
}
protected void GridView6_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView6.PageIndex = e.NewPageIndex;
bindcar();
}
protected void GridView6_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
int userid =
Convert.ToInt32(GridView6.DataKeys[e.RowIndex].Values["car_id"].ToString());
string del = "delete from Car_List where car_id='" + userid + "'";
d.ExecuteSql(del);
bindcar();
}
protected void GridView7_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView7.PageIndex = e.NewPageIndex;
bindcarcal();
}
protected void GridView7_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
int userid =
Convert.ToInt32(GridView7.DataKeys[e.RowIndex].Values["booking_no"].ToString());
string del = "delete from Car_Cal where booking_no='" + userid + "'";
d.ExecuteSql(del);
bindcarcal();
}
protected void fareEdit_Click(object sender, EventArgs e)
{
ImageButton btndetails = sender as ImageButton;
GridViewRow gvrow = (GridViewRow)btndetails.NamingContainer;
65
b = GridView2.DataKeys[gvrow.RowIndex].Value.ToString();
string str = "Select * from Fare_details where fare_id='" + b + "'";
DataSet ad = d.GetDataSet(str);
if (ad.Tables[0].Rows.Count > 0)
{
DropDownList4.Text = ad.Tables[0].Rows[0]["bus_no"].ToString();
TextBox8.Text = ad.Tables[0].Rows[0]["Bustype"].ToString();
DropDownList6.Text = ad.Tables[0].Rows[0]["source"].ToString();
DropDownList7.Text = ad.Tables[0].Rows[0]["destination"].ToString();
TextBox7.Text = ad.Tables[0].Rows[0]["km"].ToString();
TextBox4.Text = ad.Tables[0].Rows[0]["fare_km"].ToString();
Label32.Text = "";
Button7.Text = "Update";
}
}
protected void scheduleEdit_Click(object sender, EventArgs e)
{
ImageButton btndetails = sender as ImageButton;
GridViewRow gvrow = (GridViewRow)btndetails.NamingContainer;
c = GridView3.DataKeys[gvrow.RowIndex].Value.ToString();
string str = "Select * from scheduled where Schedule_id='" + c + "'";
DataSet ad = d.GetDataSet(str);
if (ad.Tables[0].Rows.Count > 0)
{
DropDownList1.Text = ad.Tables[0].Rows[0]["Bus_no"].ToString();
string str1 = "select distinct source from Fare_details where bus_no='" +
DropDownList1.Text + "'";
DataSet ds1 = d.GetDataSet(str1);
if (ds1.Tables[0].Rows.Count > 0)
{
DropDownList2.Items.Clear();
DropDownList2.Items.Insert(0, new ListItem("-- Please Select --", "0"));
DropDownList2.DataTextField = ds1.Tables[0].Columns["source"].ToString();
DropDownList2.DataValueField = ds1.Tables[0].Columns["source"].ToString();
DropDownList2.DataSource = ds1.Tables[0];
DropDownList2.DataBind();
}
string str2 = "select distinct destination from Fare_details where bus_no='" +
DropDownList1.Text + "'";
DataSet ds2 = d.GetDataSet(str2);
if (ds2.Tables[0].Rows.Count > 0)
{
DropDownList5.Items.Clear();
DropDownList5.Items.Insert(0, new ListItem("-- Please Select --", "0"));
DropDownList5.DataTextField = ds2.Tables[0].Columns["destination"].ToString();
DropDownList5.DataValueField = ds2.Tables[0].Columns["destination"].ToString();
66
DropDownList5.DataSource = ds2.Tables[0];
DropDownList5.DataBind();
}
DropDownList2.Text = ad.Tables[0].Rows[0]["source"].ToString();
DropDownList5.Text = ad.Tables[0].Rows[0]["destination"].ToString();
TextBox28.Text = ad.Tables[0].Rows[0]["fare"].ToString();
TextBox25.Text = ad.Tables[0].Rows[0]["coach_type"].ToString();
TextBox12.Text = ad.Tables[0].Rows[0]["departing_time"].ToString();
TextBox13.Text = ad.Tables[0].Rows[0]["pick_up_point"].ToString();
TextBox9.Text = ad.Tables[0].Rows[0]["journy_time"].ToString();
Button3.Text = "Update";
}
}
protected void DriverEdit_Click(object sender, EventArgs e)
{
ImageButton btndetails = sender as ImageButton;
GridViewRow gvrow = (GridViewRow)btndetails.NamingContainer;
f = GridView5.DataKeys[gvrow.RowIndex].Value.ToString();
string str = "Select * from Agent_Details where agent_id='" + f + "'";
DataSet ad = d.GetDataSet(str);
if (ad.Tables[0].Rows.Count > 0)
{
TextBox14.Text = ad.Tables[0].Rows[0]["agent_name"].ToString();
TextBox15.Text = ad.Tables[0].Rows[0]["address"].ToString();
TextBox19.Text = ad.Tables[0].Rows[0]["agent_pin"].ToString();
TextBox27.Text = ad.Tables[0].Rows[0]["contact_no"].ToString();
TextBox30.Text = ad.Tables[0].Rows[0]["balance_amt"].ToString();
TextBox34.Text = ad.Tables[0].Rows[0]["Email_id"].ToString();
TextBox35.Text = ad.Tables[0].Rows[0]["passwrod"].ToString();
Button4.Text = "Update";
}
}
protected void CarEdit_Click(object sender, EventArgs e)
{
ImageButton btndetails = sender as ImageButton;
GridViewRow gvrow = (GridViewRow)btndetails.NamingContainer;
g = GridView6.DataKeys[gvrow.RowIndex].Value.ToString();
string str = "Select * from Car_List where car_id='" + g + "'";
DataSet ad = d.GetDataSet(str);
if (ad.Tables[0].Rows.Count > 0)
{
TextBox16.Text = ad.Tables[0].Rows[0]["car_no"].ToString();
TextBox17.Text = ad.Tables[0].Rows[0]["Description"].ToString();
TextBox18.Text = ad.Tables[0].Rows[0]["capacity"].ToString();
TextBox20.Text = ad.Tables[0].Rows[0]["per_km"].ToString(); TextBox21.Text =
ad.Tables[0].Rows[0]["per_km_with_ac"].ToString();
67
TextBox22.Text = ad.Tables[0].Rows[0]["night_allowwence"].ToString();
Button5.Text = "Update";
}
}
protected void CarcalEdit_Click(object sender, EventArgs e)
{
ImageButton btndetails = sender as ImageButton;
GridViewRow gvrow = (GridViewRow)btndetails.NamingContainer;
h = GridView7.DataKeys[gvrow.RowIndex].Value.ToString();
string str = "Select * from Car_Cal where booking_no='" + h + "'";
DataSet ad = d.GetDataSet(str);
if (ad.Tables[0].Rows.Count > 0)
{
TextBox2.Text = ad.Tables[0].Rows[0]["booking_no"].ToString();
TextBox10.Text = ad.Tables[0].Rows[0]["starting_km"].ToString();
TextBox11.Text = ad.Tables[0].Rows[0]["ending_km"].ToString();
TextBox26.Text = ad.Tables[0].Rows[0]["Ac_NonAc"].ToString();
TextBox29.Text = ad.Tables[0].Rows[0]["perkm"].ToString();
TextBox31.Text = ad.Tables[0].Rows[0]["advamt"].ToString();
TextBox5.Text = ad.Tables[0].Rows[0]["car_no"].ToString();
TextBox32.Text = ad.Tables[0].Rows[0]["noofdays"].ToString();
Button8.Text = "Update";
Button8.Enabled = true;
}
}
protected void Calculate_Click(object sender, EventArgs e)
{
DataListItem item = ((LinkButton)sender).NamingContainer as DataListItem;
Label lblEmpCode = (Label)item.FindControl("Label2");
string a = lblEmpCode.Text.ToString().Trim();
string str = "Select * from carbooking where booking_no='" + a + "'";
DataSet ad = d.GetDataSet(str);
if (ad.Tables[0].Rows.Count > 0)
{
TextBox2.Text = ad.Tables[0].Rows[0]["booking_no"].ToString();
TextBox26.Text = ad.Tables[0].Rows[0]["Ac_nonac"].ToString();
TextBox31.Text = ad.Tables[0].Rows[0]["advAmount"].ToString();
TextBox5.Text = ad.Tables[0].Rows[0]["car_no"].ToString();
TextBox32.Text = ad.Tables[0].Rows[0]["No_of_days"].ToString();
string str1 = "Select * from Car_List where car_no='" +
ad.Tables[0].Rows[0]["car_no"].ToString() + "' ";
DataSet ad1 = d.GetDataSet(str1);
if (ad1.Tables[0].Rows.Count > 0)
{
if (ad.Tables[0].Rows[0]["Ac_nonac"].ToString() == "A/C")
{
68
TextBox29.Text = ad1.Tables[0].Rows[0]["per_km_with_ac"].ToString();
}
else
{
TextBox29.Text = ad1.Tables[0].Rows[0]["per_km"].ToString();
}
}
tabcont1.ActiveTabIndex = 7;
Button8.Enabled = true;
}
}
}
69
FORM NAME:-Scheduled
Scheduled form enables the User to Check the Entire
Schedule. Where User would want to go, Source, Destination, Bus number,
Fare, Coach Type, Pick up point and Status Detail.
70
CODE:-
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
public partial class scheduled : System.Web.UI.Page
{
Datautility db = new Datautility();
DataSet ds2 = new DataSet();
protected void Page_Load(object sender, EventArgs e)
{
string get = "select * from scheduled";
ds2 = db.GetDataSet(get);
schelist.DataSource = ds2;
schelist.DataBind();
}
}
71
FORM NAME:-Bus Booking
Bus booking form enables the User to Select the Source
& Destination, Journey Date and Fill the User Detail like Name, Address, and
Phone Number etc.
72
CODE:-
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
using System.Text;
public partial class booking : System.Web.UI.Page
{
Datautility d = new Datautility();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
filldropdown();
}
}
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
string countseats = "select * from Seat where bookedate='" + TextBox1.Text + "'";
DataSet ds1 = d.GetDataSet(countseats);
if (ds1.Tables[0].Rows.Count > 0)
{
if (ds1.Tables[0].Rows.Count == 44)
{
MsgBoxShow("Seats Full For Todays Booking");
}
else
{
if (Session["userid"] == null)
{
if (ddlfrom.SelectedIndex.ToString() == "0" || ddlto.SelectedIndex.ToString() == "0")
{
MsgBoxShow("Source Or Destination Not Selected");
73
}
else
{
this.ModalPopupExtender1.Show();
}
}
else
{
if (ddlfrom.SelectedIndex.ToString() == "0" || ddlto.SelectedIndex.ToString() == "0")
{
MsgBoxShow("Source Or Destination Not Selected");
}
else
{
string selectrate = "select * from Fare_details where bus_no='" +
Request.QueryString["busid"].ToString() + "' and source='" +
ddlfrom.SelectedItem.Text + "' and destination='" + ddlto.SelectedItem.Text +
"'";
DataSet ds = d.GetDataSet(selectrate);
if (ds.Tables[0].Rows.Count > 0)
{
string rate = ds.Tables[0].Rows[0]["totalfare"].ToString();
string bustype = ds.Tables[0].Rows[0]["Bustype"].ToString();
String url = "seatforuser.aspx?bustype=" + bustype + "&jrate=" + rate +
"&busno=" + Request.QueryString["busid"].ToString() + "&jouneydate=" +
TextBox1.Text + "&name=" + txtname.Text + "&address=" + txtAddrss.Text
+ "&from=" + ddlfrom.SelectedItem.Text + "&to=" + ddlto.SelectedItem.Text
+ "&email=" + txtemail.Text + "&phone=" + txtcontact2.Text;
Response.Redirect(url);
}
}
}
}
}
}
public void filldropdown()
{
string busno = Request.QueryString["busid"].ToString();
string str = "select distinct source from Fare_details where bus_no='" + busno + "'";
DataSet ds = d.GetDataSet(str);
if (ds.Tables[0].Rows.Count > 0)
{
ddlfrom.DataTextField = ds.Tables[0].Columns["source"].ToString();
ddlfrom.DataValueField = ds.Tables[0].Columns["source"].ToString();
ddlfrom.DataSource = ds.Tables[0];
ddlfrom.DataBind();
74
}
string str1 = "select distinct destination from Fare_details where bus_no='" + busno +
"'";
DataSet ds1 = d.GetDataSet(str1);
if (ds1.Tables[0].Rows.Count > 0)
{
ddlto.DataTextField = ds1.Tables[0].Columns["destination"].ToString();
ddlto.DataValueField = ds1.Tables[0].Columns["destination"].ToString();
ddlto.DataSource = ds1.Tables[0];
ddlto.DataBind();
}
}
protected void Button3_Click(object sender, EventArgs e)
{
string check = "select * from Admin where Email_id='" + TextBox4.Text + "' and
password='" + TextBox5.Text + "' and user_type='" +
DropDownList2.SelectedItem.Text + "'";
DataSet ds = d.GetDataSet(check);
Boolean validuser;
validuser = false;
String usertype = "";
if (ds.Tables[0].Rows.Count > 0)
{
validuser = true;
Session["userid"] = ds.Tables[0].Rows[0]["Email_id"].ToString();
usertype = ds.Tables[0].Rows[0]["user_type"].ToString();
}
else
{
MsgBoxShow("Invalid userid and password try again.");
}
if (validuser == true)
{
if (usertype == "User")
{
string selectrate = "select * from Fare_details where bus_no='" +
Request.QueryString["busid"].ToString() + "' and source='" +
ddlfrom.SelectedItem.Text + "' and destination='" + ddlto.SelectedItem.Text + "'";
DataSet ds1 = d.GetDataSet(selectrate);
if (ds1.Tables[0].Rows.Count > 0)
{
string rate = ds1.Tables[0].Rows[0]["totalfare"].ToString();
string bustype = ds1.Tables[0].Rows[0]["Bustype"].ToString();
String url = "seatforuser.aspx?bustype=" + bustype + "&jrate=" + rate + "&busno=" +
Request.QueryString["busid"].ToString() + "&jouneydate=" + TextBox1.Text +
"&name=" + txtname.Text + "&address=" + txtAddrss.Text + "&from=" +
75
ddlfrom.SelectedItem.Text + "&to=" + ddlto.SelectedItem.Text + "&email=" +
txtemail.Text + "&phone=" + txtcontact2.Text;
Response.Redirect(url);
}
}
else if (usertype == "Agent")
{
string selectrate = "select * from Fare_details where bus_no='" +
Request.QueryString["busid"].ToString() + "' and source='" +
ddlfrom.SelectedItem.Text + "' and destination='" + ddlto.SelectedItem.Text +
"'";
DataSet ds1 = d.GetDataSet(selectrate);
if (ds1.Tables[0].Rows.Count > 0)
{
string rate = ds1.Tables[0].Rows[0]["totalfare"].ToString();
string bustype = ds1.Tables[0].Rows[0]["Bustype"].ToString();
String url = "seatforuser.aspx?bustype=" + bustype + "&jrate=" + rate +
"&busno=" + Request.QueryString["busid"].ToString() + "&jouneydate=" +
TextBox1.Text + "&name=" + txtname.Text + "&address=" + txtAddrss.Text
+ "&from=" + ddlfrom.SelectedItem.Text + "&to=" + ddlto.SelectedItem.Text
+ "&email=" + txtemail.Text + "&phone=" + txtcontact2.Text;
Response.Redirect(url);
}
}
}
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
this.ModalPopupExtender2.Show();
}
protected void Button2_Click(object sender, EventArgs e)
{
string insertuser = "insert into Admin(user_type,Email_id,password) values('User','" +
TextBox2.Text + "','" + TextBox3.Text + "')";
d.ExecuteSql(insertuser);
Session["userid"] = TextBox2.Text;
string selectrate = "select * from Fare_details where bus_no='" +
Request.QueryString["busid"].ToString() + "' and source='" +
ddlfrom.SelectedItem.Text + "' and destination='" + ddlto.SelectedItem.Text + "'";
DataSet ds = d.GetDataSet(selectrate);
if (ds.Tables[0].Rows.Count > 0)
{
string rate = ds.Tables[0].Rows[0]["totalfare"].ToString();
string bustype = ds.Tables[0].Rows[0]["Bustype"].ToString();
76
String url = "seatforuser.aspx?bustype=" + bustype + "&jrate=" + rate + "&busno=" +
Request.QueryString["busid"].ToString() + "&jouneydate=" + TextBox1.Text +
"&name=" + txtname.Text + "&address=" + txtAddrss.Text + "&from=" +
ddlfrom.SelectedItem.Text + "&to=" + ddlto.SelectedItem.Text + "&email=" +
txtemail.Text + "&phone=" + txtcontact2.Text;
Response.Redirect(url);
}
}
private void MsgBoxShow(string msg)
{
StringBuilder sb = new StringBuilder();
sb.Append("alert('");
sb.Append(msg.Replace("n", "n").Replace("r", "").Replace("'", "'"));
sb.Append("');");
ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "showalert",
sb.ToString(), true);
}
}
77
FORM NAME:-Seat For User
Seat for user form enables the user to Select Unbooked
ticket according to the Users Choice, Booked ticket can’t be choose by User.
78
CODE:-
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
using System.Text;
public partial class seatforuser : System.Web.UI.Page
{
Datautility ddata = new Datautility();
DataBaseClass db = new DataBaseClass();
DataSet ds = new DataSet();
static int noofseat = 0;
static string bid = "";
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
noofseat = 0;
string strseta;
string getdata = "select seat_no from Seat where bus_id='" +
Request.QueryString["busno"].ToString() + "' and bookedate='" +
Request.QueryString["jouneydate"].ToString() + "'";
ds = ddata.GetDataSet(getdata);
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
strseta = ds.Tables[0].Rows[i][0].ToString();
switch (strseta)
{
case "1":
chkseat1.Checked = false;
chkseat1.BackColor = System.Drawing.Color.Red;
chkseat1.Enabled = false;
break;
case "2":
chkseat2.Checked = false;
79
chkseat2.BackColor = System.Drawing.Color.Red;
chkseat2.Enabled = false;
break;
case "3":
chkseat3.Checked = false;
chkseat3.BackColor = System.Drawing.Color.Red;
chkseat3.Enabled = false;
break;
case "4":
chkseat4.Checked = false;
chkseat4.BackColor = System.Drawing.Color.Red;
chkseat4.Enabled = false;
break;
case "5":
chkseat5.Checked = false;
chkseat5.BackColor = System.Drawing.Color.Red;
chkseat5.Enabled = false;
break;
case "6":
chkseat6.Checked = false;
chkseat6.BackColor = System.Drawing.Color.Red;
chkseat6.Enabled = false;
break;
case "7":
chkseat7.Checked = false;
chkseat7.BackColor = System.Drawing.Color.Red;
chkseat7.Enabled = false;
break;
case "8":
chkseat8.Checked = false;
chkseat8.BackColor = System.Drawing.Color.Red;
chkseat8.Enabled = false;
break;
case "9":
chkseat9.Checked = false;
chkseat9.BackColor = System.Drawing.Color.Red;
chkseat9.Enabled = false;
break;
case "10":
chkseat10.Checked = false;
chkseat10.BackColor = System.Drawing.Color.Red;
chkseat10.Enabled = false;
break;
case "11":
chkseat11.Checked = false;
chkseat11.BackColor = System.Drawing.Color.Red;
80
chkseat11.Enabled = false;
break;
case "12":
chkseat12.Checked = false;
chkseat12.BackColor = System.Drawing.Color.Red;
chkseat12.Enabled = false;
break;
case "13":
chkseat3.Checked = false;
chkseat13.BackColor = System.Drawing.Color.Red;
chkseat13.Enabled = false;
break;
case "14":
chkseat14.Checked = false;
chkseat14.BackColor = System.Drawing.Color.Red;
chkseat14.Enabled = false;
break;
case "15":
chkseat15.Checked = false;
chkseat15.BackColor = System.Drawing.Color.Red;
chkseat15.Enabled = false;
break;
case "16":
chkseat16.Checked = false;
chkseat16.BackColor = System.Drawing.Color.Red;
chkseat16.Enabled = false;
break;
case "17":
chkseat17.Checked = false;
chkseat17.BackColor = System.Drawing.Color.Red;
chkseat17.Enabled = false;
break;
case "18":
chkseat18.Checked = false;
chkseat18.BackColor = System.Drawing.Color.Red;
chkseat18.Enabled = false;
break;
case "19":
chkseat19.Checked = true;
chkseat19.BackColor = System.Drawing.Color.Red;
chkseat19.Enabled = false;
break;
case "20":
chkseat20.Checked = true;
chkseat20.BackColor = System.Drawing.Color.Red;
chkseat20.Enabled = false;
81
break;
case "21":
chkseat21.Checked = true;
chkseat21.BackColor = System.Drawing.Color.Red;
chkseat21.Enabled = false;
break;
case "22":
chkseat22.Checked = false;
chkseat22.BackColor = System.Drawing.Color.Red;
chkseat22.Enabled = false;
break;
case "23":
chkseat23.Checked = false;
chkseat23.BackColor = System.Drawing.Color.Red;
chkseat23.Enabled = false;
break;
case "24":
chkseat24.Checked = false;
chkseat24.BackColor = System.Drawing.Color.Red;
chkseat24.Enabled = false;
break;
case "25":
chkseat25.Checked = false;
chkseat25.BackColor = System.Drawing.Color.Red;
chkseat25.Enabled = false;
break;
case "26":
chkseat26.Checked = false;
chkseat26.BackColor = System.Drawing.Color.Red;
chkseat26.Enabled = false;
break;
case "27":
chkseat27.Checked = false;
chkseat27.BackColor = System.Drawing.Color.Red;
chkseat27.Enabled = false;
break;
case "28":
chkseat28.Checked = false;
chkseat28.BackColor = System.Drawing.Color.Red;
chkseat28.Enabled = false;
break;
case "29":
chkseat29.Checked = false;
chkseat29.BackColor = System.Drawing.Color.Red;
chkseat29.Enabled = false;
82
break;
case "30":
chkseat30.Checked = false;
chkseat30.BackColor = System.Drawing.Color.Red;
chkseat30.Enabled = false;
break;
case "31":
chkseat31.Checked = false;
chkseat31.BackColor = System.Drawing.Color.Red;
chkseat31.Enabled = false;
break;
case "32":
chkseat32.Checked = false;
chkseat32.BackColor = System.Drawing.Color.Red;
chkseat32.Enabled = false;
break;
case "33":
chkseat33.Checked = false;
chkseat33.BackColor = System.Drawing.Color.Red;
chkseat33.Enabled = false;
break;
case "34":
chkseat34.Checked = false;
chkseat34.BackColor = System.Drawing.Color.Red;
chkseat34.Enabled = false;
break;
case "35":
chkseat35.Checked = false;
chkseat35.BackColor = System.Drawing.Color.Red;
chkseat35.Enabled = false;
break;
case "36":
chkseat36.Checked = false;
chkseat36.BackColor = System.Drawing.Color.Red;
chkseat36.Enabled = false;
break;
case "37":
chkseat37.Checked = false;
chkseat37.BackColor = System.Drawing.Color.Red;
chkseat37.Enabled = false;
break;
case "38":
chkseat38.Checked = false;
chkseat38.BackColor = System.Drawing.Color.Red;
chkseat38.Enabled = false;
break;
83
case "39":
chkseat39.Checked = false;
chkseat39.BackColor = System.Drawing.Color.Red;
chkseat39.Enabled = false;
break;
case "40":
chkseat40.Checked = false;
chkseat40.BackColor = System.Drawing.Color.Red;
chkseat40.Enabled = false;
break;
case "41":
chkseat41.Checked = false;
chkseat41.BackColor = System.Drawing.Color.Red;
chkseat41.Enabled = false;
break;
case "42":
chkseat42.Checked = false;
chkseat42.BackColor = System.Drawing.Color.Red;
chkseat42.Enabled = false;
break;
case "43":
chkseat43.Checked = false;
chkseat43.BackColor = System.Drawing.Color.Red;
chkseat43.Enabled = false;
break;
case "44":
chkseat44.Checked = false;
chkseat44.BackColor = System.Drawing.Color.Red;
chkseat44.Enabled = false;
break;
}
}
String name = Request.QueryString["name"];
String address = Request.QueryString["address"];
String from = Request.QueryString["from"];
String to = Request.QueryString["to"];
String email = Request.QueryString["email"];
String phone = Request.QueryString["phone"];
String jouneydate = Request.QueryString["jouneydate"];
busnumber.Text = Request.QueryString["busno"].ToString();
bustype.Text = Request.QueryString["bustype"].ToString();
txtname1.Text = name;
txtaddres.Text = address;
txtbording.Text = from;
txtmail.Text = email;
txtphone.Text = phone;
84
txtdate.Text = Request.QueryString["jouneydate"];
txtfare.Text = Request.QueryString["jrate"].ToString();
txtdrop.Text = to;
txtnoseat.Text = "0";
}
}
protected void btnNext_Click(object sender, EventArgs e)
{
if (txtnoseat.Text == "0")
{
MsgBoxShow("Please Select Seats");
}
else
{
string strst = "select isnull(max(Booking_no),0)+1 from bus_Booking";
DataSet ds = new DataSet();
ds = ddata.GetDataSet(strst);
if (ds.Tables[0].Rows.Count > 0)
{
bid = ds.Tables[0].Rows[0][0].ToString();
}
Session["bid"] = bid;
Label49.Text = bid;
Label55.Text = txtname1.Text;
Label51.Text = txtdate.Text;
Label53.Text = countedseats.Value;
Label57.Text = totalprice.Value;
this.ModalPopupExtender1.Show();
}
}
protected void Button6_Click(object sender, EventArgs e)
{
char[] c = { ',' };
string strst1 = hiddennooffields.Value.ToString();
String[] arr = strst1.Split(c);
Datautility db = new Datautility();
foreach (String a in arr)
{
if (a == "")
{
}
else
{
string savedata = "insert into Seat (bus_id,seat_no,bookedate,status)values('" +
Request.QueryString["busno"].ToString() + "','" + a + "','" +
Request.QueryString["jouneydate"].ToString() + "','booked')";
85
db.ExecuteSql(savedata);
}
}
string s = "select user_type from Admin where Email_id='" + txtmail.Text+ "'";
DataSet ds = new DataSet();
ds = ddata.GetDataSet(s);
string utype = ds.Tables[0].Rows[0]["user_type"].ToString();
if (utype == "User")
{
string strst2 = "insert into
bus_Booking(Booking_no,person_name,address,phone_no,email_id,no_of_seats,sour
ce,destination,traveling_date,stime,cost,payment_Status,busnumber,bustype)";
strst2 = strst2 + " values('" + Session["bid"].ToString() + "','" + txtname1.Text + "','" +
txtaddres.Text + "','" + txtphone.Text + "','" + txtmail.Text + "','" +
countedseats.Value + "','" + txtbording.Text + "','" + txtdrop.Text + "','" + txtdate.Text
+ "','3','" + totalprice.Value + "','DD','" + busnumber.Text + "','" + bustype.Text + "')";
db.ExecuteSql(strst2);
if (DropDownList5.SelectedItem.Text == "Pay By Debit/Credit Card/Net Banking")
{
if (TabContainer1.ActiveTabIndex == 0)
{
string insertpayment = "insert into
Payment(user_id,bid,PaymentMode,Debit_Cardno,nameoncard,expiry_month,expiry_
year,cvv_no,paidby,paydate,Amount,bookingfor) values";
insertpayment += "('" + Session["userid"].ToString() + "','" + bid + "','" +
DropDownList5.SelectedItem.Text + "','" + txtCardNo.Text + "','" +
txtNameOnCard.Text + "','" + DropDownList6.SelectedItem.Text + "','" +
DropDownList7.SelectedItem.Text + "','" + txtCvvNo.Text + "','Debit Card','" +
DateTime.Now.ToString() + "','" + totalprice.Value + "','bus')";
ddata.ExecuteSql(insertpayment);
}
else if (TabContainer1.ActiveTabIndex == 1)
{
string insertpayment = "insert into
Payment(user_id,bid,PaymentMode,Credit_Cardno,nameoncard,expiry_month,expiry
_year,cvv_no,paidby,paydate,Amount,bookingfor) values";
insertpayment += "('" + Session["userid"].ToString() + "','" + bid + "','" +
DropDownList5.SelectedItem.Text + "','" + txtCardNoCr.Text + "','" +
txtNameOnCardCr.Text + "','" + DropDownList8.SelectedItem.Text + "','" +
DropDownList9.SelectedItem.Text + "','" + txtCvvNoCr.Text + "','Credit Card','" +
DateTime.Now.ToString() + "','" + totalprice.Value + "','bus')";
ddata.ExecuteSql(insertpayment);
}
else
{
86
string insertpayment = "insert into
Payment(user_id,bid,PaymentMode,Bankname,username,password,paidby,paydate,A
mount,bookingfor) values";
insertpayment += "('" + Session["userid"].ToString() + "','" + bid + "','" +
DropDownList5.SelectedItem.Text + "','" + ddlBankName.SelectedItem.Text + "','" +
txtUserName.Text + "','" + txtUserPass.Text + "','Net Banking','" +
DateTime.Now.ToString() + "','" + totalprice.Value + "','bus')";
ddata.ExecuteSql(insertpayment);
}
}
else
{
string insertpayment = "insert into
Payment(user_id,bid,PaymentMode,paidby,paydate,Amount,bookingfor) values";
insertpayment += "('" + Session["userid"].ToString() + "','" + bid + "','" +
DropDownList5.SelectedItem.Text + "','Cash','" + DateTime.Now.ToString() + "','" +
totalprice.Value + "','bus')";
ddata.ExecuteSql(insertpayment);
}
Response.Redirect("message.aspx?bid=" + bid);
}
else if(utype=="Agent")
{
string strst2 = "insert into
bus_Booking(Booking_no,person_name,address,phone_no,email_id,no_of_seats,sour
ce,destination,traveling_date,stime,cost,payment_Status,busnumber,bustype)";
strst2 = strst2 + " values('" + Session["bid"].ToString() + "','" + txtname1.Text + "','" +
txtaddres.Text + "','" + txtphone.Text + "','" + txtmail.Text + "','" +
countedseats.Value + "','" + txtbording.Text + "','" + txtdrop.Text + "','" + txtdate.Text
+ "','3','" + totalprice.Value + "','DD','" + busnumber.Text + "','" + bustype.Text + "')";
db.ExecuteSql(strst2);
string strtotal = "Select distinct a.email_id,b.balance_amt from dbo.bus_Booking
a,dbo.Agent_Details b where a.email_id=b.Email_id and a.email_id='" + txtmail.Text
+ "' ";
DataSet ds1 = new DataSet();
ds1 = ddata.GetDataSet(strtotal);
int z = Int32.Parse(ds1.Tables[0].Rows[0]["balance_amt"].ToString());
int b = Int32.Parse(txttotal.Text);
int total = z - b;
string updateagent = "update Agent_Details set balance_amt='" + total + "' where
Email_id='" + txtmail.Text + "' ";
db.ExecuteSql(updateagent);
if (DropDownList5.SelectedItem.Text == "Pay By Debit/Credit Card/Net Banking")
{
87
if (TabContainer1.ActiveTabIndex == 0)
{
string insertpayment = "insert into
Payment(user_id,bid,PaymentMode,Debit_Cardno,nameoncard,expiry_month,expiry_
year,cvv_no,paidby,paydate,Amount,bookingfor) values";
insertpayment += "('" + Session["userid"].ToString() + "','" + bid + "','" +
DropDownList5.SelectedItem.Text + "','" + txtCardNo.Text + "','" +
txtNameOnCard.Text + "','" + DropDownList6.SelectedItem.Text + "','" +
DropDownList7.SelectedItem.Text + "','" + txtCvvNo.Text + "','Debit Card','" +
DateTime.Now.ToString() + "','" + totalprice.Value + "','bus')";
ddata.ExecuteSql(insertpayment);
}
else if (TabContainer1.ActiveTabIndex == 1)
{
string insertpayment = "insert into
Payment(user_id,bid,PaymentMode,Credit_Cardno,nameoncard,expiry_month,expiry
_year,cvv_no,paidby,paydate,Amount,bookingfor) values";
insertpayment += "('" + Session["userid"].ToString() + "','" + bid + "','" +
DropDownList5.SelectedItem.Text + "','" + txtCardNoCr.Text + "','" +
txtNameOnCardCr.Text + "','" + DropDownList8.SelectedItem.Text + "','" +
DropDownList9.SelectedItem.Text + "','" + txtCvvNoCr.Text + "','Credit Card','" +
DateTime.Now.ToString() + "','" + totalprice.Value + "','bus')";
ddata.ExecuteSql(insertpayment);
}
else
{
string insertpayment = "insert into
Payment(user_id,bid,PaymentMode,Bankname,username,password,paidby,paydate,A
mount,bookingfor) values";
insertpayment += "('" + Session["userid"].ToString() + "','" + bid + "','" +
DropDownList5.SelectedItem.Text + "','" + ddlBankName.SelectedItem.Text + "','" +
txtUserName.Text + "','" + txtUserPass.Text + "','Net Banking','" +
DateTime.Now.ToString() + "','" + totalprice.Value + "','bus')";
ddata.ExecuteSql(insertpayment);
}
}
else
{
string insertpayment = "insert into
Payment(user_id,bid,PaymentMode,paidby,paydate,Amount,bookingfor) values";
insertpayment += "('" + Session["userid"].ToString() + "','" + bid + "','" +
DropDownList5.SelectedItem.Text + "','Cash','" + DateTime.Now.ToString() + "','" +
totalprice.Value + "','bus')";
ddata.ExecuteSql(insertpayment);
}
}
88
Response.Redirect("message.aspx?bid=" + bid);
}
protected void dropdownlist5_click(object sender, EventArgs e)
{
if (DropDownList5.SelectedItem.Text == "Please Select")
{ }
else if (DropDownList5.SelectedItem.Text == "Pay By Cash")
{
Panel3.Visible = false;
}
else
{
Panel3.Visible = true;
}
this.ModalPopupExtender1.Show();
}
private void MsgBoxShow(string msg)
{
StringBuilder sb = new StringBuilder();
sb.Append("alert('");
sb.Append(msg.Replace("n", "n").Replace("r", "").Replace("'", "'"));
sb.Append("');");
ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "showalert",
sb.ToString(), true);
}
protected void chkseat2_CheckedChanged(object sender, EventArgs e)
{
if (chkseat2.Checked == true)
{
noofseat = noofseat + 1;
hiddennooffields.Value = hiddennooffields.Value+","+"2";
txtselected.Text = hiddennooffields.Value;
txtnoseat.Text = "";
txtnoseat.Text = noofseat.ToString();
countedseats.Value = noofseat.ToString();
double price;
price = Convert.ToDouble(Request.QueryString["jrate"].ToString());
price = noofseat * price;
txttotal.Text = price.ToString();
totalprice.Value = price.ToString();
removeComma();
}
else
{
noofseat = noofseat - 1;
string hdf = hiddennooffields.Value.ToString();
89
hiddennooffields.Value = hdf.Replace(",2", "");
txtselected.Text = hiddennooffields.Value;
txtnoseat.Text = "";
txtnoseat.Text = noofseat.ToString();
countedseats.Value = noofseat.ToString();
double price;
price = Convert.ToDouble(Request.QueryString["jrate"].ToString());
price = noofseat * price;
txttotal.Text = price.ToString();
totalprice.Value = price.ToString();
removeComma();
}
}
protected void chkseat3_CheckedChanged(object sender, EventArgs e)
{
if (chkseat3.Checked == true)
{
noofseat = noofseat + 1;
hiddennooffields.Value = hiddennooffields.Value + "," + "3";
txtselected.Text = hiddennooffields.Value;
txtnoseat.Text = "";
txtnoseat.Text = noofseat.ToString();
countedseats.Value = noofseat.ToString();
double price;
price = Convert.ToDouble(Request.QueryString["jrate"].ToString());
price = noofseat * price;
txttotal.Text = price.ToString();
totalprice.Value = price.ToString();
removeComma();
}
else
{
noofseat = noofseat - 1;
string hdf = hiddennooffields.Value.ToString();
hiddennooffields.Value = hdf.Replace(",3", "");
txtselected.Text = hiddennooffields.Value;
txtnoseat.Text = "";
txtnoseat.Text = noofseat.ToString();
countedseats.Value = noofseat.ToString();
double price;
price = Convert.ToDouble(Request.QueryString["jrate"].ToString());
price = noofseat * price;
txttotal.Text = price.ToString();
totalprice.Value = price.ToString();
removeComma();
}
90
}
protected void chkseat4_CheckedChanged(object sender, EventArgs e)
{
if (chkseat4.Checked == true)
{
noofseat = noofseat + 1;
hiddennooffields.Value = hiddennooffields.Value + "," + "4";
txtselected.Text = hiddennooffields.Value;
txtnoseat.Text = "";
txtnoseat.Text = noofseat.ToString();
countedseats.Value = noofseat.ToString();
double price;
price = Convert.ToDouble(Request.QueryString["jrate"].ToString());
price = noofseat * price;
txttotal.Text = price.ToString();
totalprice.Value = price.ToString();
removeComma();
}
else
{
noofseat = noofseat - 1;
string hdf = hiddennooffields.Value.ToString();
hiddennooffields.Value = hdf.Replace(",4", "");
txtselected.Text = hiddennooffields.Value;
txtnoseat.Text = "";
txtnoseat.Text = noofseat.ToString();
countedseats.Value = noofseat.ToString();
double price;
price = Convert.ToDouble(Request.QueryString["jrate"].ToString());
price = noofseat * price;
txttotal.Text = price.ToString();
totalprice.Value = price.ToString();
removeComma();
}
}
protected void chkseat5_CheckedChanged(object sender, EventArgs e)
{
if (chkseat5.Checked == true)
{
noofseat = noofseat + 1;
hiddennooffields.Value = hiddennooffields.Value + "," + "5";
txtselected.Text = hiddennooffields.Value;
txtnoseat.Text = "";
txtnoseat.Text = noofseat.ToString();
countedseats.Value = noofseat.ToString();
double price;
91
price = Convert.ToDouble(Request.QueryString["jrate"].ToString());
price = noofseat * price;
txttotal.Text = price.ToString();
totalprice.Value = price.ToString();
removeComma();
}
else
{
noofseat = noofseat - 1;
string hdf = hiddennooffields.Value.ToString();
hiddennooffields.Value = hdf.Replace(",5", "");
txtselected.Text = hiddennooffields.Value;
txtnoseat.Text = "";
txtnoseat.Text = noofseat.ToString();
countedseats.Value = noofseat.ToString();
double price;
price = Convert.ToDouble(Request.QueryString["jrate"].ToString());
price = noofseat * price;
txttotal.Text = price.ToString();
totalprice.Value = price.ToString();
removeComma();
}
}
protected void chkseat6_CheckedChanged(object sender, EventArgs e)
{
if (chkseat6.Checked == true)
{
noofseat = noofseat + 1;
hiddennooffields.Value = hiddennooffields.Value + "," + "6";
txtselected.Text = hiddennooffields.Value;
txtnoseat.Text = "";
txtnoseat.Text = noofseat.ToString();
countedseats.Value = noofseat.ToString();
double price;
price = Convert.ToDouble(Request.QueryString["jrate"].ToString());
price = noofseat * price;
txttotal.Text = price.ToString();
totalprice.Value = price.ToString();
removeComma();
}
else
{
noofseat = noofseat - 1;
string hdf = hiddennooffields.Value.ToString();
hiddennooffields.Value = hdf.Replace(",6", "");
92
txtselected.Text = hiddennooffields.Value;
txtnoseat.Text = "";
txtnoseat.Text = noofseat.ToString();
countedseats.Value = noofseat.ToString();
double price;
price = Convert.ToDouble(Request.QueryString["jrate"].ToString());
price = noofseat * price;
txttotal.Text = price.ToString();
totalprice.Value = price.ToString();
removeComma();
}
}
protected void chkseat7_CheckedChanged(object sender, EventArgs e)
{
if (chkseat7.Checked == true)
{
noofseat = noofseat + 1;
hiddennooffields.Value = hiddennooffields.Value + "," + "7";
txtselected.Text = hiddennooffields.Value;
txtnoseat.Text = "";
txtnoseat.Text = noofseat.ToString();
countedseats.Value = noofseat.ToString();
double price;
price = Convert.ToDouble(Request.QueryString["jrate"].ToString());
price = noofseat * price;
txttotal.Text = price.ToString();
totalprice.Value = price.ToString();
removeComma();
}
else
{
noofseat = noofseat - 1;
string hdf = hiddennooffields.Value.ToString();
hiddennooffields.Value = hdf.Replace(",7", "");
txtselected.Text = hiddennooffields.Value;
txtnoseat.Text = "";
txtnoseat.Text = noofseat.ToString();
countedseats.Value = noofseat.ToString();
double price;
price = Convert.ToDouble(Request.QueryString["jrate"].ToString());
price = noofseat * price;
txttotal.Text = price.ToString();
totalprice.Value = price.ToString();
removeComma();
}
}
93
protected void chkseat8_CheckedChanged(object sender, EventArgs e)
{
if (chkseat8.Checked == true)
{
noofseat = noofseat + 1;
hiddennooffields.Value = hiddennooffields.Value + "," + "8";
txtselected.Text = hiddennooffields.Value;
txtnoseat.Text = "";
txtnoseat.Text = noofseat.ToString();
countedseats.Value = noofseat.ToString();
double price;
price = Convert.ToDouble(Request.QueryString["jrate"].ToString());
price = noofseat * price;
txttotal.Text = price.ToString();
totalprice.Value = price.ToString();
removeComma();
}
else
{
noofseat = noofseat - 1;
string hdf = hiddennooffields.Value.ToString();
hiddennooffields.Value = hdf.Replace(",8", "");
txtselected.Text = hiddennooffields.Value;
txtnoseat.Text = "";
txtnoseat.Text = noofseat.ToString();
countedseats.Value = noofseat.ToString();
double price;
price = Convert.ToDouble(Request.QueryString["jrate"].ToString());
price = noofseat * price;
txttotal.Text = price.ToString();
totalprice.Value = price.ToString();
removeComma();
}
}
protected void chkseat9_CheckedChanged(object sender, EventArgs e)
{
if (chkseat9.Checked == true)
{
noofseat = noofseat + 1;
hiddennooffields.Value = hiddennooffields.Value + "," + "9";
txtselected.Text = hiddennooffields.Value;
txtnoseat.Text = "";
txtnoseat.Text = noofseat.ToString();
countedseats.Value = noofseat.ToString();
double price;
price = Convert.ToDouble(Request.QueryString["jrate"].ToString());
94
price = noofseat * price;
txttotal.Text = price.ToString();
totalprice.Value = price.ToString();
removeComma();
}
else
{
noofseat = noofseat - 1;
string hdf = hiddennooffields.Value.ToString();
hiddennooffields.Value = hdf.Replace(",9", "");
txtselected.Text = hiddennooffields.Value;
txtnoseat.Text = "";
txtnoseat.Text = noofseat.ToString();
countedseats.Value = noofseat.ToString();
double price;
price = Convert.ToDouble(Request.QueryString["jrate"].ToString());
price = noofseat * price;
txttotal.Text = price.ToString();
totalprice.Value = price.ToString();
removeComma();
}
}
protected void chkseat10_CheckedChanged(object sender, EventArgs e)
{
if (chkseat10.Checked == true)
{
noofseat = noofseat + 1;
hiddennooffields.Value = hiddennooffields.Value + "," + "10";
txtselected.Text = hiddennooffields.Value;
txtnoseat.Text = "";
txtnoseat.Text = noofseat.ToString();
countedseats.Value = noofseat.ToString();
double price;
price = Convert.ToDouble(Request.QueryString["jrate"].ToString());
price = noofseat * price;
txttotal.Text = price.ToString();
totalprice.Value = price.ToString();
removeComma();
}
else
{
noofseat = noofseat - 1;
string hdf = hiddennooffields.Value.ToString();
hiddennooffields.Value = hdf.Replace(",10", "");
txtselected.Text = hiddennooffields.Value;
txtnoseat.Text = "";
95
txtnoseat.Text = noofseat.ToString();
countedseats.Value = noofseat.ToString();
double price;
price = Convert.ToDouble(Request.QueryString["jrate"].ToString());
price = noofseat * price;
txttotal.Text = price.ToString();
totalprice.Value = price.ToString();
removeComma();
}
}
protected void chkseat11_CheckedChanged(object sender, EventArgs e)
{
if (chkseat11.Checked == true)
{
noofseat = noofseat + 1;
hiddennooffields.Value = hiddennooffields.Value + "," + "11";
txtselected.Text = hiddennooffields.Value;
txtnoseat.Text = "";
txtnoseat.Text = noofseat.ToString();
countedseats.Value = noofseat.ToString();
double price;
price = Convert.ToDouble(Request.QueryString["jrate"].ToString());
price = noofseat * price;
txttotal.Text = price.ToString();
totalprice.Value = price.ToString();
removeComma();
}
else
{
noofseat = noofseat - 1;
string hdf = hiddennooffields.Value.ToString();
hiddennooffields.Value = hdf.Replace(",11", "");
txtselected.Text = hiddennooffields.Value;
txtnoseat.Text = "";
txtnoseat.Text = noofseat.ToString();
countedseats.Value = noofseat.ToString();
double price;
price = Convert.ToDouble(Request.QueryString["jrate"].ToString());
price = noofseat * price;
txttotal.Text = price.ToString();
totalprice.Value = price.ToString();
removeComma();
}
}
protected void chkseat12_CheckedChanged(object sender, EventArgs e)
{
96
if (chkseat12.Checked == true)
{
noofseat = noofseat + 1;
hiddennooffields.Value = hiddennooffields.Value + "," + "12";
txtselected.Text = hiddennooffields.Value;
txtnoseat.Text = "";
txtnoseat.Text = noofseat.ToString();
countedseats.Value = noofseat.ToString();
double price;
price = Convert.ToDouble(Request.QueryString["jrate"].ToString());
price = noofseat * price;
txttotal.Text = price.ToString();
totalprice.Value = price.ToString();
removeComma();
}
else
{
noofseat = noofseat - 1;
string hdf = hiddennooffields.Value.ToString();
hiddennooffields.Value = hdf.Replace(",12", "");
txtselected.Text = hiddennooffields.Value;
txtnoseat.Text = "";
txtnoseat.Text = noofseat.ToString();
countedseats.Value = noofseat.ToString();
double price;
price = Convert.ToDouble(Request.QueryString["jrate"].ToString());
price = noofseat * price;
txttotal.Text = price.ToString();
totalprice.Value = price.ToString();
removeComma();
}
}
protected void chkseat13_CheckedChanged(object sender, EventArgs e)
{
if (chkseat13.Checked == true)
{
noofseat = noofseat + 1;
hiddennooffields.Value = hiddennooffields.Value + "," + "13";
txtselected.Text = hiddennooffields.Value;
txtnoseat.Text = "";
txtnoseat.Text = noofseat.ToString();
countedseats.Value = noofseat.ToString();
double price;
price = Convert.ToDouble(Request.QueryString["jrate"].ToString());
price = noofseat * price;
txttotal.Text = price.ToString();
97
totalprice.Value = price.ToString();
removeComma();
}
else
{
noofseat = noofseat - 1;
string hdf = hiddennooffields.Value.ToString();
hiddennooffields.Value = hdf.Replace(",13", "");
txtselected.Text = hiddennooffields.Value;
txtnoseat.Text = "";
txtnoseat.Text = noofseat.ToString();
countedseats.Value = noofseat.ToString();
double price;
price = Convert.ToDouble(Request.QueryString["jrate"].ToString());
price = noofseat * price;
txttotal.Text = price.ToString();
totalprice.Value = price.ToString();
removeComma();
}
}
protected void chkseat14_CheckedChanged(object sender, EventArgs e)
{
if (chkseat14.Checked == true)
{
noofseat = noofseat + 1;
hiddennooffields.Value = hiddennooffields.Value + "," + "14";
txtselected.Text = hiddennooffields.Value;
txtnoseat.Text = "";
txtnoseat.Text = noofseat.ToString();
countedseats.Value = noofseat.ToString();
double price;
price = Convert.ToDouble(Request.QueryString["jrate"].ToString());
price = noofseat * price;
txttotal.Text = price.ToString();
totalprice.Value = price.ToString();
removeComma();
}
else
{
noofseat = noofseat - 1;
string hdf = hiddennooffields.Value.ToString();
hiddennooffields.Value = hdf.Replace(",14", "");
txtselected.Text = hiddennooffields.Value;
txtnoseat.Text = "";
txtnoseat.Text = noofseat.ToString();
countedseats.Value = noofseat.ToString();
98
double price;
price = Convert.ToDouble(Request.QueryString["jrate"].ToString());
price = noofseat * price;
txttotal.Text = price.ToString();
totalprice.Value = price.ToString();
removeComma();
}
}
protected void chkseat15_CheckedChanged(object sender, EventArgs e)
{
if (chkseat15.Checked == true)
{
noofseat = noofseat + 1;
hiddennooffields.Value = hiddennooffields.Value + "," + "15";
txtselected.Text = hiddennooffields.Value;
txtnoseat.Text = "";
txtnoseat.Text = noofseat.ToString();
countedseats.Value = noofseat.ToString();
double price;
price = Convert.ToDouble(Request.QueryString["jrate"].ToString());
price = noofseat * price;
txttotal.Text = price.ToString();
totalprice.Value = price.ToString();
removeComma();
}
else
{
noofseat = noofseat - 1;
string hdf = hiddennooffields.Value.ToString();
hiddennooffields.Value = hdf.Replace(",15", "");
txtselected.Text = hiddennooffields.Value;
txtnoseat.Text = "";
txtnoseat.Text = noofseat.ToString();
countedseats.Value = noofseat.ToString();
double price;
price = Convert.ToDouble(Request.QueryString["jrate"].ToString());
price = noofseat * price;
txttotal.Text = price.ToString();
totalprice.Value = price.ToString();
removeComma();
}
}
protected void chkseat16_CheckedChanged(object sender, EventArgs e)
{
if (chkseat16.Checked == true)
{
99
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel
Online Tours and travel

Mais conteúdo relacionado

Mais procurados

Online Cab Booking System Final Report
Online Cab Booking System Final ReportOnline Cab Booking System Final Report
Online Cab Booking System Final ReportPiyushPatil73
 
Tourism and travelling management System
Tourism and travelling management SystemTourism and travelling management System
Tourism and travelling management SystemMoeenuddin Patel
 
Web based tourism system
Web based tourism system Web based tourism system
Web based tourism system Shivangi Singh
 
Online railway reservation system
Online railway reservation systemOnline railway reservation system
Online railway reservation systemPIYUSH Dubey
 
Travel website.pptx
Travel website.pptxTravel website.pptx
Travel website.pptxrishabdey8
 
Airline reservation system documentation
Airline reservation system documentationAirline reservation system documentation
Airline reservation system documentationSurya Indira
 
Travel and Tour Advisory
Travel and Tour AdvisoryTravel and Tour Advisory
Travel and Tour AdvisoryUday Raj Karki
 
Project report RAILWAY TICKET RESERVATION SYSTEM SAD
Project report RAILWAY TICKET RESERVATION SYSTEM SADProject report RAILWAY TICKET RESERVATION SYSTEM SAD
Project report RAILWAY TICKET RESERVATION SYSTEM SADNitesh Singh
 
Tour Management System
Tour Management SystemTour Management System
Tour Management SystemAlbertDavid18
 
Synopsis gor online Tourism.
Synopsis gor online Tourism.Synopsis gor online Tourism.
Synopsis gor online Tourism.Janu Ansari
 
Online Bus Ticket Reservation System
Online Bus Ticket Reservation SystemOnline Bus Ticket Reservation System
Online Bus Ticket Reservation SystemTuvshinbayar Davaa
 
Cab booking system india
Cab booking system indiaCab booking system india
Cab booking system indiaCustom Soft
 
Usr tour and tra vel mini project report
Usr tour and tra vel mini project reportUsr tour and tra vel mini project report
Usr tour and tra vel mini project reportRavindra Chaudhary
 
Tourist management system using .NET
Tourist management system using .NETTourist management system using .NET
Tourist management system using .NETPrankit Mishra
 
Railway Reservation System - Software Engineering
Railway Reservation System - Software EngineeringRailway Reservation System - Software Engineering
Railway Reservation System - Software EngineeringLalit Pal
 
Bus management system
Bus management systemBus management system
Bus management systemShamim Ahmed
 
Hotel management synopsis
Hotel management synopsisHotel management synopsis
Hotel management synopsisRahulraj Nirala
 
Documentation of railway reservation system
Documentation of railway reservation systemDocumentation of railway reservation system
Documentation of railway reservation systemSandip Murari
 

Mais procurados (20)

Online Cab Booking System Final Report
Online Cab Booking System Final ReportOnline Cab Booking System Final Report
Online Cab Booking System Final Report
 
Tourism and travelling management System
Tourism and travelling management SystemTourism and travelling management System
Tourism and travelling management System
 
Web based tourism system
Web based tourism system Web based tourism system
Web based tourism system
 
Online railway reservation system
Online railway reservation systemOnline railway reservation system
Online railway reservation system
 
Travel website.pptx
Travel website.pptxTravel website.pptx
Travel website.pptx
 
Airline reservation system documentation
Airline reservation system documentationAirline reservation system documentation
Airline reservation system documentation
 
Travel and Tour Advisory
Travel and Tour AdvisoryTravel and Tour Advisory
Travel and Tour Advisory
 
Project report RAILWAY TICKET RESERVATION SYSTEM SAD
Project report RAILWAY TICKET RESERVATION SYSTEM SADProject report RAILWAY TICKET RESERVATION SYSTEM SAD
Project report RAILWAY TICKET RESERVATION SYSTEM SAD
 
ONLINE BUS BOOKING SYSTEM
ONLINE BUS BOOKING SYSTEMONLINE BUS BOOKING SYSTEM
ONLINE BUS BOOKING SYSTEM
 
Tour Management System
Tour Management SystemTour Management System
Tour Management System
 
Synopsis gor online Tourism.
Synopsis gor online Tourism.Synopsis gor online Tourism.
Synopsis gor online Tourism.
 
Online Bus Ticket Reservation System
Online Bus Ticket Reservation SystemOnline Bus Ticket Reservation System
Online Bus Ticket Reservation System
 
Cab booking system india
Cab booking system indiaCab booking system india
Cab booking system india
 
Usr tour and tra vel mini project report
Usr tour and tra vel mini project reportUsr tour and tra vel mini project report
Usr tour and tra vel mini project report
 
Online bus ticket booking
Online bus ticket bookingOnline bus ticket booking
Online bus ticket booking
 
Tourist management system using .NET
Tourist management system using .NETTourist management system using .NET
Tourist management system using .NET
 
Railway Reservation System - Software Engineering
Railway Reservation System - Software EngineeringRailway Reservation System - Software Engineering
Railway Reservation System - Software Engineering
 
Bus management system
Bus management systemBus management system
Bus management system
 
Hotel management synopsis
Hotel management synopsisHotel management synopsis
Hotel management synopsis
 
Documentation of railway reservation system
Documentation of railway reservation systemDocumentation of railway reservation system
Documentation of railway reservation system
 

Destaque (6)

Automated Bus Ticket Booking System
Automated Bus Ticket Booking System Automated Bus Ticket Booking System
Automated Bus Ticket Booking System
 
Himachal tourism hptdc ltd summer internship project report
Himachal tourism hptdc ltd summer internship project reportHimachal tourism hptdc ltd summer internship project report
Himachal tourism hptdc ltd summer internship project report
 
Ppt
PptPpt
Ppt
 
Hostel management
Hostel managementHostel management
Hostel management
 
Study tour report
Study tour reportStudy tour report
Study tour report
 
Bus Booking Management System
Bus Booking Management SystemBus Booking Management System
Bus Booking Management System
 

Semelhante a Online Tours and travel

Etaxi Documentation
Etaxi DocumentationEtaxi Documentation
Etaxi DocumentationM.Saber
 
Online vehicle renting website
Online vehicle renting websiteOnline vehicle renting website
Online vehicle renting websiteSomendra Singh
 
Hostel Mess Attendance Management System using Wifi
Hostel Mess Attendance Management System using WifiHostel Mess Attendance Management System using Wifi
Hostel Mess Attendance Management System using WifiIRJET Journal
 
Online-Voting-System.doc
Online-Voting-System.docOnline-Voting-System.doc
Online-Voting-System.docShangaviS2
 
Project Report Format College Project
 Project Report Format College Project Project Report Format College Project
Project Report Format College ProjectAshu
 
Bank Management System.docx
Bank Management System.docxBank Management System.docx
Bank Management System.docxNikhil Patil
 
FINAL documentation (Rupai Bhadra)
FINAL documentation (Rupai Bhadra)FINAL documentation (Rupai Bhadra)
FINAL documentation (Rupai Bhadra)Rupai Bhadra
 
TY CS Black book Construction - Dinesh48
TY CS Black book Construction - Dinesh48TY CS Black book Construction - Dinesh48
TY CS Black book Construction - Dinesh48Dinesh Jogdand
 
IP final project
IP final project IP final project
IP final project SantySS
 
Implementation of Public Transport Sytem with Journey Planner
Implementation of Public Transport Sytem with Journey PlannerImplementation of Public Transport Sytem with Journey Planner
Implementation of Public Transport Sytem with Journey PlannerIRJET Journal
 
AU-Project-Report-Fulltext-132299.PDF
AU-Project-Report-Fulltext-132299.PDFAU-Project-Report-Fulltext-132299.PDF
AU-Project-Report-Fulltext-132299.PDFCCSSenatorAbogadoAj
 
Online Crime Management System.ppt.pptx
Online Crime Management System.ppt.pptxOnline Crime Management System.ppt.pptx
Online Crime Management System.ppt.pptxAshutoshmahale3
 

Semelhante a Online Tours and travel (20)

Etaxi Documentation
Etaxi DocumentationEtaxi Documentation
Etaxi Documentation
 
Project synopsis.
Project synopsis.Project synopsis.
Project synopsis.
 
Online vehicle renting website
Online vehicle renting websiteOnline vehicle renting website
Online vehicle renting website
 
Hostel Mess Attendance Management System using Wifi
Hostel Mess Attendance Management System using WifiHostel Mess Attendance Management System using Wifi
Hostel Mess Attendance Management System using Wifi
 
bus reservation.pptx
bus reservation.pptxbus reservation.pptx
bus reservation.pptx
 
Court Case Management System
Court Case Management SystemCourt Case Management System
Court Case Management System
 
Online-Voting-System.doc
Online-Voting-System.docOnline-Voting-System.doc
Online-Voting-System.doc
 
Project Report Format College Project
 Project Report Format College Project Project Report Format College Project
Project Report Format College Project
 
Bank Management System.docx
Bank Management System.docxBank Management System.docx
Bank Management System.docx
 
FINAL documentation (Rupai Bhadra)
FINAL documentation (Rupai Bhadra)FINAL documentation (Rupai Bhadra)
FINAL documentation (Rupai Bhadra)
 
Billing project
Billing projectBilling project
Billing project
 
TY CS Black book Construction - Dinesh48
TY CS Black book Construction - Dinesh48TY CS Black book Construction - Dinesh48
TY CS Black book Construction - Dinesh48
 
IP final project
IP final project IP final project
IP final project
 
Implementation of Public Transport Sytem with Journey Planner
Implementation of Public Transport Sytem with Journey PlannerImplementation of Public Transport Sytem with Journey Planner
Implementation of Public Transport Sytem with Journey Planner
 
Project report
Project report Project report
Project report
 
AU-Project-Report-Fulltext-132299.PDF
AU-Project-Report-Fulltext-132299.PDFAU-Project-Report-Fulltext-132299.PDF
AU-Project-Report-Fulltext-132299.PDF
 
Black book converted
Black book convertedBlack book converted
Black book converted
 
Black book converted
Black book convertedBlack book converted
Black book converted
 
Online Crime Management System.ppt.pptx
Online Crime Management System.ppt.pptxOnline Crime Management System.ppt.pptx
Online Crime Management System.ppt.pptx
 
Car Rental System
Car Rental SystemCar Rental System
Car Rental System
 

Último

Hire 💕 8617697112 Champawat Call Girls Service Call Girls Agency
Hire 💕 8617697112 Champawat Call Girls Service Call Girls AgencyHire 💕 8617697112 Champawat Call Girls Service Call Girls Agency
Hire 💕 8617697112 Champawat Call Girls Service Call Girls AgencyNitya salvi
 
best weekend places near delhi where you should visit.pdf
best weekend places near delhi where you should visit.pdfbest weekend places near delhi where you should visit.pdf
best weekend places near delhi where you should visit.pdftour guide
 
9 Days Kenya Ultimate Safari Odyssey with Kibera Holiday Safaris
9 Days Kenya Ultimate Safari Odyssey with Kibera Holiday Safaris9 Days Kenya Ultimate Safari Odyssey with Kibera Holiday Safaris
9 Days Kenya Ultimate Safari Odyssey with Kibera Holiday SafarisKibera Holiday Safaris Safaris
 
DARK TRAVEL AGENCY presented by Khuda Bux
DARK TRAVEL AGENCY presented by Khuda BuxDARK TRAVEL AGENCY presented by Khuda Bux
DARK TRAVEL AGENCY presented by Khuda BuxBeEducate
 
Study Consultants in Lahore || 📞03094429236
Study Consultants in Lahore || 📞03094429236Study Consultants in Lahore || 📞03094429236
Study Consultants in Lahore || 📞03094429236Sherazi Tours
 
char Dham yatra, Uttarakhand tourism.pptx
char Dham yatra, Uttarakhand tourism.pptxchar Dham yatra, Uttarakhand tourism.pptx
char Dham yatra, Uttarakhand tourism.pptxpalakdigital7
 
08448380779 Call Girls In Shahdara Women Seeking Men
08448380779 Call Girls In Shahdara Women Seeking Men08448380779 Call Girls In Shahdara Women Seeking Men
08448380779 Call Girls In Shahdara Women Seeking MenDelhi Call girls
 
BERMUDA Triangle the mystery of life.pptx
BERMUDA Triangle the mystery of life.pptxBERMUDA Triangle the mystery of life.pptx
BERMUDA Triangle the mystery of life.pptxseri bangash
 
🔥HOT🔥📲9602870969🔥Prostitute Service in Udaipur Call Girls in City Palace Lake...
🔥HOT🔥📲9602870969🔥Prostitute Service in Udaipur Call Girls in City Palace Lake...🔥HOT🔥📲9602870969🔥Prostitute Service in Udaipur Call Girls in City Palace Lake...
🔥HOT🔥📲9602870969🔥Prostitute Service in Udaipur Call Girls in City Palace Lake...Apsara Of India
 
08448380779 Call Girls In Chirag Enclave Women Seeking Men
08448380779 Call Girls In Chirag Enclave Women Seeking Men08448380779 Call Girls In Chirag Enclave Women Seeking Men
08448380779 Call Girls In Chirag Enclave Women Seeking MenDelhi Call girls
 
Genesis 1:6 || Meditate the Scripture daily verse by verse
Genesis 1:6  ||  Meditate the Scripture daily verse by verseGenesis 1:6  ||  Meditate the Scripture daily verse by verse
Genesis 1:6 || Meditate the Scripture daily verse by versemaricelcanoynuay
 
Top 10 Traditional Indian Handicrafts.pptx
Top 10 Traditional Indian Handicrafts.pptxTop 10 Traditional Indian Handicrafts.pptx
Top 10 Traditional Indian Handicrafts.pptxdishha99
 
08448380779 Call Girls In Bhikaji Cama Palace Women Seeking Men
08448380779 Call Girls In Bhikaji Cama Palace Women Seeking Men08448380779 Call Girls In Bhikaji Cama Palace Women Seeking Men
08448380779 Call Girls In Bhikaji Cama Palace Women Seeking MenDelhi Call girls
 
💕📲09602870969💓Girl Escort Services Udaipur Call Girls in Chittorgarh Haldighati
💕📲09602870969💓Girl Escort Services Udaipur Call Girls in Chittorgarh Haldighati💕📲09602870969💓Girl Escort Services Udaipur Call Girls in Chittorgarh Haldighati
💕📲09602870969💓Girl Escort Services Udaipur Call Girls in Chittorgarh HaldighatiApsara Of India
 
Night 7k Call Girls Noida Sector 93 Escorts Call Me: 8448380779
Night 7k Call Girls Noida Sector 93 Escorts Call Me: 8448380779Night 7k Call Girls Noida Sector 93 Escorts Call Me: 8448380779
Night 7k Call Girls Noida Sector 93 Escorts Call Me: 8448380779Delhi Call girls
 
08448380779 Call Girls In Chhattarpur Women Seeking Men
08448380779 Call Girls In Chhattarpur Women Seeking Men08448380779 Call Girls In Chhattarpur Women Seeking Men
08448380779 Call Girls In Chhattarpur Women Seeking MenDelhi Call girls
 

Último (20)

Hire 💕 8617697112 Champawat Call Girls Service Call Girls Agency
Hire 💕 8617697112 Champawat Call Girls Service Call Girls AgencyHire 💕 8617697112 Champawat Call Girls Service Call Girls Agency
Hire 💕 8617697112 Champawat Call Girls Service Call Girls Agency
 
best weekend places near delhi where you should visit.pdf
best weekend places near delhi where you should visit.pdfbest weekend places near delhi where you should visit.pdf
best weekend places near delhi where you should visit.pdf
 
9 Days Kenya Ultimate Safari Odyssey with Kibera Holiday Safaris
9 Days Kenya Ultimate Safari Odyssey with Kibera Holiday Safaris9 Days Kenya Ultimate Safari Odyssey with Kibera Holiday Safaris
9 Days Kenya Ultimate Safari Odyssey with Kibera Holiday Safaris
 
Call Girls Service !! Indirapuram!! @9999965857 Delhi 🫦 No Advance VVVIP 🍎 S...
Call Girls Service !! Indirapuram!! @9999965857 Delhi 🫦 No Advance  VVVIP 🍎 S...Call Girls Service !! Indirapuram!! @9999965857 Delhi 🫦 No Advance  VVVIP 🍎 S...
Call Girls Service !! Indirapuram!! @9999965857 Delhi 🫦 No Advance VVVIP 🍎 S...
 
DARK TRAVEL AGENCY presented by Khuda Bux
DARK TRAVEL AGENCY presented by Khuda BuxDARK TRAVEL AGENCY presented by Khuda Bux
DARK TRAVEL AGENCY presented by Khuda Bux
 
Study Consultants in Lahore || 📞03094429236
Study Consultants in Lahore || 📞03094429236Study Consultants in Lahore || 📞03094429236
Study Consultants in Lahore || 📞03094429236
 
char Dham yatra, Uttarakhand tourism.pptx
char Dham yatra, Uttarakhand tourism.pptxchar Dham yatra, Uttarakhand tourism.pptx
char Dham yatra, Uttarakhand tourism.pptx
 
08448380779 Call Girls In Shahdara Women Seeking Men
08448380779 Call Girls In Shahdara Women Seeking Men08448380779 Call Girls In Shahdara Women Seeking Men
08448380779 Call Girls In Shahdara Women Seeking Men
 
Call Girls In Munirka 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
Call Girls In Munirka 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICECall Girls In Munirka 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
Call Girls In Munirka 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
 
BERMUDA Triangle the mystery of life.pptx
BERMUDA Triangle the mystery of life.pptxBERMUDA Triangle the mystery of life.pptx
BERMUDA Triangle the mystery of life.pptx
 
Rohini Sector 18 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 18 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 18 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 18 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
Call Girls 🫤 Connaught Place ➡️ 9999965857 ➡️ Delhi 🫦 Russian Escorts FULL ...
Call Girls 🫤 Connaught Place ➡️ 9999965857  ➡️ Delhi 🫦  Russian Escorts FULL ...Call Girls 🫤 Connaught Place ➡️ 9999965857  ➡️ Delhi 🫦  Russian Escorts FULL ...
Call Girls 🫤 Connaught Place ➡️ 9999965857 ➡️ Delhi 🫦 Russian Escorts FULL ...
 
🔥HOT🔥📲9602870969🔥Prostitute Service in Udaipur Call Girls in City Palace Lake...
🔥HOT🔥📲9602870969🔥Prostitute Service in Udaipur Call Girls in City Palace Lake...🔥HOT🔥📲9602870969🔥Prostitute Service in Udaipur Call Girls in City Palace Lake...
🔥HOT🔥📲9602870969🔥Prostitute Service in Udaipur Call Girls in City Palace Lake...
 
08448380779 Call Girls In Chirag Enclave Women Seeking Men
08448380779 Call Girls In Chirag Enclave Women Seeking Men08448380779 Call Girls In Chirag Enclave Women Seeking Men
08448380779 Call Girls In Chirag Enclave Women Seeking Men
 
Genesis 1:6 || Meditate the Scripture daily verse by verse
Genesis 1:6  ||  Meditate the Scripture daily verse by verseGenesis 1:6  ||  Meditate the Scripture daily verse by verse
Genesis 1:6 || Meditate the Scripture daily verse by verse
 
Top 10 Traditional Indian Handicrafts.pptx
Top 10 Traditional Indian Handicrafts.pptxTop 10 Traditional Indian Handicrafts.pptx
Top 10 Traditional Indian Handicrafts.pptx
 
08448380779 Call Girls In Bhikaji Cama Palace Women Seeking Men
08448380779 Call Girls In Bhikaji Cama Palace Women Seeking Men08448380779 Call Girls In Bhikaji Cama Palace Women Seeking Men
08448380779 Call Girls In Bhikaji Cama Palace Women Seeking Men
 
💕📲09602870969💓Girl Escort Services Udaipur Call Girls in Chittorgarh Haldighati
💕📲09602870969💓Girl Escort Services Udaipur Call Girls in Chittorgarh Haldighati💕📲09602870969💓Girl Escort Services Udaipur Call Girls in Chittorgarh Haldighati
💕📲09602870969💓Girl Escort Services Udaipur Call Girls in Chittorgarh Haldighati
 
Night 7k Call Girls Noida Sector 93 Escorts Call Me: 8448380779
Night 7k Call Girls Noida Sector 93 Escorts Call Me: 8448380779Night 7k Call Girls Noida Sector 93 Escorts Call Me: 8448380779
Night 7k Call Girls Noida Sector 93 Escorts Call Me: 8448380779
 
08448380779 Call Girls In Chhattarpur Women Seeking Men
08448380779 Call Girls In Chhattarpur Women Seeking Men08448380779 Call Girls In Chhattarpur Women Seeking Men
08448380779 Call Girls In Chhattarpur Women Seeking Men
 

Online Tours and travel

  • 1. PROJECT REPORT ON “ONLINE TOURS & TRAVELS” SUBMITTED TO UNIVERSITY OF MUMBAI SUBMITTED BY MR.AMIT AJIT PATIL ROLL NO: 172 GUIDED BY: PROF.SHILPA RODRIGUES T.Y.B.SC. (INFORMATION TECHNOLOGY) FOR ACADEMIC YEAR 2013-2014 LATE SHRI VISHNU WAMAN THAKUR CHARITABLE TRUST’S BHASKAR WAMAN THAKUR COLLEGE OF SCIENCE, YASHWANT KESHAV PATIL COLLEGE OF COMMERCE, VIDYA DAYANAND PATIL COLLEGE OF ARTS. VIRAR (W). I
  • 2. DEPARTMENT OF INFORMATION TECHNOLOGY Late Shri Vishnu Waman Thakur Charitable Trust’s Bhaskar Waman Thakur College of Science, Yashwant Keshav Patil College of Commerce, Vidya Dayanand Patil College of Arts. Virar (W). PROJECT ON SUBMITED BY AMIT AJIT PATIL T.Y.B.Sc. (Information Technology) UNIVERSITY OF MUMBAI Year [2013-2014] II
  • 3. III
  • 4. IV
  • 5. Mob: 9892867282 To whomsoever it may concern This is to certify that project entitled “Online Tours and Travels” undertaken at Prafulla Tours and Travels Andheri (West). Completed by Mr. Amit Ajit Patil. The student of VIVA College, Virar as the partial fulfillment of B.Sc.I.T (Information Technology) degree examination project. It is further certified that he has completed all the required phase of the project given to his in the specified time line. This Certificate is being issued to him own request for certificate purpose only. Authorized Signature V
  • 6. ACKNOWLEDGEMENT I am very grateful to our Principal for providing us with an environment to complete my project successfully. I am deeply indebted to Prof. Sampada Deshmukh Head of I.T Department, VIVA College who modelled us both technically and morally for achieving greater success in life. I express our sincere thanks to all our lecturers, for their constant encouragement and support throughout our course, especially for the useful suggestions given during the course of the project period. I am grateful to my internal guide Prof. Shilpa Rodrigues Lecturer, for being instrumental in the completion of our project with her complete guidance. I would like to thank Mr. Prafulla Parab (Owner-Prafulla Travels) for his unwavering support and guidance during the entire course of this project work. I also thank all the staff members of our college and technicians for their help in making this project a successful one. Finally, we take this opportunity to extend our deep appreciation to our family and friends, for all that they meant to me during the crucial times of the completion of my project. Mr. Amit Ajit Patil VI
  • 7. INDEX Sr.no Topic Page No. 1 Introduction of project 1 2 Organization Overview 3 2.1 Current System & limitation 5 2.2 Scope of Proposed System and its Advantage 7 3 Planning Phase 8 3.1 Feasibility Study 9 3.2 Fact Finding Techniques 11 3.3 Milestones 14 3.4 Stack holders 15 4 Front-end and Back-end 17 5 Hardware and Software Requirements 19 6 System Design and Development 22 6.1 Gantt Chart 23 6.2 E-R Diagram 24 6.3 Event Table 25 6.4 UML Diagram 6.4.1 Use Case Diagram 26 6.4.2 Class Diagram 27 6.4.3 Sequence Diagram 28 6.4.4 Activity Diagram 31 6.4.5 State Diagram 32 6.4.6 Menu Tree 33 6.4.7 CRUD Table 34 7 Tables with Attribute and Constraints 35 8 Screen Layout with Test Data and Source Code 41 9 Validation 137 10 Test Cases 143 11 Report 146 12 Future Enhancement 151 13 Conclusion 153 14 Bibliography and Preferences 155 VII
  • 9. Online Tours & Travels I have developed this system using ASP.NET as Front End and MS SQL Server 2008 R2 at Back End project. This System has to maintain the records of:  CUSTOMER INFORMATION.  AGENT INFORMATION.  DRIVER INFORMATION.  BOOKING INFORMATION.  SCHEDULE INFORMATION.  PAYMENT INFORMATION.  ROUTE INFORMATION.  BUS/CAR INFORMATION. I have provided some useful reports, which are useful in analyzing the efficiency of the system and performance of company. 2
  • 10. Current System & limitation Scope of Proposed System and its Advantage Organization Overview 3
  • 11. Company Profile Company Name: - Prafulla Travels (Cab Service Provider) Location: - 7 Bunglow, Varsova, Andheri (W), Mumbai Employees: - 45 Prafulla Travels Tours Travels Company is owned by Mr. Prafulla Parab. This organization is established in 1995 and today they are heaving a very successful market .Company provide a services in Tourism industry from last one decade and they have a very satisfied customer’s .The Company heaving its Head office at Andheri. The company contains 19 Buses. They are also providing car facilities and they have 15 cars. And company also willing to expand their business. Intelligent Transportation Arranger is Transport Management Information cum Automation System this project is aimed at automation of a Travel Agency. Objective of the project is to develop customize software package for Travel Agencies. The system also provides a comprehensive mechanism of transport maintenance for any travel agency. Trans-Manager is designed to help wide range of travel agencies come together and provide service to the customer. This System comprehensive functionality helps the agencies expand their horizons in the field of providing transport maintenance to the management. The Intelligent Transportation Arranger deals with the automation of the Transport information System. This project explains about the transporters how exactly the maintenance of the transport system works, whether the transport may be of Passengers or Goods. The System clearly deals with all the information of the Transporters; firstly they define the transportation type and their name. Next it deals with the operation, how exactly the system works and who are all involved in the system. 4
  • 12. Current System The current System of a company is very ancient and need to be replace as companies business is expanding. One of the biggest disadvantages of the current system is that lacking of online booking system each time a agent need to call in office to check the available seats and then he can booked it. Even he booked the seats he needs to submit that amount in office within one month. All the existing system is traditional and lack of use of technology, therefore the process is very time consuming and lengthy as paper work is there. This was creating problem in maintain data record at the end like profit and loss, total expansion etc. 5
  • 13. Limitation of Current System 1) Managing and keeping records of all customer, Buses are not included and they keep some record manually. 2) Business is not on the web which was biggest Disadvantages. 3) Customer can book the car or bus by visiting to the office or to the nearest branch which was a very tedious job. 4) Not good communication between the different branches so there is lacking of coordination between them. 5) Bus record is not maintained properly. 6) There exist communication gap between staff, customer, agent and management. 6
  • 14. Proposed System & its advantages 1) Help in reducing the file work. 2) Huge time will be saved. 3) Database is maintained so properly so that managing and keeping record is very easy. 4) System is fully integrated. 5) Quicker access of information to the administrator. 6) All types of information is available at anywhere at any time as System now is online. 7) As it is now on web it surely increase the growth of the business and profit will automatically increase. 8) Ultimately customer is center point in this system. 9) Booking system is very much effective and maintain only one data so there is no duplication of data. 7
  • 15. Feasibility Study Fact Finding Techniques Milestones Stack holders Planning Phase 8
  • 16. Feasibility Study The very first phase in any system developing life cycle is preliminary investigation. In the preliminary study we examine the project feasibility. This project has been tested in the following areas of feasibility  Operation Feasibility  Technical Feasibility  Economic Feasibility Operational Feasibility: It was decided that the proposed system could be created as a web based system that be operated by all the clients.  The system is designed in such a way that it is easy to operate.  The system does not involve any complex operations. It handles only simple data oriented functions.  It is aimed at giving an easy way to generate reports.  The functional accessibility is also structured in such a way it won’t take much time for anyone to get accustomed with the system.  Amount of knowledge and expertise required for being able to use this system is not much more than what it requires to operate a computer system.  The Client must have only the basic knowledge of web browsers. Hence there is no need of any special person with any particular qualification or expertise in any filed to use the MY-WEB-TRENDS system. 9
  • 17. Technical Feasibility: It was decided that the MY-WEB-TRENDS system was technically feasible because of the following  The system has very simple structure and easy to understand body.  Also software used to build the system is simple enough in their usage and functionality.  To operate this system only a web browser is needed. The system is platform independent and browser independent and supports all kinds of web browsers like Internet Explorer, Mozilla Firefox, etc.  The system can be expanded if so decided.  This system is technically more secure. Economic Feasibility: The Economic Feasibility of the system is mainly concerned with its financial aspects. It determines whether the investment that goes into the implementation of the project is recoverable or not. The Cost Benefit Analysis is a commonly used method in evaluating the effectiveness of the system.  The cost of developing this system currently includes the minimum software cost to develop and run the system. The most of the software used in the system development is freely available on the Web. 10
  • 18. FACT FINDING TECHNIQUES We mainly used three fact finding techniques to find out for ourselves the correct information on basis of which we will built software. There fact finding techniques are extremely important because these are fact on basis of which we can build the software that comprises of a friendly environment to customer to work with. These is the reason why fact finding is an important activity. The techniques which were used by us include:  Interview &Questionnaire  Document Sampling  Work Site Observation Interview & Questionnaire: This is considered as one of the best fact finding technique. This include direct interaction with the customer. It is considered as the best technique, because it is the only way the user can reveal the details & fact about his past, present & expected working, requirements, technologies .These are the information which give us the description of the systems, we have to we have to implement our logic and our own ideas & make this description to turn to reality, to work as module which the user desire. Questionnaire:  Open-Ended Questions  Close-Ended Questions Open-Ended Questions:- Q. How does your current process work? Q. What are the main modules and attributes of your current System? Q. What are limitation of current process? 11
  • 19. Close-Ended Questions:- Q. What is your Organization name? Q. Do the Organization have any branches? Q. At what respected position do your work in your organization? Q. On which platform your work manual report is prepared? Q. Is your current system economically, functionally and technically feasible? Q. How many days it takes to submit my new proposed software? Q. What if my software provides you ease and is less time consuming with more effects? Reviews:- 1) How does your current process work? Ans: All the information about employee are stored in the files similarly the customer details are stored in customer file. 2) What are the main modules and attributes of your current System? Ans: New register details, complaint details, payment, booking and report are the main modules etc. are the attributes. 3) What are limitation of current process? Ans: Functionality it’s a complex procedure, technically it’s difficult, lengthy and time consuming. 4) What is your Organization name? Ans: Prafulla Travels. 5) Do the Organization have any branches? Ans: Yes. 6) At what respected position do your work in your organization? Ans: Employee. 7) On which platform your work manual report is prepared? Ans: MS-Excel, MS-Word. 8) Is your current system economically, functionally and technically feasible? Ans: No. 9) How many days it takes to submit my new proposed software? Ans: 10-15 days. 12
  • 20. 10) What if my software provides you ease and is less time consuming with more effects? Ans: Well and Good. 11) What if the time duration to submit my new proposed project? Ans: within year. Work Site Observation: Through observation of the information about various activities that are carried out during various transactions that take place during the sales & purchase processes. This method is useful to observe how the documents are handled, how the processes are carried out and whether all the specified steps are carried out. Actual procedures are compared with the method actually used. We also study try to find out how these processes can be carried out with help of the new techniques available or there need to alter the current techniques. Documentation Searching: We went through various docs like invoices, orders, quotations etc. to understand the necessary fields to be included in the reports and forms about sales and purchase transactions. 13
  • 21. PHASES DESCRIPTION DURATION/ TIME(Days) 1. Planning In this phase, I planned out what is my project all about and what is organization needs and expectation from this project. 14 Days 2. Requirement In this phase, I identified the requirements of my project which would be best suitable. 20 Days 3. Analysis I Analyzed the whole system and made of note things to be automated. 25 Days 4. Database Design In this phase, I made clear the database tables that would be required & designed them. 19 Days 5. Form Design & Report Design In this phase, I have designed all the project forms & project reports. 18 Days 6. Coding In this phase, I have started my hard coding of my project. 40 Days 7. Test & Implementation After my coding phase is completed I started with testing of my software. I have implemented my software in the organization. 15 Days MILESTONE 14
  • 22. STACK HOLDER Stake Holders are the person who has success in the system. Stake Holders are main source of information. Following are the Stake Holders of the organization: 1) Administrator:- The administrator includes the performance or management of business operations and decision making as well as the efficient organization of people and other resources to direct activities toward common goals and objectives. 2) Agent:- An Agent is one who acts for, or in the place of, another, by authority from him; one entrusted with the business of another. 3) Customer/User:- A customer (sometimes known as a client, buyer, or purchaser) is the recipient of a good, service, product, or idea, obtained from a seller, vendor, or supplier for a monetary or other valuable consideration. Customers are generally categorized into two types:  An intermediate customer or trade customer (more informally: "the trade") who is a dealer that purchases goods for re-sale.  An ultimate customer who does not in turn re-sell the things bought but either passes them to the consumer or actually is the consumer. 15
  • 23. 4) Driver:- The term refers to the person who is in charge of the motor (of the electric car) in the same sense as a railroad engineer is in charge of the engine. 5) Employee:- An employee contributes labor and/or expertise to an endeavor of an employer and is usually hired to perform specific duties which are packaged into a job. 16
  • 25. TECHNOLOGIES Software Environment Development Language Presentation Layer HTML,CSS Front-End ASP.NET Back-End MS SQL SERVER 2008 R2 18
  • 27. HARDWARE AND SOFTWARE REQUIREMENTS Hardware Requirement:  Pentium 4/Due Core & above  128MB RAM (Minimum).  VGA monitor/LED/LCD  Software Requirements:  Operating system: Microsoft Windows 98/2000/XP/Vista/Windows 7.  Platform of development: Visual Studio2010, Adobe Photoshop.  Database: MS SQL SERVER 2008 R2  Web Browser: Windows Internet Explorer 6.0 and above, Mozilla Firefox, etc. 20
  • 28. Background OF Technologies Why we Used ASP.NET Language? ASP.NET is one of the most exciting web development technologies on offer today. Here was a powerful platform with lots of built-in functionality, astonishing performance levels, and one of the best IDEs around: Visual Studio. ASP.NET showed the way for the faster, easier, and more disciplined development of dynamic web sites, and the results were impressive. Some features of ASP.NET are as follows:  ASP.NET lets you use your favorite programming language, or at least one that’s close to it. The .NET Framework currently supports over 40 languages, and many of these may be used to build ASP.NET web sites. The most popular choices are C# and Visual Basic (or VB).  ASP.NET pages are compiled, not interpreted The code is compiled into efficient binary files, which can be run very quickly, again and again, without the overhead involved in re-reading the page each time.  ASP.NET has full access to the functionality of the .NET Framework. Support for XML, web services, database interaction, email, regular expressions, and many other technologies are built right into it.  ASP.NET allows you to separate the server-side code in your pages from the HTML layout.  ASP.NET makes it easy to reuse common User Interface elements in many web forms.  You can get excellent tools that assist in developing ASP.NET web applications. Visual Web Developer 2010 is a free, powerful visual editor that includes features such as code auto completion, code formatting, database integration functionality, a visual HTML editor, debugging, and more. ASP.NET is a fantastic technology that enables you to develop web sites and applications with very little hassle. Developing web applications was never this easy, yet even though it may appear simple, there is real power and depth to this technology that enables it to host even the most complex applications available today. 21
  • 29. Gantt chart E-R Diagram Event Table Use Case Diagram Class Diagram Sequence Diagram Activity Diagram State Diagram Menu Tree CRUD Table System Flow Chart Structure Chart System Design and Development 22
  • 35. Sequence Diagram  Sequence Diagram for Admin: 28
  • 36.  Sequence Diagram for Agent: 29
  • 37.  Sequence Diagram for Customer: 30
  • 42. Tables with Attribute and Constraints 35
  • 43. Tables with Attribute and Constraints 1) Admin Table:- 2) Agent Detail Table:- 3) Car Status Table:- 36
  • 44. 4) Bus Booking Detail Table:- 5) Bus Details Table:- 6) Car List Table:- 37
  • 45. 7) Car Calculation Table:- 8) Car Booking Table:- 9) Suggestion Table:- 38
  • 46. 10) Driver Table:- 11) Fare Details Table:- 12) Scheduled Table:- 39
  • 47. 13) Payment Table:- 14) Route Info Table:- 15) Seat Table:- 40
  • 48. Screen Layout with Test Data and Source Code 41
  • 49. FORM NAME:-AdminLogin Login form is designed to authenticate the Administrator. With Correct Username and Password, AdminPanel is accessible. 42
  • 50. CODE:- using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; public partial class AdminLogin : System.Web.UI.Page { Datautility dclass = new Datautility(); DataSet ds = new DataSet(); protected void Page_Load(object sender, EventArgs e) {} protected void Login1_Authenticate1(object sender, AuthenticateEventArgs e) { Session["adminid"] = Login1.UserName; string check = "select * from Admin where Email_id='" + Login1.UserName + "' and password='" + Login1.Password + "' and user_type='Admin'"; ds = dclass.GetDataSet(check); Boolean validuser; validuser = false; String usertype = ""; if (ds.Tables[0].Rows.Count > 0) { validuser = true; Session["adminid"] = ds.Tables[0].Rows[0]["Email_id"].ToString(); usertype = ds.Tables[0].Rows[0]["user_type"].ToString(); } if (validuser == true) { if (usertype == "Admin") { Response.Redirect("AdminPanel.aspx"); } } else { e.Authenticated = false; } } } 43
  • 51. FORM NAME:-AdminPanel This is main window for current Administrator in the Online Tours & Travel Software. AdminPanel is accessible only after proper Login by Administrator. 44
  • 52. 45
  • 53. 46
  • 54. 47
  • 55. CODE:- using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Text; using System.Data.SqlClient; using System.Data; using System.Configuration; public partial class AdminPanel : System.Web.UI.Page { Datautility d = new Datautility(); static string b, c, f, g, h; protected void Page_Load(object sender, EventArgs e) { if (Session["adminid"] == null) { Response.Redirect("AdminLogin.aspx"); } if (!IsPostBack) { filldropdown(); fillbus(); BindADsplan(); bindroute(); bindfare(); bindschedule(); //binddriver(); bindcar(); bindcarcal(); bindcarcalnotify(); binddriver(); } } protected void binddriver() { string st = "select count(*) from Agent_Details"; d.ExecuteScalar1(st); string query = "Select * from Agent_Details"; DataSet ds = new DataSet(); ds = d.GetDataSet(query); if (ds.Tables[0].Rows.Count > 0) 48
  • 56. { GridView5.Visible = true; GridView5.DataSource = ds; GridView5.DataBind(); } else { GridView5.Visible = false; GridView5.Columns.Clear(); } } public void fillbus() { SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["connection"].ConnectionString); SqlCommand cmd = new SqlCommand("Select bus_no from bus_Details", con); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds); DropDownList4.DataTextField = ds.Tables[0].Columns["bus_no"].ToString(); DropDownList4.DataValueField = ds.Tables[0].Columns["bus_no"].ToString(); DropDownList4.DataSource = ds.Tables[0]; DropDownList4.DataBind(); DropDownList4.Items.Insert(0, new ListItem("-- Please Select --", "0")); DropDownList1.DataTextField = ds.Tables[0].Columns["bus_no"].ToString(); DropDownList1.DataValueField = ds.Tables[0].Columns["bus_no"].ToString(); DropDownList1.DataSource = ds.Tables[0]; DropDownList1.DataBind(); DropDownList1.Items.Insert(0, new ListItem("-- Please Select --", "0")); } public void filldropdown() { SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["connection"].ConnectionString); SqlCommand cmd = new SqlCommand("Select * from Route_Info", con); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds); DropDownList6.DataTextField = ds.Tables[0].Columns["RouteName"].ToString(); DropDownList6.DataValueField = ds.Tables[0].Columns["RouteName"].ToString(); DropDownList6.DataSource = ds.Tables[0]; DropDownList6.DataBind(); 49
  • 57. DropDownList7.DataTextField = ds.Tables[0].Columns["RouteName"].ToString(); DropDownList7.DataValueField = ds.Tables[0].Columns["RouteName"].ToString(); DropDownList7.DataSource = ds.Tables[0]; DropDownList7.DataBind(); } protected void Button1_Click(object sender, EventArgs e) { string query = "Select * from bus_Details"; DataSet ds = new DataSet(); ds = d.GetDataSet(query); if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["bus_no"].ToString() == TextBox1.Text) { MsgBoxShow("Bus Already exist"); } else { string insertbus = "insert into bus_Details(bus_no,busname,bustype) values"; insertbus += " ('" + TextBox1.Text.ToUpper() + "','" + TextBox3.Text + "','" + DropDownList3.SelectedItem.Text + "')"; d.ExecuteSql(insertbus); MsgBoxShow("Bus added"); TextBox1.Text = ""; TextBox3.Text = ""; DropDownList3.SelectedIndex = 0; BindADsplan(); } } } protected void Button7_Click(object sender, EventArgs e) { if (Button7.Text == "Update") { if (DropDownList4.SelectedIndex.ToString() == "0") { MsgBoxShow("Please Select Bus No"); } else { Double km = Convert.ToDouble(TextBox7.Text); Double fare_km = Convert.ToDouble(TextBox4.Text); Double totalfare = km * fare_km; 50
  • 58. ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "Insert", "Total(" + totalfare + ");", true); string updtfare = "update Fare_details set bus_no='" + DropDownList4.SelectedItem.Text + "',Bustype='" + TextBox8.Text + "',source='" + DropDownList6.SelectedItem.Text + "',"; updtfare += "destination='" + DropDownList7.SelectedItem.Text + "',km='" + TextBox7.Text + "',fare_km='" + TextBox4.Text + "',totalfare='" + totalfare.ToString() + "' where fare_id='" + b + "'"; d.ExecuteSql(updtfare); Label32.Text = "fare updated"; DropDownList4.SelectedIndex = 0; DropDownList6.SelectedIndex = 0; DropDownList7.SelectedIndex = 0; TextBox8.Text = ""; TextBox7.Text = ""; TextBox4.Text = ""; Button7.Text = "Submit"; } } else { if (DropDownList4.SelectedIndex.ToString() == "0") { MsgBoxShow("Please Select Bus No"); } else { string st = "select count(*) from Fare_details "; d.ExecuteScalar1(st); string query = "Select * from Fare_details"; DataSet ds = new DataSet(); ds = d.GetDataSet(query); if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["bus_no"].ToString() == DropDownList4.SelectedItem.Text && ds.Tables[0].Rows[0]["source"].ToString() == DropDownList6.SelectedItem.Text && ds.Tables[0].Rows[0]["destination"].ToString() == DropDownList7.SelectedItem.Text) { MsgBoxShow("Fare Already Set"); } else { Double km = Convert.ToDouble(TextBox7.Text); Double fare_km = Convert.ToDouble(TextBox4.Text); Double totalfare = km * fare_km; ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "showalert", "Total(" + totalfare + ");", true); 51
  • 59. string insertfare = "insert into Fare_details(bus_no,Bustype,source,destination,km,fare_km,totalfare) values"; insertfare += " ('" + DropDownList4.SelectedItem.Text + "','" + TextBox8.Text + "','" + DropDownList6.SelectedItem.Text + "','" + DropDownList7.SelectedItem.Text + "','" + TextBox7.Text + "','" + TextBox4.Text + "','" + totalfare.ToString() + "')"; d.ExecuteSql(insertfare); Label32.Text = "fare set"; DropDownList4.SelectedIndex = 0; DropDownList6.SelectedIndex = 0; DropDownList7.SelectedIndex = 0; TextBox8.Text = ""; TextBox7.Text = ""; TextBox4.Text = ""; } } } } bindfare(); } protected void Button2_Click(object sender, EventArgs e) { string insertroute = "insert into Route_Info(RouteName) values"; insertroute += "('" + TextBox6.Text + "')"; d.ExecuteSql(insertroute); TextBox6.Text = ""; MsgBoxShow("Route added"); bindroute(); } protected void Button3_Click(object sender, EventArgs e) { if (Button3.Text == "Update") { if (DropDownList1.SelectedIndex.ToString() == "0" || DropDownList2.SelectedIndex.ToString() == "0" || DropDownList5.SelectedIndex.ToString() == "0") { MsgBoxShow("Bus No or Source Or Destination Not Selected"); } else { string updtSchedule = "Update scheduled set Bus_no='" + DropDownList1.SelectedItem.Text + "',source='" + DropDownList2.SelectedItem.Text + "',destination='" + DropDownList5.SelectedItem.Text + "',"; updtSchedule += "fare='" + TextBox28.Text + "',coach_type='" + TextBox25.Text + "',departing_time='" + TextBox12.Text + "',pick_up_point='" + TextBox13.Text + "',journy_time='" + TextBox9.Text + "' where Schedule_id='" + c + "'"; 52
  • 60. d.ExecuteSql(updtSchedule); MsgBoxShow("Scheduled Updated"); DropDownList1.SelectedIndex = 0; DropDownList2.SelectedIndex = 0; DropDownList5.SelectedIndex = 0; TextBox28.Text = ""; TextBox25.Text = ""; TextBox12.Text = ""; TextBox13.Text = ""; TextBox9.Text = ""; Button3.Text = "Submit"; } } else { if (DropDownList1.SelectedIndex.ToString() == "0" || DropDownList2.SelectedIndex.ToString() == "0" || DropDownList5.SelectedIndex.ToString() == "0") { MsgBoxShow("Bus No or Source Or Destination Not Selected"); } else { string insertSchedule = "insert into scheduled(Bus_no,source,destination,fare,coach_type,departing_time,pick_up_point,journy_t ime) values"; insertSchedule += "('" + DropDownList1.SelectedItem.Text + "','" + DropDownList2.SelectedItem.Text + "','" + DropDownList5.SelectedItem.Text + "','" + TextBox28.Text + "','" + TextBox25.Text + "','" + TextBox12.Text + "','" + TextBox13.Text + "','" + TextBox9.Text + "')"; d.ExecuteSql(insertSchedule); MsgBoxShow("Bus Scheduled"); DropDownList1.SelectedIndex = 0; DropDownList2.SelectedIndex = 0; DropDownList5.SelectedIndex = 0; TextBox28.Text = ""; TextBox25.Text = ""; TextBox12.Text = ""; TextBox13.Text = ""; TextBox9.Text = ""; } } bindschedule(); } protected void Button4_Click(object sender, EventArgs e) { 53
  • 61. if (Button4.Text == "Update") { string updtdriver = "Update dbo.Agent_Details set agent_name='" + TextBox14.Text + "',address='" + TextBox15.Text + "',agent_pin='" + TextBox19.Text + "',contact_no= '" + TextBox30.Text + "',balance_amt='" + TextBox27.Text + "',Email_id='" + TextBox34.Text + "',passwrod='" + TextBox35.Text + "' where agent_id='" + f + "'"; d.ExecuteSql(updtdriver); //string updateagent = "Update dbo.Admin set user_type='Agent', Email_id='" + TextBox34.Text + "',password='" + TextBox35.Text + "'"; //d.ExecuteSql(updateagent); MsgBoxShow("Driver info Updated"); TextBox14.Text = ""; TextBox15.Text = ""; TextBox19.Text = ""; TextBox27.Text = ""; TextBox30.Text = ""; TextBox34.Text = ""; TextBox35.Text = ""; Button4.Text = "Submit"; } else { string insertdriver = "insert into dbo.Agent_Details(agent_name,address,agent_pin,contact_no,balance_amt,Email_id,passwro d) values"; insertdriver += "('" + TextBox14.Text + "','" + TextBox15.Text + "','" + TextBox19.Text + "','" + TextBox30.Text + "','" + TextBox27.Text + "','" + TextBox34.Text + "','" + TextBox35.Text + "')"; d.ExecuteSql(insertdriver); //string insertagent = "insert into Admin values('Agent','" + TextBox34.Text + "','" + TextBox35.Text + "')"; //d.ExecuteSql(insertagent); MsgBoxShow("Driver Added"); TextBox14.Text = ""; TextBox15.Text = ""; TextBox19.Text = ""; TextBox27.Text = ""; TextBox30.Text = ""; TextBox35.Text = ""; } binddriver(); } protected void Button5_Click(object sender, EventArgs e) { if (Button5.Text == "Update") { 54
  • 62. string updtcar = "update Car_List set car_no='" + TextBox16.Text + "',Description='" + TextBox17.Text + "',capacity='" + TextBox18.Text + "',per_km='" + TextBox20.Text + "',"; updtcar += "per_km_with_ac='" + TextBox21.Text.ToUpper() + "',night_allowwence='" + TextBox22.Text + "' where car_id='" + g + "'"; d.ExecuteSql(updtcar); MsgBoxShow("Car info Updated"); TextBox16.Text = ""; TextBox17.Text = ""; TextBox18.Text = ""; TextBox20.Text = ""; TextBox21.Text = ""; TextBox22.Text = ""; Button5.Text = "Submit"; } else { string query = "Select * from Car_List"; DataSet ds = new DataSet(); ds = d.GetDataSet(query); if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["car_no"].ToString() == TextBox16.Text) { MsgBoxShow("Car Already exist"); } else { string insertcar1 = "insert into car_status(car_no,car_type,status) values"; insertcar1 += "('" + TextBox16.Text.ToUpper() + "','" + TextBox17.Text + "','unbooked')"; d.ExecuteSql(insertcar1); string insertcar = "insert into Car_List(car_no,Description,capacity,per_km,per_km_with_ac,night_allowwence) values"; insertcar += "('" + TextBox16.Text.ToUpper() + "','" + TextBox17.Text + "','" + TextBox18.Text + "','" + TextBox20.Text + "','" + TextBox21.Text + "','" + TextBox22.Text + "')"; d.ExecuteSql(insertcar); MsgBoxShow("Car Added"); TextBox16.Text = ""; TextBox17.Text = ""; TextBox18.Text = ""; TextBox20.Text = ""; TextBox21.Text = ""; TextBox22.Text = ""; } } } 55
  • 63. bindcar(); } protected void Button6_Click(object sender, EventArgs e) { string query = "Select * from Admin where user_type='Admin'"; DataSet ds = new DataSet(); ds = d.GetDataSet(query); if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["password"].ToString() == TextBox23.Text) { string updtpass = "update Admin set password='" + TextBox24.Text + "' where user_type='Admin'"; d.ExecuteSql(updtpass); Label33.Text = "Password Updated"; Label33.ForeColor = System.Drawing.Color.Green; } else { Label33.Text = "Please enter proper password"; Label33.ForeColor = System.Drawing.Color.Red; } } } protected void Button8_Click(object sender, EventArgs e) { if (Button8.Text == "Update") { string totnightallowence = ""; string seletnightall = "select * from Car_List where car_no='" + TextBox5.Text + "'"; DataSet ds = d.GetDataSet(seletnightall); if (ds.Tables[0].Rows.Count > 0) { int nightall = Convert.ToInt32(ds.Tables[0].Rows[0]["night_allowwence"].ToString()); int days1 = nightall * Convert.ToInt32(TextBox32.Text); totnightallowence = days1.ToString(); } string startkm = TextBox10.Text; string endkm = TextBox11.Text; int totkm = Convert.ToInt32(endkm) - Convert.ToInt32(startkm); int totamt = totkm * Convert.ToInt32(TextBox29.Text) + Convert.ToInt32(totnightallowence); int paytotamt = totkm * Convert.ToInt32(TextBox29.Text) + Convert.ToInt32(totnightallowence) - Convert.ToInt32(TextBox31.Text); string updtcalcal = "update Car_Cal set starting_km='" + TextBox10.Text + "',ending_km='" + TextBox11.Text + "',"; 56
  • 64. updtcalcal += "amt='" + paytotamt.ToString() + "',Ac_NonAc='" + TextBox26.Text + "',perkm='" + TextBox29.Text + "',advamt='" + TextBox31.Text + "',"; updtcalcal += "car_no='" + TextBox5.Text + "',noofdays='" + TextBox32.Text + "',totalnightallowence='" + totnightallowence + "',totalkm='" + totkm.ToString() + "',totamt='" + totamt.ToString() + "' where booking_no='" + TextBox2.Text + "'"; d.ExecuteSql(updtcalcal); MsgBoxShow("Fare Calculated updated"); ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", "var Mleft = (screen.width/2)-(760/2);var Mtop = (screen.height/2)- (700/2);window.open('carmessage2.aspx?bid=" + TextBox2.Text + "', null, 'height=400,width=460,status=yes,toolbar=no,scrollbars=yes,menubar=no,location=no,top=' +Mtop+', left='+Mleft+'' );", true); TextBox2.Text = ""; TextBox5.Text = ""; TextBox10.Text = ""; TextBox11.Text = ""; TextBox26.Text = ""; TextBox29.Text = ""; TextBox32.Text = ""; TextBox31.Text = ""; Button8.Text = "Submit"; Button8.Enabled = true; } else { string totnightallowence = ""; string seletnightall = "select * from Car_List where car_no='" + TextBox5.Text + "'"; DataSet ds = d.GetDataSet(seletnightall); if (ds.Tables[0].Rows.Count > 0) { int nightall = Convert.ToInt32(ds.Tables[0].Rows[0]["night_allowwence"].ToString()); int days1 = nightall * Convert.ToInt32(TextBox32.Text); totnightallowence = days1.ToString(); } string startkm = TextBox10.Text; string endkm = TextBox11.Text; int totkm = Convert.ToInt32(endkm) - Convert.ToInt32(startkm); int totamt = totkm * Convert.ToInt32(TextBox29.Text) + Convert.ToInt32(totnightallowence); int paytotamt = totkm * Convert.ToInt32(TextBox29.Text) + Convert.ToInt32(totnightallowence) - Convert.ToInt32(TextBox31.Text); string insertcalcal = "insert into Car_Cal(booking_no,starting_km,ending_km,amt,Ac_NonAc,perkm,totalkm,advamt,car_no, noofdays,totalnightallowence,totamt) values"; 57
  • 65. insertcalcal += "('" + TextBox2.Text + "','" + TextBox10.Text + "','" + TextBox11.Text + "','" + paytotamt.ToString() + "','" + TextBox26.Text + "','" + TextBox29.Text + "','" + totkm.ToString() + "','" + TextBox31.Text + "','" + TextBox5.Text + "','" + TextBox32.Text + "','" + totnightallowence + "','" + totamt.ToString() + "')"; d.ExecuteSql(insertcalcal); string uodtsts = "update carbooking set sts='inactive' where booking_no='" + TextBox2.Text + "'"; d.ExecuteSql(uodtsts); MsgBoxShow("Fare Calculated"); ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", "var Mleft = (screen.width/2)-(760/2);var Mtop = (screen.height/2)- (700/2);window.open('carmessage2.aspx?bid=" + TextBox2.Text + "', null, 'height=400,width=460,status=yes,toolbar=no,scrollbars=yes,menubar=no,location=no,top=' +Mtop+', left='+Mleft+'' );", true); TextBox2.Text = ""; TextBox5.Text = ""; TextBox10.Text = ""; TextBox11.Text = ""; TextBox26.Text = ""; TextBox29.Text = ""; TextBox32.Text = ""; TextBox31.Text = ""; Button8.Enabled = false; } bindcarcal(); bindcarcalnotify(); } protected void DropDownList4_IndexChanged(object sender, EventArgs e) { string str = "select * from bus_Details where bus_no='" + DropDownList4.SelectedItem.Text + "'"; DataSet ds = d.GetDataSet(str); if (ds.Tables[0].Rows.Count > 0) { TextBox8.Text = ds.Tables[0].Rows[0]["bustype"].ToString(); } } protected void Dropdownlist1_indexchanged(object sender, EventArgs e) { string str = "select distinct source from Fare_details where bus_no='" + DropDownList1.SelectedItem.Text + "'"; DataSet ds = d.GetDataSet(str); if (ds.Tables[0].Rows.Count > 0) 58
  • 66. { DropDownList2.Items.Clear(); DropDownList2.Items.Insert(0, new ListItem("-- Please Select --", "0")); DropDownList2.DataTextField = ds.Tables[0].Columns["source"].ToString(); DropDownList2.DataValueField = ds.Tables[0].Columns["source"].ToString(); DropDownList2.DataSource = ds.Tables[0]; DropDownList2.DataBind(); } string str1 = "select distinct destination from Fare_details where bus_no='" + DropDownList1.SelectedItem.Text + "'"; DataSet ds1 = d.GetDataSet(str1); if (ds1.Tables[0].Rows.Count > 0) { DropDownList5.Items.Clear(); DropDownList5.Items.Insert(0, new ListItem("-- Please Select --", "0")); DropDownList5.DataTextField = ds1.Tables[0].Columns["destination"].ToString(); DropDownList5.DataValueField = ds1.Tables[0].Columns["destination"].ToString(); DropDownList5.DataSource = ds1.Tables[0]; DropDownList5.DataBind(); } string str2 = "select * from Fare_details where bus_no='" + DropDownList1.SelectedItem.Text + "'"; DataSet ds2 = d.GetDataSet(str2); if (ds2.Tables[0].Rows.Count > 0) { TextBox25.Text = ds2.Tables[0].Rows[0]["Bustype"].ToString(); } } protected void Dropdownlist2_indexchanged(object sender, EventArgs e) { string str = "select * from Fare_details where bus_no='" + DropDownList1.SelectedItem.Text + "' and source='" + DropDownList2.SelectedItem.Text + "' and destination='" + DropDownList5.SelectedItem.Text + "'"; DataSet ds = d.GetDataSet(str); if (ds.Tables[0].Rows.Count > 0) { TextBox28.Text = ds.Tables[0].Rows[0]["totalfare"].ToString(); } } protected void Dropdownlist5_indexchanged(object sender, EventArgs e) { string str = "select * from Fare_details where bus_no='" + DropDownList1.SelectedItem.Text + "' and source='" + DropDownList2.SelectedItem.Text + "' and destination='" + DropDownList5.SelectedItem.Text + "'"; DataSet ds = d.GetDataSet(str); 59
  • 67. if (ds.Tables[0].Rows.Count > 0) { TextBox28.Text = ds.Tables[0].Rows[0]["totalfare"].ToString(); } } private void MsgBoxShow(string msg) { StringBuilder sb = new StringBuilder(); sb.Append("alert('"); sb.Append(msg.Replace("n", "n").Replace("r", "").Replace("'", "'")); sb.Append("');"); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "showalert", sb.ToString(), true); } protected void BindADsplan() { string st = "select count(*) from bus_Details "; d.ExecuteScalar1(st); string query = "Select * from bus_Details"; DataSet ds = new DataSet(); ds = d.GetDataSet(query); if (ds.Tables[0].Rows.Count > 0) { GridView4.Visible = true; GridView4.DataSource = ds; GridView4.DataBind(); } else { GridView4.Visible = false; GridView4.Columns.Clear(); } } protected void bindroute() { string st = "select count(*) from Route_Info "; d.ExecuteScalar1(st); string query = "Select * from Route_Info"; DataSet ds = new DataSet(); ds = d.GetDataSet(query); if (ds.Tables[0].Rows.Count > 0) { GridView1.Visible = true; GridView1.DataSource = ds; GridView1.DataBind(); 60
  • 68. } else { GridView1.Visible = false; GridView1.Columns.Clear(); } } protected void bindfare() { string st = "select count(*) from Fare_details"; d.ExecuteScalar1(st); string query = "Select * from Fare_details order by bus_no"; DataSet ds = new DataSet(); ds = d.GetDataSet(query); if (ds.Tables[0].Rows.Count > 0) { GridView2.Visible = true; GridView2.DataSource = ds; GridView2.DataBind(); } else { GridView2.Visible = false; GridView2.Columns.Clear(); } } protected void bindschedule() { string st = "select count(*) from scheduled"; d.ExecuteScalar1(st); string query = "Select * from scheduled order by bus_no"; DataSet ds = new DataSet(); ds = d.GetDataSet(query); if (ds.Tables[0].Rows.Count > 0) { GridView3.Visible = true; GridView3.DataSource = ds; GridView3.DataBind(); } else { GridView3.Visible = false; GridView3.Columns.Clear(); } } 61
  • 69. protected void bindcar() { string st = "select count(*) from Car_List"; d.ExecuteScalar1(st); string query = "Select * from Car_List"; DataSet ds = new DataSet(); ds = d.GetDataSet(query); if (ds.Tables[0].Rows.Count > 0) { GridView6.Visible = true; GridView6.DataSource = ds; GridView6.DataBind(); } else { GridView6.Visible = false; GridView6.Columns.Clear(); } } protected void bindcarcal() { string st = "select count(*) from Car_Cal"; d.ExecuteScalar1(st); string query = "Select * from Car_Cal"; DataSet ds = new DataSet(); ds = d.GetDataSet(query); if (ds.Tables[0].Rows.Count > 0) { GridView7.Visible = true; GridView7.DataSource = ds; GridView7.DataBind(); } else { GridView7.Visible = false; GridView7.Columns.Clear(); } } protected void bindcarcalnotify() { string st = "select count(*) from carbooking where date_upto='" + DateTime.Now.ToShortDateString() + "' and sts='active'"; d.ExecuteScalar1(st); string query = "Select * from carbooking where date_upto='" + DateTime.Now.ToShortDateString() + "' and sts='active'"; DataSet ds = new DataSet(); 62
  • 70. ds = d.GetDataSet(query); if (ds.Tables[0].Rows.Count > 0) { DataList1.Visible = true; DataList1.DataSource = ds; DataList1.DataBind(); } else { DataList1.Visible = false; } } protected void GridView4_PageIndexChanging(object sender, GridViewPageEventArgs e) { GridView4.PageIndex = e.NewPageIndex; BindADsplan(); } protected void GridView4_RowEditing(object sender, GridViewEditEventArgs e) { GridView4.EditIndex = e.NewEditIndex; BindADsplan(); } protected void GridView4_RowUpdating(object sender, GridViewUpdateEventArgs e) { int userid = Convert.ToInt32(GridView4.DataKeys[e.RowIndex].Value.ToString()); TextBox bus_no1 = (TextBox)GridView4.Rows[e.RowIndex].FindControl("bus_no1"); TextBox Totalseats1 = (TextBox)GridView4.Rows[e.RowIndex].FindControl("Totalseats1"); TextBox busname1 = (TextBox)GridView4.Rows[e.RowIndex].FindControl("busname1"); DropDownList bustype1 = (DropDownList)GridView4.Rows[e.RowIndex].FindControl("bustype1"); string update = "update bus_Details set bus_no='" + bus_no1.Text.ToUpper() + "',busname='" + busname1.Text + "',bustype='" + bustype1.SelectedItem.Text + "' where bus_id='" + userid + "'"; d.ExecuteSql(update); GridView4.EditIndex = -1; BindADsplan(); } protected void GridView4_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e) { GridView4.EditIndex = -1; BindADsplan(); } protected void GridView4_RowDeleting(object sender, GridViewDeleteEventArgs e) { 63
  • 71. int userid = Convert.ToInt32(GridView4.DataKeys[e.RowIndex].Values["bus_id"].ToString()); string del = "delete from bus_Details where bus_id='" + userid +"'"; d.ExecuteSql(del); BindADsplan(); } protected void GridView4_RowCommand(object sender, GridViewCommandEventArgs e) { } protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e) { GridView1.PageIndex = e.NewPageIndex; bindroute(); } protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e) { int userid = Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Values["Route_id"].ToString()); string del = "delete from Route_Info where Route_id='" + userid + "'"; d.ExecuteSql(del); bindroute(); } protected void GridView2_PageIndexChanging(object sender, GridViewPageEventArgs e) { GridView2.PageIndex = e.NewPageIndex; bindfare(); } protected void GridView2_RowDeleting(object sender, GridViewDeleteEventArgs e) { int userid = Convert.ToInt32(GridView2.DataKeys[e.RowIndex].Values["fare_id"].ToString()); string del = "delete from Fare_details where fare_id='" + userid + "'"; d.ExecuteSql(del); bindfare(); } protected void GridView3_PageIndexChanging(object sender, GridViewPageEventArgs e) { GridView3.PageIndex = e.NewPageIndex; bindschedule(); } protected void GridView3_RowDeleting(object sender, GridViewDeleteEventArgs e) { int userid = Convert.ToInt32(GridView3.DataKeys[e.RowIndex].Values["Schedule_id"].ToString()); string del = "delete from scheduled where Schedule_id='" + userid + "'"; d.ExecuteSql(del); 64
  • 72. bindschedule(); } protected void GridView5_PageIndexChanging(object sender, GridViewPageEventArgs e) { GridView5.PageIndex = e.NewPageIndex; binddriver(); } protected void GridView5_RowDeleting(object sender, GridViewDeleteEventArgs e) { int userid = Convert.ToInt32(GridView5.DataKeys[e.RowIndex].Values["agent_id"].ToString()); string del = "delete from Agent_Details where agent_id='" + userid + "'"; d.ExecuteSql(del); binddriver(); } protected void GridView6_PageIndexChanging(object sender, GridViewPageEventArgs e) { GridView6.PageIndex = e.NewPageIndex; bindcar(); } protected void GridView6_RowDeleting(object sender, GridViewDeleteEventArgs e) { int userid = Convert.ToInt32(GridView6.DataKeys[e.RowIndex].Values["car_id"].ToString()); string del = "delete from Car_List where car_id='" + userid + "'"; d.ExecuteSql(del); bindcar(); } protected void GridView7_PageIndexChanging(object sender, GridViewPageEventArgs e) { GridView7.PageIndex = e.NewPageIndex; bindcarcal(); } protected void GridView7_RowDeleting(object sender, GridViewDeleteEventArgs e) { int userid = Convert.ToInt32(GridView7.DataKeys[e.RowIndex].Values["booking_no"].ToString()); string del = "delete from Car_Cal where booking_no='" + userid + "'"; d.ExecuteSql(del); bindcarcal(); } protected void fareEdit_Click(object sender, EventArgs e) { ImageButton btndetails = sender as ImageButton; GridViewRow gvrow = (GridViewRow)btndetails.NamingContainer; 65
  • 73. b = GridView2.DataKeys[gvrow.RowIndex].Value.ToString(); string str = "Select * from Fare_details where fare_id='" + b + "'"; DataSet ad = d.GetDataSet(str); if (ad.Tables[0].Rows.Count > 0) { DropDownList4.Text = ad.Tables[0].Rows[0]["bus_no"].ToString(); TextBox8.Text = ad.Tables[0].Rows[0]["Bustype"].ToString(); DropDownList6.Text = ad.Tables[0].Rows[0]["source"].ToString(); DropDownList7.Text = ad.Tables[0].Rows[0]["destination"].ToString(); TextBox7.Text = ad.Tables[0].Rows[0]["km"].ToString(); TextBox4.Text = ad.Tables[0].Rows[0]["fare_km"].ToString(); Label32.Text = ""; Button7.Text = "Update"; } } protected void scheduleEdit_Click(object sender, EventArgs e) { ImageButton btndetails = sender as ImageButton; GridViewRow gvrow = (GridViewRow)btndetails.NamingContainer; c = GridView3.DataKeys[gvrow.RowIndex].Value.ToString(); string str = "Select * from scheduled where Schedule_id='" + c + "'"; DataSet ad = d.GetDataSet(str); if (ad.Tables[0].Rows.Count > 0) { DropDownList1.Text = ad.Tables[0].Rows[0]["Bus_no"].ToString(); string str1 = "select distinct source from Fare_details where bus_no='" + DropDownList1.Text + "'"; DataSet ds1 = d.GetDataSet(str1); if (ds1.Tables[0].Rows.Count > 0) { DropDownList2.Items.Clear(); DropDownList2.Items.Insert(0, new ListItem("-- Please Select --", "0")); DropDownList2.DataTextField = ds1.Tables[0].Columns["source"].ToString(); DropDownList2.DataValueField = ds1.Tables[0].Columns["source"].ToString(); DropDownList2.DataSource = ds1.Tables[0]; DropDownList2.DataBind(); } string str2 = "select distinct destination from Fare_details where bus_no='" + DropDownList1.Text + "'"; DataSet ds2 = d.GetDataSet(str2); if (ds2.Tables[0].Rows.Count > 0) { DropDownList5.Items.Clear(); DropDownList5.Items.Insert(0, new ListItem("-- Please Select --", "0")); DropDownList5.DataTextField = ds2.Tables[0].Columns["destination"].ToString(); DropDownList5.DataValueField = ds2.Tables[0].Columns["destination"].ToString(); 66
  • 74. DropDownList5.DataSource = ds2.Tables[0]; DropDownList5.DataBind(); } DropDownList2.Text = ad.Tables[0].Rows[0]["source"].ToString(); DropDownList5.Text = ad.Tables[0].Rows[0]["destination"].ToString(); TextBox28.Text = ad.Tables[0].Rows[0]["fare"].ToString(); TextBox25.Text = ad.Tables[0].Rows[0]["coach_type"].ToString(); TextBox12.Text = ad.Tables[0].Rows[0]["departing_time"].ToString(); TextBox13.Text = ad.Tables[0].Rows[0]["pick_up_point"].ToString(); TextBox9.Text = ad.Tables[0].Rows[0]["journy_time"].ToString(); Button3.Text = "Update"; } } protected void DriverEdit_Click(object sender, EventArgs e) { ImageButton btndetails = sender as ImageButton; GridViewRow gvrow = (GridViewRow)btndetails.NamingContainer; f = GridView5.DataKeys[gvrow.RowIndex].Value.ToString(); string str = "Select * from Agent_Details where agent_id='" + f + "'"; DataSet ad = d.GetDataSet(str); if (ad.Tables[0].Rows.Count > 0) { TextBox14.Text = ad.Tables[0].Rows[0]["agent_name"].ToString(); TextBox15.Text = ad.Tables[0].Rows[0]["address"].ToString(); TextBox19.Text = ad.Tables[0].Rows[0]["agent_pin"].ToString(); TextBox27.Text = ad.Tables[0].Rows[0]["contact_no"].ToString(); TextBox30.Text = ad.Tables[0].Rows[0]["balance_amt"].ToString(); TextBox34.Text = ad.Tables[0].Rows[0]["Email_id"].ToString(); TextBox35.Text = ad.Tables[0].Rows[0]["passwrod"].ToString(); Button4.Text = "Update"; } } protected void CarEdit_Click(object sender, EventArgs e) { ImageButton btndetails = sender as ImageButton; GridViewRow gvrow = (GridViewRow)btndetails.NamingContainer; g = GridView6.DataKeys[gvrow.RowIndex].Value.ToString(); string str = "Select * from Car_List where car_id='" + g + "'"; DataSet ad = d.GetDataSet(str); if (ad.Tables[0].Rows.Count > 0) { TextBox16.Text = ad.Tables[0].Rows[0]["car_no"].ToString(); TextBox17.Text = ad.Tables[0].Rows[0]["Description"].ToString(); TextBox18.Text = ad.Tables[0].Rows[0]["capacity"].ToString(); TextBox20.Text = ad.Tables[0].Rows[0]["per_km"].ToString(); TextBox21.Text = ad.Tables[0].Rows[0]["per_km_with_ac"].ToString(); 67
  • 75. TextBox22.Text = ad.Tables[0].Rows[0]["night_allowwence"].ToString(); Button5.Text = "Update"; } } protected void CarcalEdit_Click(object sender, EventArgs e) { ImageButton btndetails = sender as ImageButton; GridViewRow gvrow = (GridViewRow)btndetails.NamingContainer; h = GridView7.DataKeys[gvrow.RowIndex].Value.ToString(); string str = "Select * from Car_Cal where booking_no='" + h + "'"; DataSet ad = d.GetDataSet(str); if (ad.Tables[0].Rows.Count > 0) { TextBox2.Text = ad.Tables[0].Rows[0]["booking_no"].ToString(); TextBox10.Text = ad.Tables[0].Rows[0]["starting_km"].ToString(); TextBox11.Text = ad.Tables[0].Rows[0]["ending_km"].ToString(); TextBox26.Text = ad.Tables[0].Rows[0]["Ac_NonAc"].ToString(); TextBox29.Text = ad.Tables[0].Rows[0]["perkm"].ToString(); TextBox31.Text = ad.Tables[0].Rows[0]["advamt"].ToString(); TextBox5.Text = ad.Tables[0].Rows[0]["car_no"].ToString(); TextBox32.Text = ad.Tables[0].Rows[0]["noofdays"].ToString(); Button8.Text = "Update"; Button8.Enabled = true; } } protected void Calculate_Click(object sender, EventArgs e) { DataListItem item = ((LinkButton)sender).NamingContainer as DataListItem; Label lblEmpCode = (Label)item.FindControl("Label2"); string a = lblEmpCode.Text.ToString().Trim(); string str = "Select * from carbooking where booking_no='" + a + "'"; DataSet ad = d.GetDataSet(str); if (ad.Tables[0].Rows.Count > 0) { TextBox2.Text = ad.Tables[0].Rows[0]["booking_no"].ToString(); TextBox26.Text = ad.Tables[0].Rows[0]["Ac_nonac"].ToString(); TextBox31.Text = ad.Tables[0].Rows[0]["advAmount"].ToString(); TextBox5.Text = ad.Tables[0].Rows[0]["car_no"].ToString(); TextBox32.Text = ad.Tables[0].Rows[0]["No_of_days"].ToString(); string str1 = "Select * from Car_List where car_no='" + ad.Tables[0].Rows[0]["car_no"].ToString() + "' "; DataSet ad1 = d.GetDataSet(str1); if (ad1.Tables[0].Rows.Count > 0) { if (ad.Tables[0].Rows[0]["Ac_nonac"].ToString() == "A/C") { 68
  • 76. TextBox29.Text = ad1.Tables[0].Rows[0]["per_km_with_ac"].ToString(); } else { TextBox29.Text = ad1.Tables[0].Rows[0]["per_km"].ToString(); } } tabcont1.ActiveTabIndex = 7; Button8.Enabled = true; } } } 69
  • 77. FORM NAME:-Scheduled Scheduled form enables the User to Check the Entire Schedule. Where User would want to go, Source, Destination, Bus number, Fare, Coach Type, Pick up point and Status Detail. 70
  • 78. CODE:- using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; using System.Data.SqlClient; public partial class scheduled : System.Web.UI.Page { Datautility db = new Datautility(); DataSet ds2 = new DataSet(); protected void Page_Load(object sender, EventArgs e) { string get = "select * from scheduled"; ds2 = db.GetDataSet(get); schelist.DataSource = ds2; schelist.DataBind(); } } 71
  • 79. FORM NAME:-Bus Booking Bus booking form enables the User to Select the Source & Destination, Journey Date and Fill the User Detail like Name, Address, and Phone Number etc. 72
  • 80. CODE:- using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; using System.Data.SqlClient; using System.Text; public partial class booking : System.Web.UI.Page { Datautility d = new Datautility(); protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { filldropdown(); } } protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { string countseats = "select * from Seat where bookedate='" + TextBox1.Text + "'"; DataSet ds1 = d.GetDataSet(countseats); if (ds1.Tables[0].Rows.Count > 0) { if (ds1.Tables[0].Rows.Count == 44) { MsgBoxShow("Seats Full For Todays Booking"); } else { if (Session["userid"] == null) { if (ddlfrom.SelectedIndex.ToString() == "0" || ddlto.SelectedIndex.ToString() == "0") { MsgBoxShow("Source Or Destination Not Selected"); 73
  • 81. } else { this.ModalPopupExtender1.Show(); } } else { if (ddlfrom.SelectedIndex.ToString() == "0" || ddlto.SelectedIndex.ToString() == "0") { MsgBoxShow("Source Or Destination Not Selected"); } else { string selectrate = "select * from Fare_details where bus_no='" + Request.QueryString["busid"].ToString() + "' and source='" + ddlfrom.SelectedItem.Text + "' and destination='" + ddlto.SelectedItem.Text + "'"; DataSet ds = d.GetDataSet(selectrate); if (ds.Tables[0].Rows.Count > 0) { string rate = ds.Tables[0].Rows[0]["totalfare"].ToString(); string bustype = ds.Tables[0].Rows[0]["Bustype"].ToString(); String url = "seatforuser.aspx?bustype=" + bustype + "&jrate=" + rate + "&busno=" + Request.QueryString["busid"].ToString() + "&jouneydate=" + TextBox1.Text + "&name=" + txtname.Text + "&address=" + txtAddrss.Text + "&from=" + ddlfrom.SelectedItem.Text + "&to=" + ddlto.SelectedItem.Text + "&email=" + txtemail.Text + "&phone=" + txtcontact2.Text; Response.Redirect(url); } } } } } } public void filldropdown() { string busno = Request.QueryString["busid"].ToString(); string str = "select distinct source from Fare_details where bus_no='" + busno + "'"; DataSet ds = d.GetDataSet(str); if (ds.Tables[0].Rows.Count > 0) { ddlfrom.DataTextField = ds.Tables[0].Columns["source"].ToString(); ddlfrom.DataValueField = ds.Tables[0].Columns["source"].ToString(); ddlfrom.DataSource = ds.Tables[0]; ddlfrom.DataBind(); 74
  • 82. } string str1 = "select distinct destination from Fare_details where bus_no='" + busno + "'"; DataSet ds1 = d.GetDataSet(str1); if (ds1.Tables[0].Rows.Count > 0) { ddlto.DataTextField = ds1.Tables[0].Columns["destination"].ToString(); ddlto.DataValueField = ds1.Tables[0].Columns["destination"].ToString(); ddlto.DataSource = ds1.Tables[0]; ddlto.DataBind(); } } protected void Button3_Click(object sender, EventArgs e) { string check = "select * from Admin where Email_id='" + TextBox4.Text + "' and password='" + TextBox5.Text + "' and user_type='" + DropDownList2.SelectedItem.Text + "'"; DataSet ds = d.GetDataSet(check); Boolean validuser; validuser = false; String usertype = ""; if (ds.Tables[0].Rows.Count > 0) { validuser = true; Session["userid"] = ds.Tables[0].Rows[0]["Email_id"].ToString(); usertype = ds.Tables[0].Rows[0]["user_type"].ToString(); } else { MsgBoxShow("Invalid userid and password try again."); } if (validuser == true) { if (usertype == "User") { string selectrate = "select * from Fare_details where bus_no='" + Request.QueryString["busid"].ToString() + "' and source='" + ddlfrom.SelectedItem.Text + "' and destination='" + ddlto.SelectedItem.Text + "'"; DataSet ds1 = d.GetDataSet(selectrate); if (ds1.Tables[0].Rows.Count > 0) { string rate = ds1.Tables[0].Rows[0]["totalfare"].ToString(); string bustype = ds1.Tables[0].Rows[0]["Bustype"].ToString(); String url = "seatforuser.aspx?bustype=" + bustype + "&jrate=" + rate + "&busno=" + Request.QueryString["busid"].ToString() + "&jouneydate=" + TextBox1.Text + "&name=" + txtname.Text + "&address=" + txtAddrss.Text + "&from=" + 75
  • 83. ddlfrom.SelectedItem.Text + "&to=" + ddlto.SelectedItem.Text + "&email=" + txtemail.Text + "&phone=" + txtcontact2.Text; Response.Redirect(url); } } else if (usertype == "Agent") { string selectrate = "select * from Fare_details where bus_no='" + Request.QueryString["busid"].ToString() + "' and source='" + ddlfrom.SelectedItem.Text + "' and destination='" + ddlto.SelectedItem.Text + "'"; DataSet ds1 = d.GetDataSet(selectrate); if (ds1.Tables[0].Rows.Count > 0) { string rate = ds1.Tables[0].Rows[0]["totalfare"].ToString(); string bustype = ds1.Tables[0].Rows[0]["Bustype"].ToString(); String url = "seatforuser.aspx?bustype=" + bustype + "&jrate=" + rate + "&busno=" + Request.QueryString["busid"].ToString() + "&jouneydate=" + TextBox1.Text + "&name=" + txtname.Text + "&address=" + txtAddrss.Text + "&from=" + ddlfrom.SelectedItem.Text + "&to=" + ddlto.SelectedItem.Text + "&email=" + txtemail.Text + "&phone=" + txtcontact2.Text; Response.Redirect(url); } } } } protected void LinkButton1_Click(object sender, EventArgs e) { this.ModalPopupExtender2.Show(); } protected void Button2_Click(object sender, EventArgs e) { string insertuser = "insert into Admin(user_type,Email_id,password) values('User','" + TextBox2.Text + "','" + TextBox3.Text + "')"; d.ExecuteSql(insertuser); Session["userid"] = TextBox2.Text; string selectrate = "select * from Fare_details where bus_no='" + Request.QueryString["busid"].ToString() + "' and source='" + ddlfrom.SelectedItem.Text + "' and destination='" + ddlto.SelectedItem.Text + "'"; DataSet ds = d.GetDataSet(selectrate); if (ds.Tables[0].Rows.Count > 0) { string rate = ds.Tables[0].Rows[0]["totalfare"].ToString(); string bustype = ds.Tables[0].Rows[0]["Bustype"].ToString(); 76
  • 84. String url = "seatforuser.aspx?bustype=" + bustype + "&jrate=" + rate + "&busno=" + Request.QueryString["busid"].ToString() + "&jouneydate=" + TextBox1.Text + "&name=" + txtname.Text + "&address=" + txtAddrss.Text + "&from=" + ddlfrom.SelectedItem.Text + "&to=" + ddlto.SelectedItem.Text + "&email=" + txtemail.Text + "&phone=" + txtcontact2.Text; Response.Redirect(url); } } private void MsgBoxShow(string msg) { StringBuilder sb = new StringBuilder(); sb.Append("alert('"); sb.Append(msg.Replace("n", "n").Replace("r", "").Replace("'", "'")); sb.Append("');"); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "showalert", sb.ToString(), true); } } 77
  • 85. FORM NAME:-Seat For User Seat for user form enables the user to Select Unbooked ticket according to the Users Choice, Booked ticket can’t be choose by User. 78
  • 86. CODE:- using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; using System.Data.SqlClient; using System.Text; public partial class seatforuser : System.Web.UI.Page { Datautility ddata = new Datautility(); DataBaseClass db = new DataBaseClass(); DataSet ds = new DataSet(); static int noofseat = 0; static string bid = ""; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { noofseat = 0; string strseta; string getdata = "select seat_no from Seat where bus_id='" + Request.QueryString["busno"].ToString() + "' and bookedate='" + Request.QueryString["jouneydate"].ToString() + "'"; ds = ddata.GetDataSet(getdata); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { strseta = ds.Tables[0].Rows[i][0].ToString(); switch (strseta) { case "1": chkseat1.Checked = false; chkseat1.BackColor = System.Drawing.Color.Red; chkseat1.Enabled = false; break; case "2": chkseat2.Checked = false; 79
  • 87. chkseat2.BackColor = System.Drawing.Color.Red; chkseat2.Enabled = false; break; case "3": chkseat3.Checked = false; chkseat3.BackColor = System.Drawing.Color.Red; chkseat3.Enabled = false; break; case "4": chkseat4.Checked = false; chkseat4.BackColor = System.Drawing.Color.Red; chkseat4.Enabled = false; break; case "5": chkseat5.Checked = false; chkseat5.BackColor = System.Drawing.Color.Red; chkseat5.Enabled = false; break; case "6": chkseat6.Checked = false; chkseat6.BackColor = System.Drawing.Color.Red; chkseat6.Enabled = false; break; case "7": chkseat7.Checked = false; chkseat7.BackColor = System.Drawing.Color.Red; chkseat7.Enabled = false; break; case "8": chkseat8.Checked = false; chkseat8.BackColor = System.Drawing.Color.Red; chkseat8.Enabled = false; break; case "9": chkseat9.Checked = false; chkseat9.BackColor = System.Drawing.Color.Red; chkseat9.Enabled = false; break; case "10": chkseat10.Checked = false; chkseat10.BackColor = System.Drawing.Color.Red; chkseat10.Enabled = false; break; case "11": chkseat11.Checked = false; chkseat11.BackColor = System.Drawing.Color.Red; 80
  • 88. chkseat11.Enabled = false; break; case "12": chkseat12.Checked = false; chkseat12.BackColor = System.Drawing.Color.Red; chkseat12.Enabled = false; break; case "13": chkseat3.Checked = false; chkseat13.BackColor = System.Drawing.Color.Red; chkseat13.Enabled = false; break; case "14": chkseat14.Checked = false; chkseat14.BackColor = System.Drawing.Color.Red; chkseat14.Enabled = false; break; case "15": chkseat15.Checked = false; chkseat15.BackColor = System.Drawing.Color.Red; chkseat15.Enabled = false; break; case "16": chkseat16.Checked = false; chkseat16.BackColor = System.Drawing.Color.Red; chkseat16.Enabled = false; break; case "17": chkseat17.Checked = false; chkseat17.BackColor = System.Drawing.Color.Red; chkseat17.Enabled = false; break; case "18": chkseat18.Checked = false; chkseat18.BackColor = System.Drawing.Color.Red; chkseat18.Enabled = false; break; case "19": chkseat19.Checked = true; chkseat19.BackColor = System.Drawing.Color.Red; chkseat19.Enabled = false; break; case "20": chkseat20.Checked = true; chkseat20.BackColor = System.Drawing.Color.Red; chkseat20.Enabled = false; 81
  • 89. break; case "21": chkseat21.Checked = true; chkseat21.BackColor = System.Drawing.Color.Red; chkseat21.Enabled = false; break; case "22": chkseat22.Checked = false; chkseat22.BackColor = System.Drawing.Color.Red; chkseat22.Enabled = false; break; case "23": chkseat23.Checked = false; chkseat23.BackColor = System.Drawing.Color.Red; chkseat23.Enabled = false; break; case "24": chkseat24.Checked = false; chkseat24.BackColor = System.Drawing.Color.Red; chkseat24.Enabled = false; break; case "25": chkseat25.Checked = false; chkseat25.BackColor = System.Drawing.Color.Red; chkseat25.Enabled = false; break; case "26": chkseat26.Checked = false; chkseat26.BackColor = System.Drawing.Color.Red; chkseat26.Enabled = false; break; case "27": chkseat27.Checked = false; chkseat27.BackColor = System.Drawing.Color.Red; chkseat27.Enabled = false; break; case "28": chkseat28.Checked = false; chkseat28.BackColor = System.Drawing.Color.Red; chkseat28.Enabled = false; break; case "29": chkseat29.Checked = false; chkseat29.BackColor = System.Drawing.Color.Red; chkseat29.Enabled = false; 82
  • 90. break; case "30": chkseat30.Checked = false; chkseat30.BackColor = System.Drawing.Color.Red; chkseat30.Enabled = false; break; case "31": chkseat31.Checked = false; chkseat31.BackColor = System.Drawing.Color.Red; chkseat31.Enabled = false; break; case "32": chkseat32.Checked = false; chkseat32.BackColor = System.Drawing.Color.Red; chkseat32.Enabled = false; break; case "33": chkseat33.Checked = false; chkseat33.BackColor = System.Drawing.Color.Red; chkseat33.Enabled = false; break; case "34": chkseat34.Checked = false; chkseat34.BackColor = System.Drawing.Color.Red; chkseat34.Enabled = false; break; case "35": chkseat35.Checked = false; chkseat35.BackColor = System.Drawing.Color.Red; chkseat35.Enabled = false; break; case "36": chkseat36.Checked = false; chkseat36.BackColor = System.Drawing.Color.Red; chkseat36.Enabled = false; break; case "37": chkseat37.Checked = false; chkseat37.BackColor = System.Drawing.Color.Red; chkseat37.Enabled = false; break; case "38": chkseat38.Checked = false; chkseat38.BackColor = System.Drawing.Color.Red; chkseat38.Enabled = false; break; 83
  • 91. case "39": chkseat39.Checked = false; chkseat39.BackColor = System.Drawing.Color.Red; chkseat39.Enabled = false; break; case "40": chkseat40.Checked = false; chkseat40.BackColor = System.Drawing.Color.Red; chkseat40.Enabled = false; break; case "41": chkseat41.Checked = false; chkseat41.BackColor = System.Drawing.Color.Red; chkseat41.Enabled = false; break; case "42": chkseat42.Checked = false; chkseat42.BackColor = System.Drawing.Color.Red; chkseat42.Enabled = false; break; case "43": chkseat43.Checked = false; chkseat43.BackColor = System.Drawing.Color.Red; chkseat43.Enabled = false; break; case "44": chkseat44.Checked = false; chkseat44.BackColor = System.Drawing.Color.Red; chkseat44.Enabled = false; break; } } String name = Request.QueryString["name"]; String address = Request.QueryString["address"]; String from = Request.QueryString["from"]; String to = Request.QueryString["to"]; String email = Request.QueryString["email"]; String phone = Request.QueryString["phone"]; String jouneydate = Request.QueryString["jouneydate"]; busnumber.Text = Request.QueryString["busno"].ToString(); bustype.Text = Request.QueryString["bustype"].ToString(); txtname1.Text = name; txtaddres.Text = address; txtbording.Text = from; txtmail.Text = email; txtphone.Text = phone; 84
  • 92. txtdate.Text = Request.QueryString["jouneydate"]; txtfare.Text = Request.QueryString["jrate"].ToString(); txtdrop.Text = to; txtnoseat.Text = "0"; } } protected void btnNext_Click(object sender, EventArgs e) { if (txtnoseat.Text == "0") { MsgBoxShow("Please Select Seats"); } else { string strst = "select isnull(max(Booking_no),0)+1 from bus_Booking"; DataSet ds = new DataSet(); ds = ddata.GetDataSet(strst); if (ds.Tables[0].Rows.Count > 0) { bid = ds.Tables[0].Rows[0][0].ToString(); } Session["bid"] = bid; Label49.Text = bid; Label55.Text = txtname1.Text; Label51.Text = txtdate.Text; Label53.Text = countedseats.Value; Label57.Text = totalprice.Value; this.ModalPopupExtender1.Show(); } } protected void Button6_Click(object sender, EventArgs e) { char[] c = { ',' }; string strst1 = hiddennooffields.Value.ToString(); String[] arr = strst1.Split(c); Datautility db = new Datautility(); foreach (String a in arr) { if (a == "") { } else { string savedata = "insert into Seat (bus_id,seat_no,bookedate,status)values('" + Request.QueryString["busno"].ToString() + "','" + a + "','" + Request.QueryString["jouneydate"].ToString() + "','booked')"; 85
  • 93. db.ExecuteSql(savedata); } } string s = "select user_type from Admin where Email_id='" + txtmail.Text+ "'"; DataSet ds = new DataSet(); ds = ddata.GetDataSet(s); string utype = ds.Tables[0].Rows[0]["user_type"].ToString(); if (utype == "User") { string strst2 = "insert into bus_Booking(Booking_no,person_name,address,phone_no,email_id,no_of_seats,sour ce,destination,traveling_date,stime,cost,payment_Status,busnumber,bustype)"; strst2 = strst2 + " values('" + Session["bid"].ToString() + "','" + txtname1.Text + "','" + txtaddres.Text + "','" + txtphone.Text + "','" + txtmail.Text + "','" + countedseats.Value + "','" + txtbording.Text + "','" + txtdrop.Text + "','" + txtdate.Text + "','3','" + totalprice.Value + "','DD','" + busnumber.Text + "','" + bustype.Text + "')"; db.ExecuteSql(strst2); if (DropDownList5.SelectedItem.Text == "Pay By Debit/Credit Card/Net Banking") { if (TabContainer1.ActiveTabIndex == 0) { string insertpayment = "insert into Payment(user_id,bid,PaymentMode,Debit_Cardno,nameoncard,expiry_month,expiry_ year,cvv_no,paidby,paydate,Amount,bookingfor) values"; insertpayment += "('" + Session["userid"].ToString() + "','" + bid + "','" + DropDownList5.SelectedItem.Text + "','" + txtCardNo.Text + "','" + txtNameOnCard.Text + "','" + DropDownList6.SelectedItem.Text + "','" + DropDownList7.SelectedItem.Text + "','" + txtCvvNo.Text + "','Debit Card','" + DateTime.Now.ToString() + "','" + totalprice.Value + "','bus')"; ddata.ExecuteSql(insertpayment); } else if (TabContainer1.ActiveTabIndex == 1) { string insertpayment = "insert into Payment(user_id,bid,PaymentMode,Credit_Cardno,nameoncard,expiry_month,expiry _year,cvv_no,paidby,paydate,Amount,bookingfor) values"; insertpayment += "('" + Session["userid"].ToString() + "','" + bid + "','" + DropDownList5.SelectedItem.Text + "','" + txtCardNoCr.Text + "','" + txtNameOnCardCr.Text + "','" + DropDownList8.SelectedItem.Text + "','" + DropDownList9.SelectedItem.Text + "','" + txtCvvNoCr.Text + "','Credit Card','" + DateTime.Now.ToString() + "','" + totalprice.Value + "','bus')"; ddata.ExecuteSql(insertpayment); } else { 86
  • 94. string insertpayment = "insert into Payment(user_id,bid,PaymentMode,Bankname,username,password,paidby,paydate,A mount,bookingfor) values"; insertpayment += "('" + Session["userid"].ToString() + "','" + bid + "','" + DropDownList5.SelectedItem.Text + "','" + ddlBankName.SelectedItem.Text + "','" + txtUserName.Text + "','" + txtUserPass.Text + "','Net Banking','" + DateTime.Now.ToString() + "','" + totalprice.Value + "','bus')"; ddata.ExecuteSql(insertpayment); } } else { string insertpayment = "insert into Payment(user_id,bid,PaymentMode,paidby,paydate,Amount,bookingfor) values"; insertpayment += "('" + Session["userid"].ToString() + "','" + bid + "','" + DropDownList5.SelectedItem.Text + "','Cash','" + DateTime.Now.ToString() + "','" + totalprice.Value + "','bus')"; ddata.ExecuteSql(insertpayment); } Response.Redirect("message.aspx?bid=" + bid); } else if(utype=="Agent") { string strst2 = "insert into bus_Booking(Booking_no,person_name,address,phone_no,email_id,no_of_seats,sour ce,destination,traveling_date,stime,cost,payment_Status,busnumber,bustype)"; strst2 = strst2 + " values('" + Session["bid"].ToString() + "','" + txtname1.Text + "','" + txtaddres.Text + "','" + txtphone.Text + "','" + txtmail.Text + "','" + countedseats.Value + "','" + txtbording.Text + "','" + txtdrop.Text + "','" + txtdate.Text + "','3','" + totalprice.Value + "','DD','" + busnumber.Text + "','" + bustype.Text + "')"; db.ExecuteSql(strst2); string strtotal = "Select distinct a.email_id,b.balance_amt from dbo.bus_Booking a,dbo.Agent_Details b where a.email_id=b.Email_id and a.email_id='" + txtmail.Text + "' "; DataSet ds1 = new DataSet(); ds1 = ddata.GetDataSet(strtotal); int z = Int32.Parse(ds1.Tables[0].Rows[0]["balance_amt"].ToString()); int b = Int32.Parse(txttotal.Text); int total = z - b; string updateagent = "update Agent_Details set balance_amt='" + total + "' where Email_id='" + txtmail.Text + "' "; db.ExecuteSql(updateagent); if (DropDownList5.SelectedItem.Text == "Pay By Debit/Credit Card/Net Banking") { 87
  • 95. if (TabContainer1.ActiveTabIndex == 0) { string insertpayment = "insert into Payment(user_id,bid,PaymentMode,Debit_Cardno,nameoncard,expiry_month,expiry_ year,cvv_no,paidby,paydate,Amount,bookingfor) values"; insertpayment += "('" + Session["userid"].ToString() + "','" + bid + "','" + DropDownList5.SelectedItem.Text + "','" + txtCardNo.Text + "','" + txtNameOnCard.Text + "','" + DropDownList6.SelectedItem.Text + "','" + DropDownList7.SelectedItem.Text + "','" + txtCvvNo.Text + "','Debit Card','" + DateTime.Now.ToString() + "','" + totalprice.Value + "','bus')"; ddata.ExecuteSql(insertpayment); } else if (TabContainer1.ActiveTabIndex == 1) { string insertpayment = "insert into Payment(user_id,bid,PaymentMode,Credit_Cardno,nameoncard,expiry_month,expiry _year,cvv_no,paidby,paydate,Amount,bookingfor) values"; insertpayment += "('" + Session["userid"].ToString() + "','" + bid + "','" + DropDownList5.SelectedItem.Text + "','" + txtCardNoCr.Text + "','" + txtNameOnCardCr.Text + "','" + DropDownList8.SelectedItem.Text + "','" + DropDownList9.SelectedItem.Text + "','" + txtCvvNoCr.Text + "','Credit Card','" + DateTime.Now.ToString() + "','" + totalprice.Value + "','bus')"; ddata.ExecuteSql(insertpayment); } else { string insertpayment = "insert into Payment(user_id,bid,PaymentMode,Bankname,username,password,paidby,paydate,A mount,bookingfor) values"; insertpayment += "('" + Session["userid"].ToString() + "','" + bid + "','" + DropDownList5.SelectedItem.Text + "','" + ddlBankName.SelectedItem.Text + "','" + txtUserName.Text + "','" + txtUserPass.Text + "','Net Banking','" + DateTime.Now.ToString() + "','" + totalprice.Value + "','bus')"; ddata.ExecuteSql(insertpayment); } } else { string insertpayment = "insert into Payment(user_id,bid,PaymentMode,paidby,paydate,Amount,bookingfor) values"; insertpayment += "('" + Session["userid"].ToString() + "','" + bid + "','" + DropDownList5.SelectedItem.Text + "','Cash','" + DateTime.Now.ToString() + "','" + totalprice.Value + "','bus')"; ddata.ExecuteSql(insertpayment); } } 88
  • 96. Response.Redirect("message.aspx?bid=" + bid); } protected void dropdownlist5_click(object sender, EventArgs e) { if (DropDownList5.SelectedItem.Text == "Please Select") { } else if (DropDownList5.SelectedItem.Text == "Pay By Cash") { Panel3.Visible = false; } else { Panel3.Visible = true; } this.ModalPopupExtender1.Show(); } private void MsgBoxShow(string msg) { StringBuilder sb = new StringBuilder(); sb.Append("alert('"); sb.Append(msg.Replace("n", "n").Replace("r", "").Replace("'", "'")); sb.Append("');"); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "showalert", sb.ToString(), true); } protected void chkseat2_CheckedChanged(object sender, EventArgs e) { if (chkseat2.Checked == true) { noofseat = noofseat + 1; hiddennooffields.Value = hiddennooffields.Value+","+"2"; txtselected.Text = hiddennooffields.Value; txtnoseat.Text = ""; txtnoseat.Text = noofseat.ToString(); countedseats.Value = noofseat.ToString(); double price; price = Convert.ToDouble(Request.QueryString["jrate"].ToString()); price = noofseat * price; txttotal.Text = price.ToString(); totalprice.Value = price.ToString(); removeComma(); } else { noofseat = noofseat - 1; string hdf = hiddennooffields.Value.ToString(); 89
  • 97. hiddennooffields.Value = hdf.Replace(",2", ""); txtselected.Text = hiddennooffields.Value; txtnoseat.Text = ""; txtnoseat.Text = noofseat.ToString(); countedseats.Value = noofseat.ToString(); double price; price = Convert.ToDouble(Request.QueryString["jrate"].ToString()); price = noofseat * price; txttotal.Text = price.ToString(); totalprice.Value = price.ToString(); removeComma(); } } protected void chkseat3_CheckedChanged(object sender, EventArgs e) { if (chkseat3.Checked == true) { noofseat = noofseat + 1; hiddennooffields.Value = hiddennooffields.Value + "," + "3"; txtselected.Text = hiddennooffields.Value; txtnoseat.Text = ""; txtnoseat.Text = noofseat.ToString(); countedseats.Value = noofseat.ToString(); double price; price = Convert.ToDouble(Request.QueryString["jrate"].ToString()); price = noofseat * price; txttotal.Text = price.ToString(); totalprice.Value = price.ToString(); removeComma(); } else { noofseat = noofseat - 1; string hdf = hiddennooffields.Value.ToString(); hiddennooffields.Value = hdf.Replace(",3", ""); txtselected.Text = hiddennooffields.Value; txtnoseat.Text = ""; txtnoseat.Text = noofseat.ToString(); countedseats.Value = noofseat.ToString(); double price; price = Convert.ToDouble(Request.QueryString["jrate"].ToString()); price = noofseat * price; txttotal.Text = price.ToString(); totalprice.Value = price.ToString(); removeComma(); } 90
  • 98. } protected void chkseat4_CheckedChanged(object sender, EventArgs e) { if (chkseat4.Checked == true) { noofseat = noofseat + 1; hiddennooffields.Value = hiddennooffields.Value + "," + "4"; txtselected.Text = hiddennooffields.Value; txtnoseat.Text = ""; txtnoseat.Text = noofseat.ToString(); countedseats.Value = noofseat.ToString(); double price; price = Convert.ToDouble(Request.QueryString["jrate"].ToString()); price = noofseat * price; txttotal.Text = price.ToString(); totalprice.Value = price.ToString(); removeComma(); } else { noofseat = noofseat - 1; string hdf = hiddennooffields.Value.ToString(); hiddennooffields.Value = hdf.Replace(",4", ""); txtselected.Text = hiddennooffields.Value; txtnoseat.Text = ""; txtnoseat.Text = noofseat.ToString(); countedseats.Value = noofseat.ToString(); double price; price = Convert.ToDouble(Request.QueryString["jrate"].ToString()); price = noofseat * price; txttotal.Text = price.ToString(); totalprice.Value = price.ToString(); removeComma(); } } protected void chkseat5_CheckedChanged(object sender, EventArgs e) { if (chkseat5.Checked == true) { noofseat = noofseat + 1; hiddennooffields.Value = hiddennooffields.Value + "," + "5"; txtselected.Text = hiddennooffields.Value; txtnoseat.Text = ""; txtnoseat.Text = noofseat.ToString(); countedseats.Value = noofseat.ToString(); double price; 91
  • 99. price = Convert.ToDouble(Request.QueryString["jrate"].ToString()); price = noofseat * price; txttotal.Text = price.ToString(); totalprice.Value = price.ToString(); removeComma(); } else { noofseat = noofseat - 1; string hdf = hiddennooffields.Value.ToString(); hiddennooffields.Value = hdf.Replace(",5", ""); txtselected.Text = hiddennooffields.Value; txtnoseat.Text = ""; txtnoseat.Text = noofseat.ToString(); countedseats.Value = noofseat.ToString(); double price; price = Convert.ToDouble(Request.QueryString["jrate"].ToString()); price = noofseat * price; txttotal.Text = price.ToString(); totalprice.Value = price.ToString(); removeComma(); } } protected void chkseat6_CheckedChanged(object sender, EventArgs e) { if (chkseat6.Checked == true) { noofseat = noofseat + 1; hiddennooffields.Value = hiddennooffields.Value + "," + "6"; txtselected.Text = hiddennooffields.Value; txtnoseat.Text = ""; txtnoseat.Text = noofseat.ToString(); countedseats.Value = noofseat.ToString(); double price; price = Convert.ToDouble(Request.QueryString["jrate"].ToString()); price = noofseat * price; txttotal.Text = price.ToString(); totalprice.Value = price.ToString(); removeComma(); } else { noofseat = noofseat - 1; string hdf = hiddennooffields.Value.ToString(); hiddennooffields.Value = hdf.Replace(",6", ""); 92
  • 100. txtselected.Text = hiddennooffields.Value; txtnoseat.Text = ""; txtnoseat.Text = noofseat.ToString(); countedseats.Value = noofseat.ToString(); double price; price = Convert.ToDouble(Request.QueryString["jrate"].ToString()); price = noofseat * price; txttotal.Text = price.ToString(); totalprice.Value = price.ToString(); removeComma(); } } protected void chkseat7_CheckedChanged(object sender, EventArgs e) { if (chkseat7.Checked == true) { noofseat = noofseat + 1; hiddennooffields.Value = hiddennooffields.Value + "," + "7"; txtselected.Text = hiddennooffields.Value; txtnoseat.Text = ""; txtnoseat.Text = noofseat.ToString(); countedseats.Value = noofseat.ToString(); double price; price = Convert.ToDouble(Request.QueryString["jrate"].ToString()); price = noofseat * price; txttotal.Text = price.ToString(); totalprice.Value = price.ToString(); removeComma(); } else { noofseat = noofseat - 1; string hdf = hiddennooffields.Value.ToString(); hiddennooffields.Value = hdf.Replace(",7", ""); txtselected.Text = hiddennooffields.Value; txtnoseat.Text = ""; txtnoseat.Text = noofseat.ToString(); countedseats.Value = noofseat.ToString(); double price; price = Convert.ToDouble(Request.QueryString["jrate"].ToString()); price = noofseat * price; txttotal.Text = price.ToString(); totalprice.Value = price.ToString(); removeComma(); } } 93
  • 101. protected void chkseat8_CheckedChanged(object sender, EventArgs e) { if (chkseat8.Checked == true) { noofseat = noofseat + 1; hiddennooffields.Value = hiddennooffields.Value + "," + "8"; txtselected.Text = hiddennooffields.Value; txtnoseat.Text = ""; txtnoseat.Text = noofseat.ToString(); countedseats.Value = noofseat.ToString(); double price; price = Convert.ToDouble(Request.QueryString["jrate"].ToString()); price = noofseat * price; txttotal.Text = price.ToString(); totalprice.Value = price.ToString(); removeComma(); } else { noofseat = noofseat - 1; string hdf = hiddennooffields.Value.ToString(); hiddennooffields.Value = hdf.Replace(",8", ""); txtselected.Text = hiddennooffields.Value; txtnoseat.Text = ""; txtnoseat.Text = noofseat.ToString(); countedseats.Value = noofseat.ToString(); double price; price = Convert.ToDouble(Request.QueryString["jrate"].ToString()); price = noofseat * price; txttotal.Text = price.ToString(); totalprice.Value = price.ToString(); removeComma(); } } protected void chkseat9_CheckedChanged(object sender, EventArgs e) { if (chkseat9.Checked == true) { noofseat = noofseat + 1; hiddennooffields.Value = hiddennooffields.Value + "," + "9"; txtselected.Text = hiddennooffields.Value; txtnoseat.Text = ""; txtnoseat.Text = noofseat.ToString(); countedseats.Value = noofseat.ToString(); double price; price = Convert.ToDouble(Request.QueryString["jrate"].ToString()); 94
  • 102. price = noofseat * price; txttotal.Text = price.ToString(); totalprice.Value = price.ToString(); removeComma(); } else { noofseat = noofseat - 1; string hdf = hiddennooffields.Value.ToString(); hiddennooffields.Value = hdf.Replace(",9", ""); txtselected.Text = hiddennooffields.Value; txtnoseat.Text = ""; txtnoseat.Text = noofseat.ToString(); countedseats.Value = noofseat.ToString(); double price; price = Convert.ToDouble(Request.QueryString["jrate"].ToString()); price = noofseat * price; txttotal.Text = price.ToString(); totalprice.Value = price.ToString(); removeComma(); } } protected void chkseat10_CheckedChanged(object sender, EventArgs e) { if (chkseat10.Checked == true) { noofseat = noofseat + 1; hiddennooffields.Value = hiddennooffields.Value + "," + "10"; txtselected.Text = hiddennooffields.Value; txtnoseat.Text = ""; txtnoseat.Text = noofseat.ToString(); countedseats.Value = noofseat.ToString(); double price; price = Convert.ToDouble(Request.QueryString["jrate"].ToString()); price = noofseat * price; txttotal.Text = price.ToString(); totalprice.Value = price.ToString(); removeComma(); } else { noofseat = noofseat - 1; string hdf = hiddennooffields.Value.ToString(); hiddennooffields.Value = hdf.Replace(",10", ""); txtselected.Text = hiddennooffields.Value; txtnoseat.Text = ""; 95
  • 103. txtnoseat.Text = noofseat.ToString(); countedseats.Value = noofseat.ToString(); double price; price = Convert.ToDouble(Request.QueryString["jrate"].ToString()); price = noofseat * price; txttotal.Text = price.ToString(); totalprice.Value = price.ToString(); removeComma(); } } protected void chkseat11_CheckedChanged(object sender, EventArgs e) { if (chkseat11.Checked == true) { noofseat = noofseat + 1; hiddennooffields.Value = hiddennooffields.Value + "," + "11"; txtselected.Text = hiddennooffields.Value; txtnoseat.Text = ""; txtnoseat.Text = noofseat.ToString(); countedseats.Value = noofseat.ToString(); double price; price = Convert.ToDouble(Request.QueryString["jrate"].ToString()); price = noofseat * price; txttotal.Text = price.ToString(); totalprice.Value = price.ToString(); removeComma(); } else { noofseat = noofseat - 1; string hdf = hiddennooffields.Value.ToString(); hiddennooffields.Value = hdf.Replace(",11", ""); txtselected.Text = hiddennooffields.Value; txtnoseat.Text = ""; txtnoseat.Text = noofseat.ToString(); countedseats.Value = noofseat.ToString(); double price; price = Convert.ToDouble(Request.QueryString["jrate"].ToString()); price = noofseat * price; txttotal.Text = price.ToString(); totalprice.Value = price.ToString(); removeComma(); } } protected void chkseat12_CheckedChanged(object sender, EventArgs e) { 96
  • 104. if (chkseat12.Checked == true) { noofseat = noofseat + 1; hiddennooffields.Value = hiddennooffields.Value + "," + "12"; txtselected.Text = hiddennooffields.Value; txtnoseat.Text = ""; txtnoseat.Text = noofseat.ToString(); countedseats.Value = noofseat.ToString(); double price; price = Convert.ToDouble(Request.QueryString["jrate"].ToString()); price = noofseat * price; txttotal.Text = price.ToString(); totalprice.Value = price.ToString(); removeComma(); } else { noofseat = noofseat - 1; string hdf = hiddennooffields.Value.ToString(); hiddennooffields.Value = hdf.Replace(",12", ""); txtselected.Text = hiddennooffields.Value; txtnoseat.Text = ""; txtnoseat.Text = noofseat.ToString(); countedseats.Value = noofseat.ToString(); double price; price = Convert.ToDouble(Request.QueryString["jrate"].ToString()); price = noofseat * price; txttotal.Text = price.ToString(); totalprice.Value = price.ToString(); removeComma(); } } protected void chkseat13_CheckedChanged(object sender, EventArgs e) { if (chkseat13.Checked == true) { noofseat = noofseat + 1; hiddennooffields.Value = hiddennooffields.Value + "," + "13"; txtselected.Text = hiddennooffields.Value; txtnoseat.Text = ""; txtnoseat.Text = noofseat.ToString(); countedseats.Value = noofseat.ToString(); double price; price = Convert.ToDouble(Request.QueryString["jrate"].ToString()); price = noofseat * price; txttotal.Text = price.ToString(); 97
  • 105. totalprice.Value = price.ToString(); removeComma(); } else { noofseat = noofseat - 1; string hdf = hiddennooffields.Value.ToString(); hiddennooffields.Value = hdf.Replace(",13", ""); txtselected.Text = hiddennooffields.Value; txtnoseat.Text = ""; txtnoseat.Text = noofseat.ToString(); countedseats.Value = noofseat.ToString(); double price; price = Convert.ToDouble(Request.QueryString["jrate"].ToString()); price = noofseat * price; txttotal.Text = price.ToString(); totalprice.Value = price.ToString(); removeComma(); } } protected void chkseat14_CheckedChanged(object sender, EventArgs e) { if (chkseat14.Checked == true) { noofseat = noofseat + 1; hiddennooffields.Value = hiddennooffields.Value + "," + "14"; txtselected.Text = hiddennooffields.Value; txtnoseat.Text = ""; txtnoseat.Text = noofseat.ToString(); countedseats.Value = noofseat.ToString(); double price; price = Convert.ToDouble(Request.QueryString["jrate"].ToString()); price = noofseat * price; txttotal.Text = price.ToString(); totalprice.Value = price.ToString(); removeComma(); } else { noofseat = noofseat - 1; string hdf = hiddennooffields.Value.ToString(); hiddennooffields.Value = hdf.Replace(",14", ""); txtselected.Text = hiddennooffields.Value; txtnoseat.Text = ""; txtnoseat.Text = noofseat.ToString(); countedseats.Value = noofseat.ToString(); 98
  • 106. double price; price = Convert.ToDouble(Request.QueryString["jrate"].ToString()); price = noofseat * price; txttotal.Text = price.ToString(); totalprice.Value = price.ToString(); removeComma(); } } protected void chkseat15_CheckedChanged(object sender, EventArgs e) { if (chkseat15.Checked == true) { noofseat = noofseat + 1; hiddennooffields.Value = hiddennooffields.Value + "," + "15"; txtselected.Text = hiddennooffields.Value; txtnoseat.Text = ""; txtnoseat.Text = noofseat.ToString(); countedseats.Value = noofseat.ToString(); double price; price = Convert.ToDouble(Request.QueryString["jrate"].ToString()); price = noofseat * price; txttotal.Text = price.ToString(); totalprice.Value = price.ToString(); removeComma(); } else { noofseat = noofseat - 1; string hdf = hiddennooffields.Value.ToString(); hiddennooffields.Value = hdf.Replace(",15", ""); txtselected.Text = hiddennooffields.Value; txtnoseat.Text = ""; txtnoseat.Text = noofseat.ToString(); countedseats.Value = noofseat.ToString(); double price; price = Convert.ToDouble(Request.QueryString["jrate"].ToString()); price = noofseat * price; txttotal.Text = price.ToString(); totalprice.Value = price.ToString(); removeComma(); } } protected void chkseat16_CheckedChanged(object sender, EventArgs e) { if (chkseat16.Checked == true) { 99