-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBook.aspx.cs
More file actions
72 lines (57 loc) · 1.94 KB
/
Book.aspx.cs
File metadata and controls
72 lines (57 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Book : System.Web.UI.Page
{
public string selectedbus;
public string seatsLeft;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
seats.Visible = false;
num_seats.Visible = false;
book.Visible = false;
companies.Items.Add("VRL Travels");
companies.Items.Add("Neeta Travels");
companies.Items.Add("Orange Travels");
source.Items.Add("Mumbai");
source.Items.Add("Delhi");
source.Items.Add("Chennai");
source.Items.Add("Bangalore");
destination.Items.Add("Mumbai");
destination.Items.Add("Delhi");
destination.Items.Add("Chennai");
destination.Items.Add("Bangalore");
for(int i = 0; i < 24; i++)
{
etime.Items.Add((i*100).ToString());
stime.Items.Add((i*100).ToString());
}
stime.SelectedIndex = 0;
etime.SelectedIndex = 23;
}
}
protected void selection_changed(object sender, EventArgs e)
{
seats.Visible = true;
num_seats.Visible = true;
book.Visible = true;
}
protected void Book_Ticket(object sender, EventArgs e)
{
string url = "Confirm.aspx?BusID=";
url += HttpUtility.UrlEncode(GridView1.SelectedRow.Cells[1].Text);
url += "&seatsLeft=";
url += HttpUtility.UrlEncode(GridView1.SelectedRow.Cells[7].Text);
url+="&seats=";
url += HttpUtility.UrlEncode(num_seats.Text);
Response.Redirect(url);
}
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
}
}