-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMovieShowtimes.aspx.cs
64 lines (58 loc) · 1.78 KB
/
MovieShowtimes.aspx.cs
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
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DBProject.DAL;
using System.Data;
namespace DBProject
{
public partial class MovieShowtimes : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string Temp = DropDownList1.SelectedValue.ToString();
if (Temp == "")
{
FillDropDownList();
}
}
private void FillDropDownList()
{
myDAL objmyDAL = new myDAL();
DataTable GetData = new DataTable();
objmyDAL.GetMovieData(ref GetData);
DropDownList1.DataSource = GetData;
DropDownList1.DataTextField = "MovieName";
DropDownList1.DataValueField = "MovieID";
if (GetData.Rows.Count > 0)
{
DropDownList1.DataBind();
}
}
public void FindShows(object sender, EventArgs e)
{
myDAL objmyDAL = new myDAL();
string MovieID = DropDownList1.Text.ToString();
DataTable GetData = new DataTable();
int found=objmyDAL.ViewMovieShows(MovieID,ref GetData);
if (found != 1)
{
Message.Text = "There was some error!";
}
else
{
ShowsGrid.DataSource = GetData;
if (GetData.Rows.Count > 0)
{
Message.Text = "Following shows are found:";
ShowsGrid.DataBind();
}
else
{
Message.Text = "No shows found:";
}
}
}
}
}