Sunteți pe pagina 1din 127

ACKNOWLEDGEMENT

We are thankful to God Almighty for his blessings, our beloved parents and
friends in helping us to complete our project successfully.

We hereby avail this opportunity to express our deep sense of gratitude and
indebtedness to institution “KRUPANIDHI INSTITUTION OF
MANAGEMENT “ which provide us an opportunity to fulfill the most
cherished desire of our ambition.

We kindly express our sincere thanks to our beloved Dean Prof.Rizwan Ali
Baig and Principal Dr.Haneefa Rizwan for enabling us to undertake this
project .

We also express our thanks to Mr. Pasha for his valuable guidance, co-
operation and support to complete the project successfully.

We kindly express our sincere thanks to Mrs.Rabi for his support, guidance
and co-operation to complete our project successfully.

We also express our sincere gratitude for the tremendous support given by
one and all in the department of Computer science.

We also once again convey our heart full thanks for our beloved parents who
are always behind our success.
CONTENTS

1. INTRODUCTION

2. SYNOPSIS

3. SYSTEM SPECIFICATION
HARDWARE SPECIFICATION
SOFTWARE SPECIFICATION

4. SYSTEM ANALYSIS
EXISTING SYSTEM
PROPOSED SYSTEM

5. SYSTEM DESIGN
DATA FLOW DIAGRAM

6. IMPLEMENTATION
ABOUT VISUAL BASICS 6.0
ABOUT MICROSOFT ACCESS 2003

7. CODING

8. TESTING

9. SCREEN SHOTS

10. CONCLUSION

11. BIBILOGRAPHY

1. INTRODUCTION
The project titled “StockWare” has been developed in Visual basic 6.0
as the front end and MicroSoft access 2003 as the backend. The prime
objective of this venture is to develop full-fledged software, which fulfills
the requirements of the Stocks maintenance for super markets &
shoping malls .

The main task is to provide the user easy facilities to Transfer Stocks
from warehouse to store. The project keenly concentrated on the
product details , stocks avilable in tha warehouse , product needed for
tha store , billing and bank transction details.

This project also contains the details about the vender, product
information purchase details and account all tha payments, finally
reports of all tha products avilable in the warehouse and stores and
report of sales .
2. SYNOPSIS

The Project entitled stock management encomposes the automation of


various activities undertaken in due course of procuring materials for a
super market starting from the instances of placing a demand until
producinga a bill and selling the products to the end customers. The
various activities involved along with this process flow are:

 Vendor registration

 Product Registration

 WareHouse activities

 Requesting vendor for goods.

 Payment to vendor by means of cheques.

 Transfer of goods from warehouse to store against


request.

 Out of stock details in warehouse.

 Store activities

 Requesting goods from warehouse.

 Out of stock details in store.

 Producing a bills to end customer.

This is a single tire RDBMS application. This system is developed based


on single tire architecture where the system is a standalone system
backed by RDMS.
The project is proposed to be developed in VB 6.0 (Standard EXE) as
the front end and Microsoft Access 2003 as backened. In depth crystal
reporting is made available using crystal reports. This system is a menu
driven system and would be explained in the later stages.

3. SYSTEM SPECIFICATION

HARDWARE ENVIRONMENT:

PROCESSOR : 200 GHz Pentium Duel Core

PROCESSOR SPEED : 1.5

RAM Size : 1 GB

HARD DISK SIZE : 160GB

SOFTWARE ENVIRONMENT:

OPERATING SYSTEM : Windows XP

FRONT END : Visual Basic 6.0


BACK END : Microsoft Access 2003

REQUIREMENT ANALYSIS

 EXISTING SYSTEM

Following is the outline of the procedures presently followed by the


super markets withregard to the purchase and management of stocks.

THE WAREHOUSE PROCEDURES

The ware house personnels have to make a details study of the


stock available in the warehouse, this process is called stock taking.
This process has to be routinely performed on a weekly basis. Once the
stock taking has been performed, a list is furnished which provides the
status of the stocks held by the warehouse.

Based on this list the supervisors of the warehouse prepares a


second list of goods that are to be purchased by the warehouse. A
productwise order form or demand form is filled based on the
requirements. These Order forms are handed over to the vendors as
they visit the warehouse. One the stocks are delivered to the warehouse,
the vendor receives a cash voucher, which is exchanged for a cheque. As
the store demands goods, the requested goods are transferred to the
store.
THE STORE ACTIVITIES

The store perform the stock taking on a daily basis and provides a
list of items required by the store to the warehouse .
The end customers are provided with an electronic bill which is
generated by an electronic machine which is fed with the MRPs of the
products.
The existing system use the following resources .
 Ledgers.

 Basic electronic billing machine.

 Human Resources.

 Note books.

 Stationery items.
 PROBLEM DEFINATION

The essence of automation has been high lightened in every field.


During the past several years, there has been an increasing demand
within business for this need. Even the small organizations such as
Supermarkets have also felt this need. The following are the flaws in the
existing system which has to be given paramount importance during the
development of the system.

 Details about the vendor


 Details about the product i.e. cost price, selling price (MRP),
Expiry date, profit.
 Flow of cash
 Flow of goods from warehouse to store, and store to customers
 Store and warehouse running out to stock

In a nutshell, a specific deficiencies with the present system has been


identified in areas such as manual recording keeping, stock taking
procedures is time consuming and there is a wanton waste of time and
manpower involved in the maintenance of stock.
PROPOSED SYSTEM

The proposed system was build keeping in mind all the pros and
cons of the existing system and give a centralised control over the entire
system

This assignment involves as we understand is the creation of a data


Base with the help of Microsoft access 2003 containing

 The list of vendors


 The list of products

The controlled flow of goods into the warehouse ,avoiding the dumping
of goods by vendors

The information about the goods running out of stock both in the
warehouse and store

Maintain a proper account of the flow of cash

Producing electronic bill and synchronizing it with the availability of the


goods in the store.
Software engineering paradigm applied
The basic objective of Software Engineering is to develop methods and
procedures for software development that can scale up for large system
and that can be used to consistently produce high quality software at a
low cost and with a small frame of time

The modal that was applied for this project is evolution development
model throw away
Prototype.

The following are the reasons that convinced us to choose this model as
the apt model for the development of our system
*limited spefications or requirements were laid down for the
development of the system
*reduce lifecycle cost
*to get better understanding about the requirments
*the limited time frame

PROTOTYPING
The process of throw away prototyping was used to develop the system
incrementally while obtaining feed back along the way. This approach
was chosen since the system specification was very abstract to the users
and they were not accustomed to articulating their requirements for the
system.
Preliminary sketch was prepared to give and idea of the actual system to
be developed with the design of the menus and the various tables
required in the process with the respective key fields , field names.

This enhanced the understanding of the proposed system


This prototype was then refined to reflect the user requirements
Once the design was convencing the design was modularized . initiating
the coding process….
DATA FLOW DIAGRAM

LEVEL 1:

Vendor Warehouse

Store Bill
LEVEL 2:

Bank

Warehouse Store

Vendor Product
registration registratio Issue
cheque purchase Bill
n
LEVEL 3:
Registration

Vendor Product

Warehouse

Cheque issue
Store

Bank

Customer Bill Detail


DATABASE DESIGN

TABLE NAME : BankAccount_Table


PRIMARY KEY : Nil

FIELD NAME TYPE


Date Date/Time
Particulars Text
Amt_Withdrawn(Dr) Number
Amt_Deposited(Cr) Number
Balance Number

TABLENAME : BUSES
PRIMARY KEY : TRIP CODE

FIELD NAME TYPE WIDTH DESCRIPTION


TRIPCODE VARCHAR 50 TRIP CODE
VIAROUTE VARCHAR 50 VIA ROUTE
CLASSOFSERVICE VARCHAR 50 SERVICE CLASS
Dept_time VARCHAR 50 ORIGIN TIME
Start_point VARCHAR 50 STARTING PLACE
ORIGIN VARCHAR 50 ORIGIN PLACE
DESTINATION VARCHAR 50 DESTINATION
PLACE
End_point VARCHAR 50 END PLACE
Adultcharge INTEGER 20 ADULT FARE
Childcharge INTEGER 20 ADULT FARE

TABLENAME : CREDICTCARDINFO
PRIMARY KEY : CREDICTCARDNO

FIELD NAME TYPE WIDTH DESCRIPTION


TICKETNO VARCHAR 50 TICKET NUMBER
USERNAME VARCHAR 50 USER NAME
CREDITCARDTYPE VARCHAR 50 CREDICTCARD
TYPE
CREDICTCARDNO VARCHAR 50 CREDICTCARD
NUMBER
AMOUNT INTEGER 50 TOTAL FARE

TABLENAME : ENQUIRY
PRIMARY KEY : USERNAME

FIELD NAME TYPE WIDTH DESCRIPTION


USERNAME VARCHAR 50 USER NAME
SUBJECT VARCHAR 50 SUBJECT
DESCRIPTION VARCHAR 50 DEACRIPTION
ENQIURYDATE DATETIME 20 ENQUIRY DATE
TABLE NAME : REGISTERATION
PRIMARY KEY : USERNAME

FIELD NAME TYPE WIDTH DESCRIPTION


FULLNAME VARCHAR 50 USER FULL NAME
USERNAME VARCHAR 50 USER NAEM
PASSWORD VARCHAR 50 PASSWORD
GENDER VARCHAR 50 GENDER
STATUS VARCHAR 50 STATUS
DOB VARCHAR 50 DATEOFBIRTH
EMAIL VARCHAR 50 EMAIL ID
STREET VARCHAR 50 STREET ADDRESS
CITY VARCHAR 50 CITY
STATE VARCHAR 50 STATE
COUNTRY VARCHAR 50 COUNTRY
ZIP VARCHAR 50 PINCODE
PHONE VARCHAR 50 PHONE NUMBER
FAX VARCHAR 50 FAX
MOBILE VARCHAR 50 MOBILE NUMBER

TABLE NAME : TEMPJOURNEY


PRIMARY KEY : TRIPCODE
FIELD NAME TYPE WIDTH DESCRIPTION
Username VARCHAR 50 USER NAME
Tripcodeone VARCHAR 50 ONWARD TRIP
CODE
Tripcodereturn VARCHAR 50 RETURN TRIP
CODE
Journeydate VARCHAR 50 JOURNEY DATE
Returndate VARCHAR 50 RETURN DATE
Journeytime VARCHAR 50 JOURNEY TIME
Returntime VARCHAR 50 RETURN TIME
Origin VARCHAR 50 ORIGIN PLACE
Destination VARCHAR 50 DESTINATION
PLACE
Males VARCHAR 50 ADULT MALES
Females VARCHAR 50 ADULT FEMALES
Childmales VARCHAR 50 CHILD MALES
Childfemales VARCHAR 50 CHILD FEMALES
Seatsonward VARCHAR 50 NUMBER OF
ONWARD SEATS
Seatsreturn VARCHAR 50 NUMBER OF
RETURN SEATS
Adultcharge INTEGER 20 ADULT FARE
childcharge INTEGER 20 CHILD FARE

ABOUT ASP.NET LANGUAGE


ASP.NET is object oriented i.e., it revolves around ready mode objects
and controls. Each object has its own properties determining its color,
appearance and nature of an object.

The latest version of ASP is ASP 3.0. ASP.NET is the next generation of
ASP but not an upgraded version.

ASP.NET, the latest version of Active Server Pages, is Microsoft’s


technology for building dynamic, database driven web sites.

ASP.NET is one of the most popular languages for building scalable,


interactive web sites. Several of the highest traffic web sites of internet
employ ASP.NET. Prominent examples include The Home Shopping
Network, MSN and Microsoft itself.

ASP.NET represents a radical departure from previous version of


Active Server pages. Following are some of the significant features of
ASP.NET

• ASP.NET use compiled code written common and runtime


languages such as visual basic and C#. This doesn’t use
interpreted scripting language such as VBScript.
• ASP.NET pages are built out of server side controls. Web server
controls enable you to represent and program against Hypertext
Markup Language elements using an intuitive object model.

• ASP.NET includes a new technology called web services.

• ASP.NET is a part of Microsoft’s .NET Framework. You can


access thousands of .NET classes in your code that enable you to
perform diverse task.

• ASP.NET includes page and data caching mechanism that enable


you too easily and dramatically improve the performance.

.NET Framework

1. For the Microsoft .NET platform, the .NET Framework if the


infrastructure.

2. For building, deploying and running web applications and web

services, the .NET Frame work is an environment.

3. The .NET Framework contains common class libraries- like

ADO.NET, ASP.NET and windows forms- to provide advanced


standard services that can be integrated into a variety of computer
systems and a common language runtime.

4. The .NET Framework provides an easy integration between a


number of different development languages, a feature-rich
application environment, and simplified development.
5. The .NET Framework is language neutral and currently it
supports C++, C#, Visual Basic and JavaScript.

6. For the .NET Framework, Microsoft’s Visual Studio.NET is a


common development environment.

Advantages of using ASP.NET

• Improving development productivity by reducing the lines of code


to be written by 70% and also most of the frequently required
code is now available out of the box.

• To connect to new devices that may emerge in the future,


ASP.NET is making easier to use with existing devices like web
browsers, PDAs, Cell phones and so on with a potential.

• Increasing scalability and performance for developing fast web


applications platforms by providing facilities such as caching.

• Simplifying the management and administration of web


applications.

• For internet service providers, it provides enhanced hosting


opportunities.

• It ensures 100% backward compatibility.

C# Language
The goal of C# is to provide simple, safe, modern, object-oriented,
Internet-Centric, high performance language for .NET development. C#
is now a fully mature language and it draws on the lessons learned over
the past three decades. In much the way you can easily see in C# the
influence of Java, C++, Visual Basic and other languages. The focus of
C# is its use as a tool for programming on .NET platform, specifically
and especially with Visual Studio .NET 2005.

SQL SERVER

The database which has been used in this project is SQL Server 2005.

It provides a easy way to write the commands and execute it. SQL
Server provides a framework to .NET.

CODING

Code Efficiency
Efficiency is the key to production-quality code. Efficient code
means that a minimum of execution time, RAM resources, ROM
resources and stack size is required to run the code on an embedded
processor. Target link meets these high standards for production-quality
code generation through a variety of technological innovations. Target
link code optimization capabilities generally fall into 3 groups:

• Standard optimizations
• Interblock optimization
• Code pattern libraries

Code optimization, i.e. how to construct high performance computer


programs which use the hardware resources of the processor in an
efficient way. The goal of the course is to give an understanding of
how program instructions are executed by a modern processor and
how different high-level programming constructs affect the
performance of the program.

Validation checks
Some of the validations that are applied in this Reservation
System are that unauthorized access is denied and also makes the
system to close its application.

Other validations include:

1. No field be empty
2. White spaces are not accepted as values
3. No text characters can be entered in Numeric Fields.
4. No record is modified with an empty slot
5. The users entered will get their menus activated depending on
their designation.

SOURCE CODE
MEMBERSHIP FORM
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

public partial class _Default : System.Web.UI.Page


{
SqlConnection con = new SqlConnection("Data
source=.\\SQLEXPRESS;initial catalog=Transport;
Integrated Security=true");

protected void Page_Load(object sender,


EventArgs e)
{

protected void bttregister_Click(object sender,


EventArgs e)
{
con.Open();
string sql = "insert into registration
values('" + txtuserfullname.Text + "','" +
txtusername.Text + "','" + txtpassword.Text + "','"
+ drdgender.SelectedItem + "','" +
drdstatus.SelectedItem + "','" +
txtdateofbirth.Text + "','" + txtemailaddress.Text
+ "','" + txtstreetaddress.Text + "','" +
txtcity.Text + "','" + txtstate.Text + "','" +
drdcountry.SelectedItem + "','" + txtpostalno.Text
+ "','" + txtphoneno.Text + "','" + txtfaxno.Text +
"','" + txtmobileno.Text + "')";

SqlCommand cmd = new SqlCommand(sql,


con);
cmd.ExecuteNonQuery();
Page.ClientScript.RegisterStartupScript
(this.GetType(), "me", "alert('Congratulation!!!!
')", true);

con.Close();
}
}

LOGIN FORM

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

public partial class login : System.Web.UI.Page


{
SqlConnection con = new SqlConnection("Data
source=.\\SQLEXPRESS;initial catalog=Transport;
Integrated Security=true");

static string a, b;
protected void Page_Load(object sender,
EventArgs e)
{

protected void bttnewuser_Click(object sender,


EventArgs e)
{
Response.Redirect("member.aspx");
}
protected void lnkterms_Click(object sender,
EventArgs e)
{
Response.Redirect("terms.aspx");
}
protected void btthelp_Click(object sender,
EventArgs e)
{
Response.Redirect("help.aspx");
}
protected void bttsignin_Click(object sender,
EventArgs e)
{
Session["ksrtc"] = txtuser.Text;

con.Open();

string sql = "select username,password from


registration where username='" + txtuser.Text +
"'";

SqlCommand cmd = new SqlCommand(sql, con);


SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
a = dr[0].ToString();
b = dr[1].ToString();
}
if (a ==txtuser.Text && b ==
txtpassword.Text)
{
if (chbterms.Checked == true)
{
Response.Redirect("welcome.aspx");
}
else
{
Page.ClientScript.RegisterStartupSc
ript(this.GetType(), "me", "alert('Please check
terms and condition')", true);
}
}
else if (a!= txtuser.Text )
{
Page.ClientScript.RegisterStartupScript
(this.GetType(), "me", "alert('Please enter correct
user name')", true);
}
else
{
Page.ClientScript.RegisterStartupScript
(this.GetType(), "me", "alert('Please enter correct
password')", true);
}

con.Close();

}
protected void bttreset_Click(object sender,
EventArgs e)
{
txtuser.Text = "";
txtpassword.Text = "";
}
}
WELCOME FORM

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class welcome : System.Web.UI.Page
{

protected void Page_Load(object sender,


EventArgs e)
{

if ((Session["KSRTC"] == "") ||
(Session["KSRTC"] == null))
{
Response.Redirect("login.aspx");
}

SqlConnection con = new SqlConnection("Data


source=.\\SQLEXPRESS;initial catalog=Transport;
Integrated Security=true");
con.Open();

String sql = null;


sql = "delete from tempjourney where
username='" + Session["KSRTC"] + "'";
SqlCommand cmd = new SqlCommand(sql, con);
cmd.ExecuteNonQuery();
con.Close();

lblmsg.Text = Session["KSRTC"].ToString();
}

protected void bttsignout_Click(object sender,


EventArgs e)
{
Response.Redirect("signout.aspx");
}
protected void bttadvance_Click(object sender,
EventArgs e)
{
Response.Redirect("search.aspx");
}
protected void bttticketcancel_Click(object
sender, EventArgs e)
{
Response.Redirect("deletebooking.aspx");
}

protected void bttprepost_Click(object sender,


EventArgs e)
{
Response.Redirect("pre.aspx");
}
protected void bttenquiry_Click(object sender,
EventArgs e)
{
Response.Redirect("enquiry.aspx");
}
protected void bttenquiry_Click1(object sender,
EventArgs e)
{
Response.Redirect("enquiry.aspx");
}
}
SEARCH FORM

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

public partial class search : System.Web.UI.Page


{
public Boolean isDate(String dt)
{

//Response.Write(dt.Length + "<br>");
if (dt.Length == 10)
{
for (int i = 0; i < dt.Length; i++)
{
if (dt.Substring(i, 1) != "/")
{
//Response.Write(dt.Substring(i
,1) + "<br>");
if ((dt.Substring(i, 1) != "0")
&&
(dt.Substring(i, 1) != "1")
&&
(dt.Substring(i, 1) != "2")
&&
(dt.Substring(i, 1) != "3")
&&
(dt.Substring(i, 1) != "4")
&&
(dt.Substring(i, 1) != "5")
&&
(dt.Substring(i, 1) != "6")
&&
(dt.Substring(i, 1) != "7")
&&
(dt.Substring(i, 1) != "8")
&&
(dt.Substring(i, 1) != "9")
)
{
return false;
}

}
}
else
{
return false;
}
return true;
}

public String isValidEntry(String dt)


{

String[] jr = dt.Split('/');

try
{
int intyear =
Int32.Parse(jr[2].ToString());
if (DateTime.Now.Year < intyear)
{
return "Year is greater than
current year.";
}
if (DateTime.Now.Year > intyear)
{
return "Year is less than current
year.";
}
int intmonth =
Int32.Parse(jr[1].ToString());
if (intmonth < DateTime.Now.Month)
{
return "Month is less than current
Month.";
}
if (intmonth > DateTime.Now.Month + 3)
{
return "Month is greater than valid
advance booking date.";
}

int intday =
Int32.Parse(jr[0].ToString());
if (intmonth == DateTime.Now.Month)
{
if (intday < DateTime.Now.Day)
{
return "Day is less than
Current Month's booking date.";
}
}
}
catch(IndexOutOfRangeException e)
{
return "Date Should be in dd/mm/yyyy
format....";
}
return "success";
}
//SqlConnection con = new
SqlConnection("Server=SQLOLEDB.1;Persist Security
Info=False;User ID=sa;password=sql2005;Initial
Catalog=asp;Data Source=USER");

protected void Page_Load(object sender,


EventArgs e)
{
if (!(IsPostBack))
{
rboneway.Checked = true;
}

if (Session["ksrtc"] == null) {

Page.ClientScript.RegisterStartupScript
(this.GetType(), "me", "alert('Please Login before
making a booking')", true);
Response.Redirect("login.aspx");

}
Session.Timeout = 140;

SqlConnection con = new SqlConnection("Data


source=.\\SQLEXPRESS;initial catalog=Transport;
Integrated Security=true");
con.Open();
DataSet ds = new DataSet();
SqlDataAdapter da = new
SqlDataAdapter("select * from registration where
username='" + Session["ksrtc"].ToString() + "'",
con);
da.Fill(ds, "reg");
string s = ds.Tables["reg"].Rows[0]
["username"].ToString();
lblusername.Text = s;

con.Close();
if(rbreturn.Checked==true &&
rbreturn.AutoPostBack==true )
{
lblrtdate.Visible = true;
txtrtdate.Visible = true;
//lblrttime.Visible = true;
//drdrttime.Visible = true;
}
else if(rbreturn.Checked == false &&
rboneway.AutoPostBack==true)
{
lblrtdate.Visible = false;
txtrtdate.Visible = false;
//lblrttime.Visible = false;
//drdrttime.Visible = false;
}
con.Close();
}
protected void bttsignout_Click(object sender,
EventArgs e)
{
Response.Redirect("signout.aspx");
}
protected void bttclose_Click(object sender,
EventArgs e)
{
Response.Redirect("welcome.aspx");
}

protected void bttsearch_Click(object sender,


EventArgs e)
{
Boolean cont = true;
String errmsg = "";

String valid_dt =
isValidEntry(txtjrdate.Text);
if (valid_dt != "success")
{
cont = false;
errmsg = valid_dt;
}
if ((rbreturn.Checked == true)){
//cont = false;
if (isDate(txtrtdate.Text)){
cont = true;
}else{
cont = false;
errmsg = "Return date should be in
dd/mm/yyyy format";
}

String valid_dtrt =
isValidEntry(txtrtdate.Text);
if (valid_dtrt != "success")
{
cont = false;
errmsg = "Return Journey- " +
valid_dtrt;
}
}

if (drdorigin.SelectedItem.Value == "0")
{
cont = false;
errmsg = "Select Journey Start Point";
}

if (drdestination.SelectedItem.Value ==
"0")
{
cont = false;
errmsg = "Select Destination
Point";
}

if ((txtmale.Text == "") &&


(txtfemale.Text == ""))
{
cont = false;
errmsg = "Enter a value for adult
passengers.";
}

if (cont)
{
if (isDate(txtjrdate.Text))
{

cont = true;
}
else
{
cont = false;
errmsg = "Journey Date should
be in dd/mm/yyyy format";
}
}

Response.Write("errrrrr:" + errmsg);

if(cont) {
SqlConnection con = new SqlConnection("Data
source=.\\SQLEXPRESS;initial catalog=Transport;
Integrated Security=true");
con.Open();
int males = 0;
if (txtmale.Text != "")
{
males = Int32.Parse(txtmale.Text);
}
int females = 0;
if (txtfemale.Text != "")
{
females = Int32.Parse(txtfemale.Text);
}
int mal = 0;
if (txtmal.Text != "")
{
mal = Int32.Parse(txtmal.Text);
}
int fem = 0;
if (txtfem.Text != "")
{
fem = Int32.Parse(txtfem.Text);
}

String sqlclear = "delete from tempjourney


where username = '" + Session["KSRTC"] + "'";

SqlCommand cmdclear = new


SqlCommand(sqlclear, con);
cmdclear.ExecuteNonQuery();

if (rbreturn.Checked == true)
{

String sql = "insert into


tempjourney(username,journeydate,returndate,journey
time,returntime,origin,destination,males,females,ch
ildmales,childfemales) values('" +
Session["ksrtc"].ToString() + "','" +
txtjrdate.Text + "','" + txtrtdate.Text +
"','','','" + drdorigin.SelectedItem.Text + "','" +
drdestination.SelectedItem.Text + "'," + males +
"," + females + "," + mal + "," + fem + ")";

SqlCommand cmd = new SqlCommand(sql,


con);
cmd.ExecuteNonQuery();
Page.ClientScript.RegisterStartupScript
(this.GetType(), "me", "alert('Data Inserted
Succesfully')", true);
}
else if (rboneway.Checked == true)
{
SqlCommand cmd = new SqlCommand("insert
into
tempjourney(username,journeydate,journeytime,origin
,destination,males,females,childmales,childfemales)
values('" + Session["ksrtc"].ToString() + "','" +
txtjrdate.Text + "', '','','" +
drdestination.SelectedItem.Text + "'," + males +
"," + females + "," + mal + "," + fem + ")", con);
cmd.ExecuteNonQuery();
Page.ClientScript.RegisterStartupScript
(this.GetType(), "me", "alert('Data Inserted
Succesfully')", true);
}

con.Close();

Response.Redirect("available.aspx?rdate=" +
txtrtdate.Text + "&jdate=" + txtjrdate.Text +
"&origin=" + drdorigin.SelectedItem + "&dest=" +
drdestination.SelectedItem);
}
else{
lblerror.Text = errmsg;
}

AVAILABLE FORM1

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

public partial class available : System.Web.UI.Page


{
protected void Page_Load(object sender,
EventArgs e)
{

if (Session["ksrtc"] == null)
{

Page.ClientScript.RegisterStartupScript
(this.GetType(), "me", "alert('Please Login before
making a booking')", true);
Response.Redirect("login.aspx");

lblerror.Text = "";

lblmsg.Text = Session["ksrtc"].ToString();

SqlConnection con = new SqlConnection("Data


source=.\\SQLEXPRESS;initial catalog=Transport;
Integrated Security=true");
con.Open();
DataSet ds = new DataSet();
String sql = "select * from buses where
origin='" + Request.QueryString["origin"] + "' and
destination='" + Request.QueryString["dest"] + "'";
SqlCommand cmd = new SqlCommand(sql,con);
SqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
{
gdvavailable.DataSource = dr;
gdvavailable.DataBind();

}else
{

lblerror.Text = "There are no buses


available on this route. <a href='javascript:
history.back();'> Go Back </a>";

lbljr.Text = Request.QueryString["jdate"];
lbljr.Visible = true;
lblstpoint.Text =
Request.QueryString["origin"];
lblepoint.Text =
Request.QueryString["dest"];

con.Close();
}
protected void bttsignout_Click(object sender,
EventArgs e)
{
Response.Redirect("signout.aspx");
}
protected void bttsubmit_Click(object sender,
EventArgs e)
{
Response.Redirect("seat.aspx");
}
protected void bttgoback_Click(object sender,
EventArgs e)
{
Response.Redirect("search.aspx");
}
protected void bttclose_Click(object sender,
EventArgs e)
{
Response.Redirect("welcome.aspx");
}
}

AVAILABLE FORM2

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

public partial class available1 :


System.Web.UI.Page
{
protected void Page_Load(object sender,
EventArgs e)
{
if (Session["ksrtc"] == null)
{

Page.ClientScript.RegisterStartupScript
(this.GetType(), "me", "alert('Please Login before
making a booking')", true);
Response.Redirect("login.aspx");

}
lblmsg.Text = Session["ksrtc"].ToString();
SqlConnection con = new SqlConnection("Data
source=.\\SQLEXPRESS;initial catalog=Transport;
Integrated Security=true");
con.Open();

String sql = "select * from buses where


origin='" + Request.QueryString["origin"] + "' and
destination='" + Request.QueryString["dest"] + "'";
SqlCommand cmd = new SqlCommand(sql, con);
SqlDataReader dr = cmd.ExecuteReader();

if (dr.HasRows)
{
gdreturntrip.DataSource = dr;
gdreturntrip.DataBind();

}
else
{

lblerror.Text = "There are no buses


available on this route. <a href='javascript:
history.back();'> Go Back </a>";

lbljr.Text = Request.QueryString["jdate"];
lbljr.Visible = true;
lblstpoint.Text =
Request.QueryString["origin"];
lblepoint.Text =
Request.QueryString["dest"];

con.Close();
}
protected void bttsignout_Click(object sender,
EventArgs e)
{
Response.Redirect("signout.aspx");
}
protected void bttsubmit_Click(object sender,
EventArgs e)
{
Response.Redirect("seat.aspx");
}
protected void bttgoback_Click(object sender,
EventArgs e)
{
Response.Redirect("search.aspx");
}
protected void bttclose_Click(object sender,
EventArgs e)
{
Response.Redirect("welcome.aspx");
}
}

SEAT FORM1

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class seat : System.Web.UI.Page
{
int seatcount = 0;
String returndate = null;
String destination = null;
String origin = null;

protected void Page_Load(object sender,


EventArgs e)
{
if (Session["ksrtc"] == null)
{

Page.ClientScript.RegisterStartupScript
(this.GetType(), "me", "alert('Please Login before
making a booking')", true);
Response.Redirect("login.aspx");

SqlConnection con = new SqlConnection("Data


source=.\\SQLEXPRESS;initial catalog=Transport;
Integrated Security=true");
con.Open();

SqlDataReader dr;

String sqlonward = null;

sqlonward = "select
males,females,childmales,childfemales,journeydate,r
eturndate,destination,origin from tempjourney where
username='" + Session["ksrtc"] + "'";
SqlCommand cmd = new SqlCommand(sqlonward,
con);
dr = cmd.ExecuteReader();

String jdate= null;

if (dr.Read())
{
jdate = dr[4].ToString();
returndate = dr[5].ToString();
destination = dr[6].ToString();
origin = dr[7].ToString();

seatcount =
Int32.Parse(dr[0].ToString()) +
Int32.Parse(dr[1].ToString()) +
Int32.Parse(dr[2].ToString()) +
Int32.Parse(dr[3].ToString());

dr.Close();

String sql = "select seat_no from bookings


where tripcode='" + Request.QueryString["id"] + "'
and dateofjourney = '" + jdate + "'";

SqlDataReader dr1;

SqlCommand cmd1 = new SqlCommand(sql, con);


dr1 = cmd1.ExecuteReader();
String[] seatarr= null;
String seats = null;
int count=0;

while (dr1.Read())
{
seats = dr1[0].ToString();

seatarr = seats.Split(',');

for (int i = 0; i <= seatarr.Length -


1; i++)
{
switch (Int32.Parse(seatarr[i]))

{
case 1: CheckBox1.Visible =
false;
TextBox1.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 2: CheckBox2.Visible =
false;
TextBox2.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 3: CheckBox3.Visible =
false;
TextBox3.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 4: CheckBox4.Visible =
false;
TextBox4.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 5: CheckBox5.Visible =
false;
TextBox5.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 6: CheckBox6.Visible =
false;
TextBox6.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 7: CheckBox7.Visible =
false;
TextBox7.BackColor =
System.Drawing.Color.DarkBlue;
break;
case 8: CheckBox8.Visible =
false;
TextBox8.BackColor =
System.Drawing.Color.DarkBlue;
break;
case 9: CheckBox9.Visible =
false;
TextBox9.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 10: CheckBox10.Visible =


false;
TextBox10.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 11: CheckBox11.Visible =


false;
TextBox11.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 12: CheckBox12.Visible =


false;
TextBox12.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 13: CheckBox13.Visible =


false;
TextBox13.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 14: CheckBox14.Visible =


false;
TextBox14.BackColor =
System.Drawing.Color.DarkBlue;
break;
case 15: CheckBox15.Visible =
false;
TextBox15.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 16: CheckBox16.Visible =


false;
TextBox16.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 17: CheckBox17.Visible =


false;
TextBox17.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 18: CheckBox18.Visible =


false;
TextBox18.BackColor =
System.Drawing.Color.DarkBlue;
break;
case 19: CheckBox19.Visible =
false;
TextBox19.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 20: CheckBox20.Visible =


false;
TextBox20.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 21: CheckBox21.Visible =


false;
TextBox21.BackColor =
System.Drawing.Color.DarkBlue;
break;
case 22: CheckBox22.Visible =
false;
TextBox22.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 23: CheckBox23.Visible =


false;
TextBox23.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 24: CheckBox24.Visible =


false;
TextBox24.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 25: CheckBox25.Visible =


false;
TextBox25.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 26: CheckBox26.Visible =


false;
TextBox26.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 27: CheckBox27.Visible =


false;
TextBox27.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 28: CheckBox28.Visible =


false;
TextBox28.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 29: CheckBox29.Visible =


false;
TextBox29.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 30: CheckBox30.Visible =


false;
TextBox30.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 31: CheckBox31.Visible =


false;
TextBox31.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 32: CheckBox32.Visible =


false;
TextBox32.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 33: CheckBox33.Visible =


false;
TextBox33.BackColor =
System.Drawing.Color.DarkBlue;
break;

}
count++;
}

con.Close();

}
protected void bttsignout_Click(object sender,
EventArgs e)
{
Response.Redirect("signout.aspx");
}
protected void bttclose_Click(object sender,
EventArgs e)
{
Response.Redirect("welcome.aspx");

}
protected void bttgoback_Click(object sender,
EventArgs e)
{
Response.Redirect("search.aspx");
}
protected void bttsubmit_Click(object sender,
EventArgs e)
{
Response.Redirect("passenger.aspx");
}
protected void CheckBox29_CheckedChanged(object
sender, EventArgs e)
{

}
protected void CheckBox19_CheckedChanged(object
sender, EventArgs e)
{

}
protected void Button1_Click(object sender,
EventArgs e)
{

lblerror1.Text = "";
int count = 0;
String seatsbooked = null;

if (CheckBox1.Checked) {
if(seatsbooked == null){
seatsbooked = CheckBox1.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox1.Text;
}
count++;
}
if (CheckBox2.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox2.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox2.Text;
}
count++;
}
if (CheckBox3.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox3.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox3.Text;
}
count++;
}
if (CheckBox4.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox4.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox4.Text;
}
count++;
}
if (CheckBox5.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox5.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox5.Text;
}
count++;
}
if (CheckBox6.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox6.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox6.Text;
}
count++;
}
if (CheckBox7.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox7.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox7.Text;
}
count++;
}
if (CheckBox8.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox8.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox8.Text;
}

count++;
}
if (CheckBox9.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox9.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox9.Text;
}
count++;
}
if (CheckBox10.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox10.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox10.Text;
}
count++;
}
if (CheckBox11.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox11.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox11.Text;
}
count++;
}
if (CheckBox12.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox12.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox12.Text;
}
count++;
}
if (CheckBox13.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox13.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox13.Text;
}
count++;
}
if (CheckBox14.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox14.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox14.Text;
}
count++;
}
if (CheckBox15.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox15.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox15.Text;
}
count++;
}
if (CheckBox16.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox16.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox16.Text;
}
count++;
}
if (CheckBox17.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox17.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox17.Text;
}
count++;
}
if (CheckBox18.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox18.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox18.Text;
}
count++;
}
if (CheckBox19.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox19.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox19.Text;
}
count++;
}
if (CheckBox20.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox20.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox20.Text;
}
count++;
}
if (CheckBox21.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox21.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox21.Text;
}
count++;
}
if (CheckBox22.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox22.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox22.Text;
}
count++;
}
if (CheckBox23.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox23.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox23.Text;
}
count++;
}
if (CheckBox24.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox24.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox24.Text;
}
count++;
}
if (CheckBox25.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox25.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox25.Text;
}
count++;
}
if (CheckBox26.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox26.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox26.Text;
}
count++;
}
if (CheckBox27.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox27.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox27.Text;
}
count++;
}
if (CheckBox28.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox28.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox28.Text;
}
count++;
}
if (CheckBox29.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox29.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox29.Text;
}
count++;
}
if (CheckBox30.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox30.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox30.Text;
}
count++;
}
if (CheckBox31.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox31.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox31.Text;
}
count++;
}
if (CheckBox32.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox32.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox32.Text;
}
count++;
}
if (CheckBox33.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox33.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox33.Text;
}
count++;
}

if (((count > seatcount) || (count <


seatcount)) && (seatcount > 0))
{
lblerror1.Text = " Seats selected and
seats being booked are not equal...";
}
else
{
SqlConnection con = new
SqlConnection("Data source=.\\SQLEXPRESS;initial
catalog=Transport; Integrated Security=true");
con.Open();

String sqlupdate;

sqlupdate = "update tempjourney set


tripcodeone='" + Request.QueryString["id"] +
"',seatsonward='" + seatsbooked + "' where
username='" + Session["ksrtc"] + "'";
SqlCommand cmd = new
SqlCommand(sqlupdate, con);
cmd.ExecuteNonQuery();

con.Close();

if (returndate.Equals(""))
{
Response.Redirect("payment.aspx");

}
else
{
Response.Redirect("available1.aspx?
dest=" + origin + "&jdate=" + returndate +
"&origin=" + destination);
}

}
}

SEAT FORM2

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

public partial class seat1 : System.Web.UI.Page


{
int seatcount = 0;

protected void Page_Load(object sender,


EventArgs e)
{
Session.Timeout = 140;
if (Session["ksrtc"] == null)
{

Page.ClientScript.RegisterStartupScript
(this.GetType(), "me", "alert('Please Login before
making a booking')", true);
Response.Redirect("login.aspx");

SqlConnection con = new SqlConnection("Data


source=.\\SQLEXPRESS;initial catalog=Transport;
Integrated Security=true");
con.Open();

SqlDataReader dr;

String sqlonward = null;

sqlonward = "select
males,females,childmales,childfemales,returndate
from tempjourney where username='" +
Session["ksrtc"] + "'";
SqlCommand cmd = new SqlCommand(sqlonward,
con);
dr = cmd.ExecuteReader();

String jdate = null;

if (dr.Read())
{
jdate = dr[4].ToString();

seatcount =
Int32.Parse(dr[0].ToString()) +
Int32.Parse(dr[1].ToString()) +
Int32.Parse(dr[2].ToString()) +
Int32.Parse(dr[3].ToString());

dr.Close();

String sql = "select seat_no from bookings


where tripcode='" + Request.QueryString["id"] + "'
and dateofjourney = '" + jdate + "'";

SqlDataReader dr1;

SqlCommand cmd1 = new SqlCommand(sql, con);


dr1 = cmd1.ExecuteReader();
String[] seatarr = null;
String seats = null;
int count = 0;

while (dr1.Read())
{
seats = dr1[0].ToString();

seatarr = seats.Split(',');

for (int i = 0; i <= seatarr.Length -


1; i++)
{
switch (Int32.Parse(seatarr[i]))
{

case 1: CheckBox1.Visible =
false;
TextBox1.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 2: CheckBox2.Visible =
false;
TextBox2.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 3: CheckBox3.Visible =
false;
TextBox3.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 4: CheckBox4.Visible =
false;
TextBox4.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 5: CheckBox5.Visible =
false;
TextBox5.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 6: CheckBox6.Visible =
false;
TextBox6.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 7: CheckBox7.Visible =
false;
TextBox7.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 8: CheckBox8.Visible =
false;
TextBox8.BackColor =
System.Drawing.Color.DarkBlue;
break;
case 9: CheckBox9.Visible =
false;
TextBox9.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 10: CheckBox10.Visible =


false;
TextBox10.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 11: CheckBox11.Visible =


false;
TextBox11.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 12: CheckBox12.Visible =


false;
TextBox12.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 13: CheckBox13.Visible =


false;
TextBox13.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 14: CheckBox14.Visible =


false;
TextBox14.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 15: CheckBox15.Visible =


false;
TextBox15.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 16: CheckBox16.Visible =


false;
TextBox16.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 17: CheckBox17.Visible =


false;
TextBox17.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 18: CheckBox18.Visible =


false;
TextBox18.BackColor =
System.Drawing.Color.DarkBlue;
break;
case 19: CheckBox19.Visible =
false;
TextBox19.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 20: CheckBox20.Visible =


false;
TextBox20.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 21: CheckBox21.Visible =


false;
TextBox21.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 22: CheckBox22.Visible =


false;
TextBox22.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 23: CheckBox23.Visible =


false;
TextBox23.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 24: CheckBox24.Visible =


false;
TextBox24.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 25: CheckBox25.Visible =


false;
TextBox25.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 26: CheckBox26.Visible =


false;
TextBox26.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 27: CheckBox27.Visible =


false;
TextBox27.BackColor =
System.Drawing.Color.DarkBlue;
break;
case 28: CheckBox28.Visible =
false;
TextBox28.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 29: CheckBox29.Visible =


false;
TextBox29.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 30: CheckBox30.Visible =


false;
TextBox30.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 31: CheckBox31.Visible =


false;
TextBox31.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 32: CheckBox32.Visible =


false;
TextBox32.BackColor =
System.Drawing.Color.DarkBlue;
break;

case 33: CheckBox33.Visible =


false;
TextBox33.BackColor =
System.Drawing.Color.DarkBlue;
break;
}

count++;
}

con.Close();

}
protected void bttsignout_Click(object sender,
EventArgs e)
{
Response.Redirect("signout.aspx");
}
protected void bttclose_Click(object sender,
EventArgs e)
{
Response.Redirect("welcome.aspx");

}
protected void bttgoback_Click(object sender,
EventArgs e)
{
Response.Redirect("search.aspx");
}
protected void bttsubmit_Click(object sender,
EventArgs e)
{
Response.Redirect("passenger.aspx");
}
protected void CheckBox29_CheckedChanged(object
sender, EventArgs e)
{

}
protected void CheckBox19_CheckedChanged(object
sender, EventArgs e)
{

}
protected void Button1_Click(object sender,
EventArgs e)
{

lblerror1.Text = "";
int count = 0;
String seatsbooked = null;

if (CheckBox1.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox1.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox1.Text;
}
count++;
}
if (CheckBox2.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox2.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox2.Text;
}
count++;
}
if (CheckBox3.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox3.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox3.Text;
}
count++;
}
if (CheckBox4.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox4.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox4.Text;
}
count++;
}
if (CheckBox5.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox5.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox5.Text;
}
count++;
}
if (CheckBox6.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox6.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox6.Text;
}
count++;
}
if (CheckBox7.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox7.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox7.Text;
}
count++;
}
if (CheckBox8.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox8.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox8.Text;
}

count++;
}
if (CheckBox9.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox9.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox9.Text;
}
count++;
}
if (CheckBox10.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox10.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox10.Text;
}
count++;
}
if (CheckBox11.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox11.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox11.Text;
}
count++;
}
if (CheckBox12.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox12.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox12.Text;
}
count++;
}
if (CheckBox13.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox13.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox13.Text;
}
count++;
}
if (CheckBox14.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox14.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox14.Text;
}
count++;
}
if (CheckBox15.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox15.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox15.Text;
}
count++;
}
if (CheckBox16.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox16.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox16.Text;
}
count++;
}
if (CheckBox17.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox17.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox17.Text;
}
count++;
}
if (CheckBox18.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox18.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox18.Text;
}
count++;
}
if (CheckBox19.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox19.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox19.Text;
}
count++;
}
if (CheckBox20.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox20.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox20.Text;
}
count++;
}
if (CheckBox21.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox21.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox21.Text;
}
count++;
}
if (CheckBox22.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox22.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox22.Text;
}
count++;
}
if (CheckBox23.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox23.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox23.Text;
}
count++;
}
if (CheckBox24.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox24.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox24.Text;
}
count++;
}
if (CheckBox25.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox25.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox25.Text;
}
count++;
}
if (CheckBox26.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox26.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox26.Text;
}
count++;
}
if (CheckBox27.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox27.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox27.Text;
}
count++;
}
if (CheckBox28.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox28.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox28.Text;
}
count++;
}
if (CheckBox29.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox29.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox29.Text;
}
count++;
}
if (CheckBox30.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox30.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox30.Text;
}
count++;
}
if (CheckBox31.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox31.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox31.Text;
}
count++;
}
if (CheckBox32.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox32.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox32.Text;
}
count++;
}
if (CheckBox33.Checked)
{
if (seatsbooked == null)
{
seatsbooked = CheckBox33.Text;
}
else
{
seatsbooked = seatsbooked + "," +
CheckBox33.Text;
}
count++;
}

if (((count > seatcount) || (count <


seatcount)) && (seatcount > 0))
{
lblerror1.Text = seatcount + " Seats
checked are either less or more than the seats
being booked";
}
else
{
//lblerror1.Text = seatsbooked;
SqlConnection con = new
SqlConnection("Data source=.\\SQLEXPRESS;initial
catalog=Transport; Integrated Security=true");
con.Open();

String sqlupdate;

sqlupdate = "update tempjourney set


tripcodereturn='" + Request.QueryString["id"] +
"',seatsreturn='" + seatsbooked + "' where
username='" + Session["ksrtc"] + "'";
SqlCommand cmd = new
SqlCommand(sqlupdate, con);
cmd.ExecuteNonQuery();

con.Close();

Response.Redirect("payment.aspx");

}
}

PAYMENT FORM

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 payment : System.Web.UI.Page


{
int amount = 0;
int totalamount = 0;
protected void Page_Load(object sender,
EventArgs e)
{

SqlConnection conn = new


SqlConnection("Data source=.\\SQLEXPRESS;initial
catalog=Transport; Integrated Security=true");
conn.Open();

String sql;
sql = "select
t.origin,t.destination,t.journeydate,t.males,t.fema
les,t.childmales,t.childfemales,t.returndate,b.adul
tcharge,b.childcharge from tempjourney t,buses b
where t.username='" + Session["KSRTC"] + "' and
t.tripcodeone = b.tripcode";

SqlCommand cmd = new SqlCommand(sql,conn);


SqlDataReader dr;

dr = cmd.ExecuteReader();

if (dr.Read())
{

lblOriginval.Text = dr[0].ToString() + " /


" + dr[1].ToString();
lblDOJ.Text = dr[2].ToString();

if (!(dr[7].ToString().Equals("")))
{
lblOriginval.Text = lblOriginval.Text +
" (Return Journey) ";
lblDOJ.Text = dr[2].ToString() + "
( Return - " + dr[7].ToString() + " )";

int totaladultseats =
Int32.Parse(dr[3].ToString()) +
Int32.Parse(dr[4].ToString());
int totalchildseats =
Int32.Parse(dr[5].ToString()) +
Int32.Parse(dr[6].ToString());

int totalseats = totaladultseats +


totalchildseats;
int adultcharge =
Int32.Parse(dr[8].ToString());
int childcharge =
Int32.Parse(dr[9].ToString());

totalamount = ((adultcharge *
totaladultseats) + (childcharge *
totalchildseats));
amount = totalamount;

if (!(dr[7].ToString().Equals("")))
{
totalamount = totalamount * 2;
}

lblseats.Text = totalseats + " / " +


totalamount;

}
dr.Close();
conn.Close();

}
protected void Btnpay_Click(object sender,
EventArgs e)
{
if (Int32.Parse(txtamount.Text) >=
totalamount)
{
SqlConnection conn = new
SqlConnection("Data source=.\\SQLEXPRESS;initial
catalog=Transport; Integrated Security=true");
conn.Open();

String sql;

sql = "select * from tempjourney where


username='" + Session["KSRTC"] + "'";
SqlDataReader dr;
SqlCommand cmd = new SqlCommand(sql,
conn);

dr = cmd.ExecuteReader();

String val =
DateTime.UtcNow.ToString();
val = val.Replace("/", "");
val = val.Replace(" ", "");
val = val.Replace(":", "");
val = val.Replace("PM", "");
val = val.Replace("AM", "");

val = "T" + val;

if (dr.Read())
{

SqlConnection con = new


SqlConnection("Data source=.\\SQLEXPRESS;initial
catalog=Transport; Integrated Security=true");
con.Open();
sql = "insert into bookings
values('" + val + "','" + Session["KSRTC"] + "','"
+ dr[1].ToString() + "'," +
Int32.Parse(dr[9].ToString()) + "," +
Int32.Parse(dr[10].ToString()) + "," +
Int32.Parse(dr[11].ToString()) + "," +
Int32.Parse(dr[12].ToString()) + ",'" +
dr[3].ToString() + "','" + dr[13].ToString() + "',"
+ amount + ")";
SqlCommand cmdinsert = new
SqlCommand(sql, con);
cmdinsert.ExecuteNonQuery();
con.Close();

if (!(dr[4].ToString().Equals("")))
{

SqlConnection con1 = new


SqlConnection("Data source=.\\SQLEXPRESS;initial
catalog=Transport; Integrated Security=true");
con1.Open();
sql = "insert into bookings
values('" + val + "','" + Session["KSRTC"] + "','"
+ dr[2].ToString() + "'," +
Int32.Parse(dr[9].ToString()) + "," +
Int32.Parse(dr[10].ToString()) + "," +
Int32.Parse(dr[11].ToString()) + "," +
Int32.Parse(dr[12].ToString()) + ",'" +
dr[4].ToString() + "','" + dr[14].ToString() + "',"
+ amount + ")";
SqlCommand cmdreturn = new
SqlCommand(sql, con1);
cmdreturn.ExecuteNonQuery();
con1.Close();
}
}

dr.Close();
sql = "Delete from tempjourney where
username='" + Session["KSRTC"] + "'";
SqlCommand cmddelete = new
SqlCommand(sql, conn);
cmddelete.ExecuteNonQuery();

sql = "insert into creditcardinfo


values('" + val + "','" + Session["KSRTC"] + "','"
+ DDCCtype.SelectedItem.Value + "','" +
txtcreditcardno.Text + "'," + totalamount + ")";
SqlCommand cmdcredit = new
SqlCommand(sql, conn);

cmdcredit.ExecuteNonQuery();

conn.Close();

Response.Redirect("Thankyou.aspx?
ticket=" + val);
}
else
{
lblerror.Text = "Amount is less than
total amount";
}
}
}

TRAVEL SUMMARY FORM (THANKYOU)

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 Thankyou : System.Web.UI.Page


{
protected void Page_Load(object sender,
EventArgs e)
{
SqlConnection con = new SqlConnection("Data
source=.\\SQLEXPRESS;initial catalog=Transport;
Integrated Security=true");
con.Open();

SqlDataReader dr;

String sql = null;


int seatcount = 0;
int count = 0;

sql = "select
males,females,childmales,childfemales,seat_no,total
,dateofjourney,origin,destination from
bookings,buses where
bookings.tripcode=buses.tripcode and ticketno='" +
Request.QueryString["ticket"] + "'";
SqlCommand cmd = new SqlCommand(sql, con);
dr = cmd.ExecuteReader();

lblticketno.Text =
Request.QueryString["ticket"];

while (dr.Read())
{
count = count + 1;

if (count == 1)
{
seatcount =
Int32.Parse(dr[0].ToString()) +
Int32.Parse(dr[1].ToString()) +
Int32.Parse(dr[2].ToString()) +
Int32.Parse(dr[3].ToString());
lblseats.Text =
seatcount.ToString();

lblseatno.Text = dr[4].ToString();
lbltotal.Text = dr[5].ToString();
lbldate.Text = dr[6].ToString();
lblorigin.Text = dr[7].ToString();
lbldest.Text = dr[8].ToString();
}

if (count == 2)
{
seatcount =
Int32.Parse(dr[0].ToString()) +
Int32.Parse(dr[1].ToString()) +
Int32.Parse(dr[2].ToString()) +
Int32.Parse(dr[3].ToString());

lblseats.Text = lblseats.Text + "


(Onward) " + "---" + seatcount + " (Return) ";
lblseatno.Text = lblseatno.Text + "
(Onward) " + "---" + dr[4].ToString() + " (Return)
";
lbltotal.Text = lbltotal.Text + "
(Onward) " + "---" + dr[5].ToString() + " (Return)
";
lbldate.Text = lbldate.Text + "
(Onward) " + "---" + dr[6].ToString() + " (Return)
";
lblorigin.Text += " (Return) ";
}

dr.Close();
con.Close();

}
}

DELETEBOOKING FORM

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 deletebooking :


System.Web.UI.Page
{
protected void Page_Load(object sender,
EventArgs e)
{

}
protected void Button1_Click(object sender,
EventArgs e)
{
SqlConnection con = new SqlConnection("Data
Source=.\\SQLEXPRESS;initial
catalog=transport;integrated security=true");
con.Open();

String sql;
sql = "delete from bookings where
ticketno='" + TextBox1.Text + "'";

SqlCommand cmd = new SqlCommand(sql, con);


int rt = cmd.ExecuteNonQuery();

con.Close();

if (rt == 1)
{
Page.ClientScript.RegisterStartupScript
(this.GetType(), "me", "alert('Your ticket has been
cancelled!!!!');", true);

Response.Redirect("welcome.aspx");
}
else
{
Page.ClientScript.RegisterStartupScript
(this.GetType(), "me", "alert('Incorrect Ticket No.
Check the no. again!!!!')", true);
}

}
}
POSTPONMENT FORM

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Numeric;

public partial class pre : System.Web.UI.Page


{
protected void Page_Load(object sender,
EventArgs e)
{

}
public Boolean isDate(String dt)
{

//Response.Write(dt.Length + "<br>");
if (dt.Length == 10)
{
for (int i = 0; i < dt.Length; i++)
{
if (dt.Substring(i, 1) != "/")
{
//Response.Write(dt.Substring(i
,1) + "<br>");
if ((dt.Substring(i, 1) != "0")
&&
(dt.Substring(i, 1) != "1")
&&
(dt.Substring(i, 1) != "2")
&&
(dt.Substring(i, 1) != "3")
&&
(dt.Substring(i, 1) != "4")
&&
(dt.Substring(i, 1) != "5")
&&
(dt.Substring(i, 1) != "6")
&&
(dt.Substring(i, 1) != "7")
&&
(dt.Substring(i, 1) != "8")
&&
(dt.Substring(i, 1) != "9")
)
{
return false;
}

}
}
else
{
return false;
}
return true;
}

public String isReturnValid(String dt, String


dt1)
{
String[] jr = dt.Split('/');
String[] rt = dt1.Split('/');

try
{
int intyear =
Int32.Parse(jr[2].ToString());
int intyearreturn =
Int32.Parse(rt[2].ToString());
if (intyearreturn < intyear)
{
return "Return date is prior to
journey date.";
}
int intmonth =
Int32.Parse(jr[1].ToString());
int intmonthreturn =
Int32.Parse(rt[1].ToString());
if (intmonthreturn < intmonth)
{
return "Return date is prior to
journey date.";
}
int intday =
Int32.Parse(jr[0].ToString());
int intdayreturn =
Int32.Parse(rt[0].ToString());
if (intmonth == intmonthreturn)
{
if (intdayreturn < intday)
{
return "Return date is prior to
journey date.";
}
}
}
catch (IndexOutOfRangeException e)
{
return "Date Should be in dd/mm/yyyy
format....";
}
return "success";
}

public String isValidEntry(String dt)


{

String[] jr = dt.Split('/');

try
{
int intyear =
Int32.Parse(jr[2].ToString());
if (DateTime.Now.Year < intyear)
{
return "Year is greater than
current year.";
}
if (DateTime.Now.Year > intyear)
{
return "Year is less than current
year.";
}
int intmonth =
Int32.Parse(jr[1].ToString());
if (intmonth < DateTime.Now.Month)
{
return "Month is less than current
Month.";
}
if (intmonth > DateTime.Now.Month + 3)
{
return "Month is greater than valid
advance booking date.";
}

int intday =
Int32.Parse(jr[0].ToString());
if (intmonth == DateTime.Now.Month)
{
if (intday < DateTime.Now.Day)
{
return "Day is less than
Current Month's booking date.";
}
}
}
catch (IndexOutOfRangeException e)
{
return "Date Should be in dd/mm/yyyy
format....";
}
return "success";
}

protected void Button1_Click(object sender,


EventArgs e)
{

String valid_dt =
isValidEntry(txtonwardpre.Text);
String validorg_dt =
isValidEntry(txtonwardorg.Text);
if ((valid_dt == "success") && (validorg_dt
== "success"))
{
if((txtreturnpre.Text != "") &&
(txtreturnorg.Text != ""))
{
String validret_dt =
isValidEntry(txtreturnpre.Text);
String validretorg_dt =
isValidEntry(txtreturnorg.Text);
String validonwardreturn =
isReturnValid(txtonwardorg.Text,
txtreturnorg.Text);
String validreturn =
isReturnValid(txtreturnorg.Text,
txtreturnpre.Text);
if ((validret_dt == "success") &&
(validretorg_dt == "success"))
{
if ((validonwardreturn ==
"success") && (validreturn == "success")){
SqlConnection con = new
SqlConnection("Data Source=.\\SQLEXPRESS;initial
catalog=transport;integrated security=true");
con.Open();

String sql;
sql = "update bookings set
dateofjourney='" + txtonwardpre.Text + "' where
ticketno='" + txtticket.Text + "' and
dateofjourney='" + txtonwardorg.Text + "'";

SqlCommand cmd = new


SqlCommand(sql, con);
cmd.ExecuteNonQuery();

sql = "update bookings set


dateofjourney='" + txtreturnpre.Text + "' where
ticketno='" + txtticket.Text + "' and
dateofjourney='" + txtreturnorg.Text + "'";

SqlCommand cmd1 = new


SqlCommand(sql, con);
cmd1.ExecuteNonQuery();
con.Close();

Page.ClientScript.RegisterStartupSc
ript(this.GetType(), "me", "alert('Your ticket has
been updated.')", true);
Response.Redirect("welcome.aspx");
}
else
{
lblerror.Text = "Postponed
Return Date is prior to Original Journey Date...";
}
}
else
{
lblerror.Text = "Invalid Return
Date...";
}
}// end if return date null check
}
else
{
lblerror.Text = "Invalid Journey
date...";
}

ENQUIRY FORM

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 enquiry : System.Web.UI.Page


{
protected void Page_Load(object sender,
EventArgs e)
{

}
protected void Button1_Click(object sender,
EventArgs e)
{
if ((txtsubject.Text != "") &&
(txtdesc.Text != ""))
{
SqlConnection conn = new
SqlConnection("Data source=.\\SQLEXPRESS;initial
catalog=Transport; Integrated Security=true");
conn.Open();

String sql;
sql = "insert into
enquiry(username,subject,description) values('" +
Session["KSRTC"] + "','" + txtsubject.Text + "','"
+ txtdesc.Text + "')";

SqlCommand cmd = new SqlCommand(sql,


conn);
cmd.ExecuteNonQuery();
conn.Close();

Page.ClientScript.RegisterStartupScript
(this.GetType(), "me", "alert('Your Enquiry has
been sent... Our customer executive will get back
to you shortly.')", true);
Response.Redirect("thanks.aspx");
}
else
{
lblerror.Text = " Please fill the
subject and description fields...";
}

}
}

EDITMEMBERSHIP FORM
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

public partial class editmember :


System.Web.UI.Page
{
//SqlConnection con = new
SqlConnection("Server=SQLOLEDB.1;Persist Security
Info=False;User ID=sa;password=sql2005;Initial
Catalog=asp;Data Source=USER");

protected void Page_Load(object sender,


EventArgs e)
{
if ((Session["KSRTC"] == "") ||
(Session["KSRTC"] == null))
{
Response.Redirect("login.aspx");
}

SqlConnection con = new SqlConnection("Data


source=.\\SQLEXPRESS;initial catalog=Transport;
Integrated Security=true");
con.Open();

String Sql = "select * from registration


where username='" + Session["KSRTC"].ToString() +
"'";
SqlCommand cmd = new SqlCommand(Sql,con);
SqlDataReader dr = cmd.ExecuteReader();

if (dr.Read())
{
txtuserfullname.Text =
dr[0].ToString();
txtusername.Text = dr[1].ToString();
txtpassword.Text = dr[2].ToString();
drdgender.SelectedValue =
dr[3].ToString();
drdstatus.SelectedValue =
dr[4].ToString();
txtdateofbirth.Text = dr[5].ToString();
txtemailaddress.Text =
dr[6].ToString();
txtstreetaddress.Text =
dr[7].ToString();
txtcity.Text = dr[8].ToString();
txtstate.Text = dr[9].ToString();
drdcountry.SelectedValue =
dr[10].ToString();
txtpostalno.Text = dr[11].ToString();
txtphoneno.Text = dr[12].ToString();
txtfaxno.Text = dr[13].ToString();
txtmobileno.Text = dr[14].ToString();
}
dr.Close();
con.Close();

protected void bttregister_Click(object sender,


EventArgs e)
{
SqlConnection con = new
SqlConnection("Data source=.\\SQLEXPRESS;initial
catalog=Transport; Integrated Security=true");
con.Open();
string sql = "update registration set
fullname='" + txtuserfullname.Text + "',
username='" + txtusername.Text + "', password='" +
txtpassword.Text + "',gender='" +
drdgender.SelectedItem + "',status='" +
drdstatus.SelectedItem + "',dob='" +
txtdateofbirth.Text + "',email='" +
txtemailaddress.Text + "',street='" +
txtstreetaddress.Text + "',city='" + txtcity.Text +
"',state='" + txtstate.Text + "',country='" +
drdcountry.SelectedItem + "',zip='" +
txtpostalno.Text + "',phone='" + txtphoneno.Text +
"',fax='" + txtfaxno.Text + "',mobile='" +
txtmobileno.Text + "' where username='" +
Session["KSRTC"].ToString() + "'";

SqlCommand cmd = new SqlCommand(sql,


con);
cmd.ExecuteNonQuery();
con.Close();

Page.ClientScript.RegisterStartupScript
(this.GetType(), "me", "alert('Record Updated!!!!
')", true);

Response.Redirect("login.aspx");
}
}

CHANGE PASSWORD FORM

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 changepassword :


System.Web.UI.Page
{
protected void Page_Load(object sender,
EventArgs e)
{

}
protected void Button1_Click(object sender,
EventArgs e)
{
if ((txtold.Text == "") || (txtnew.Text ==
"") || (txtconfirm.Text == ""))
{
lblerror.Text = "Enter all the
fields.";
}
else if (txtnew.Text != txtconfirm.Text)
{ lblerror.Text = "Passwords
Mismatch.";
}
else
{
Boolean recordexists = false;
SqlConnection con = new
SqlConnection("Data source=.\\SQLEXPRESS;initial
catalog=Transport; Integrated Security=true");
con.Open();

String Sql = "select * from


registration where password='" + txtold.Text + "'";
SqlCommand cmd = new
SqlCommand(Sql,con);
SqlDataReader dr = cmd.ExecuteReader();

if (dr.Read())
{
recordexists = true;
}

dr.Close();

if (recordexists)
{
String sql1 = "update registration
set password='" + txtnew.Text + "' where
password='" + txtold.Text + "'";
SqlCommand cmd1 = new
SqlCommand(sql1, con);
cmd1.ExecuteNonQuery();

lblerror.Text = " Password


Updated.";
}
else
{
lblerror.Text = "Incorrect Old
Password. Please Try Again!!!";
}

con.Close(); } } }
SYSTEM TESTING
In software development project, errors can be injected at any stage
during the development. Testing performs a very critical role for quality
and for ensuring the reliability of software. During testing, the program
to be tested is executed with the set of test cases and the output of the
program for the test cases is evaluated to determine if the program is
performing as it is expected to. Due to its approach, dynamic testing can
only ascertain the presence of error in the program, the exact nature of
error is not usually decided by testing. Testing forms the first step in
determining the errors in the program. Clearly the success of testing in
revealing errors in programs depends critically on test cases.

Testing is usually relied upon to detect the faults taat occur during any
phase of the software development cycle, in addition to the errors that
occur during the coding phase itself. For this, different levels of testing
are used which perform different tasks and aim to test different aspects
of the system. The basic levels of testing are unit testing, integration
testing, system testing and acceptance testing. The different levels of
testing attempt to detect different types of faults.

Client Needs Acceptance Testing

Requirements System Testing

Design Integration Testing


Code Unit Testing

Test Plan

A Test Plan is a general document for the entire project, which defines
the scope approach to be taken, and the schedule of testing, as well as
identifying the test items for the entire testing process and the personnel
responsible for the different activities of testing commemces and can be
done in parallel with the coding and design phases. The inputs for the
test plan are:

• Project plan
• Requirements document
• System design document

The project plan is needed to make sure that the test is consistent with
overall plan for the project and testing schedule matches that of the
project plan, the requirements document and the design document. A
test plan should contain the following:

• Test unit specification


• Features to be tested
• Approach for testing
• Test deliverables
• Schedule

Test unit

It is a set of one or more modules together with associated data which


are the forms of a single system and objects of testing. It can occur at
any level and can contain from a single module to entire system. This is
acrried out at every stage of the project i.e. after completion of every
module features to be tested.
Include all software features and combinations of features to be tested.
It includes functionality, performance, design constraints and attributes.

Approach for testing specifies the overall approach to be followed in the


current project. This is some times called as testing criteria ot the
criterias evaluating the set of test cases used in testing process.

Testing delierables should be specified in the test plan, before the actual
testing begins. Deliverables could be a list of test cases that were used
such as detailed result of testing, test summary report, test log and data
about the code coverage.

Schedule specifies the amount of time and effort to be spent on different


activities of testing, and testing of different units have been identified.
UNIT TESTING:

Unit testing is a dynamic method for verification, where the programs is


actually compiled and executed. It is one of the most widely used
method, and coding phase is sometimes called “ Coding and unit testing
phase”, as in other forms of testing. Unit testing involves executing the
code with some test cases and then evaluating the results.

The goal of unit testing is to test modules or “units” and not the entire
software system. The programmer himself most oftem does unit testing.
After finishing the coding of a module, testing is performed. The tested
module is then delivered for further testing process.

SCOPE FOR FUTURE ENHANCEMENT

This application is designed to be generic. As we develop our site we


should take advantage of several areas in which we can improve and
customize online reservation system.
This application contains only few bus services available, in future many
more facilities can be added and make the software still more valuable.
Even the details about the bus time tables, staff details, present drivers
details etc.. can be added to this application.

SCREEN SHOTS

LOGIN FORM
MEMBERSHIP FORM
WELCOME FORM
ADVANCE TICKET BOOKING FORMS
TICKET CANCELLATION FORM
POSTPONMENT FORM
ENQUIRY FORM
EDIT REGISTERATION FORM
CHANGE PASSWORD FORM
SIGNOUT FORM
CONCLUSION

The software “Ticket Reservation System” has been developed in


Windows 98 environment using Visual Studio 2005 as front end and
SQL Server 2005 as back end. Time consumption reduced to a great
extent and the user as less complexity in handling database.

The project is full fledged and user friendly. End users will be lightened
in using this software because it is easy to reserve the tickets and most of
the entries are been selected from the database.
BIBLIOGRAPHY

1. URL:

• http://www.msdn.com
• http://www.dotnetspider.com
• http://www. msdn.microsoft.com.com
• http://www.google.com
• http://www.w3schools.com
• http://www.careerride.com/VB.NET-Framework-Interview.aspx
• http://en.wikipedia.org/wiki/ASP.NET

2. BOOKS
• Begning ASP.NET 3.5: in C#, by Imar Spaanjaars.
• Pro ASP.NET 3.5 in C# 2008, 2nd edition, By Mathew
MacDonald,Mario Szpuezta.
• Professional ASP.NET 3.5: in C#, By Bill Evjen, Scott
Hartselman.

S-ar putea să vă placă și