-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTheatres.aspx.vb
47 lines (47 loc) · 1.94 KB
/
Theatres.aspx.vb
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
Imports System.Data.SqlClient
Partial Class Theatres
Inherits System.Web.UI.Page
Public Shared go As Integer = 0
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
chose.Visible = False
ok.Visible = False
End Sub
Protected Sub GridView1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles GridView1.SelectedIndexChanged
Dim Citycode As Integer
Citycode = Session("loccode")
Dim tname As String
tname = TryCast(GridView1.SelectedRow.FindControl("Theatre"), Label).Text
Dim time As String
time = TryCast(GridView1.SelectedRow.FindControl("Time"), Label).Text
If (tname.Length > 0) Then
chose.Visible = True
chose.Text = "You Chose " & tname & " at " & time & " Click Ok to proceed"
End If
Dim con As New SqlConnection
con.ConnectionString = "Data Source=HEWLETT-PACKARD\SQLEXPRESS;Initial Catalog=BookMyShow;Integrated Security=True"
con.Open()
Dim cmd As New SqlCommand("select TheatreID from Theatres where TheatreName ='" + tname + "' and LocCode= " & Citycode, con)
Dim sdr As SqlDataReader = cmd.ExecuteReader()
Dim tcode As Integer
While sdr.Read = True
tcode = sdr.Item("TheatreID")
End While
Session("tcode") = tcode
Session("time") = time
Dim mcode As Integer = Request.QueryString("mcode")
Session("mcode") = mcode
ok.Visible = True
go = 1
con.Close()
sdr.Dispose()
sdr.Close()
End Sub
Protected Sub ok_Click(sender As Object, e As EventArgs) Handles ok.Click
If (go = 1) Then
Response.Redirect("class.aspx")
End If
End Sub
Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Response.Redirect("loginpage.aspx")
End Sub
End Class