-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCheckAvailability.aspx.cs
150 lines (138 loc) · 5.65 KB
/
CheckAvailability.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Globalization;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace EventManagementSystem
{
public partial class CheckAvailability : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
/* Bitmap bmpOriginal = Bitmap.FromFile("~/Images/Event/Navigation1.png");
Bitmap bmpResampled = new Bitmap(200, 50);
Graphics g = Graphics.FromImage(bmpResampled);
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.Bilinear;
g.DrawImage(bmpOriginal, new Rectangle(0, 0, bmpResampled.Width + 1, bmpResampled.Height + 1));*/
}
protected void datetimepicker_TextChanged(object sender, EventArgs e)
{
String validation = datetimepicker.Text.ToString();
DateTime parsed;
bool valid = DateTime.TryParseExact(validation, "dd-MM-yyyy",
CultureInfo.InvariantCulture,
DateTimeStyles.None,
out parsed);
if (valid == true)
{
ddlVenue.Enabled = true;
if (ddlVenue.SelectedItem.Value.Equals("1"))
{
ddlVenue.Items.Remove(ddlVenue.Items.FindByText("Venue"));
ddlTime.Enabled = true;
ddlTime.Items.Add("08:00 - 10:00");
ddlTime.Items.Add("10:00 - 12:00");
ddlTime.Items.Add("12:00 - 14:00");
}
else if (ddlVenue.SelectedItem.Value.Equals("2"))
{
ddlVenue.Items.Remove(ddlVenue.Items.FindByText("Venue"));
ddlTime.Enabled = true;
ddlTime.Items.Add("08:30 - 10:30");
ddlTime.Items.Add("10:30 - 12:30");
ddlTime.Items.Add("12:30 - 14:30");
}
else if (ddlVenue.SelectedItem.Value.Equals("3"))
{
ddlVenue.Items.Remove(ddlVenue.Items.FindByText("Venue"));
ddlTime.Enabled = true;
ddlTime.Items.Add("08:15 - 10:15");
ddlTime.Items.Add("10:15 - 12:15");
ddlTime.Items.Add("12:15 - 14:15");
}
else if (ddlVenue.SelectedItem.Value.Equals("4"))
{
ddlVenue.Items.Remove(ddlVenue.Items.FindByText("Venue"));
ddlTime.Enabled = true;
ddlTime.Items.Add("08:00 - 10:00");
ddlTime.Items.Add("11:00 - 13:00");
ddlTime.Items.Add("16:00 - 18:00");
}
else
{
ddlTime.Enabled = false;
}
}
else
{
ddlVenue.Enabled = false;
ddlTime.Enabled = false;
}
}
protected void ddlVenue_SelectedIndexChanged(object sender, EventArgs e)
{
String validation = datetimepicker.Text.ToString();
DateTime parsed;
bool valid = DateTime.TryParseExact(validation, "dd-MM-yyyy",
CultureInfo.InvariantCulture,
DateTimeStyles.None,
out parsed);
if (valid == true)
{
ddlTime.Items.Clear();
ddlVenue.Enabled = true;
if (ddlVenue.SelectedItem.Value.Equals("1"))
{
ddlVenue.Items.Remove(ddlVenue.Items.FindByText("Venue"));
ddlTime.Enabled = true;
ddlTime.Items.Add("08:00 - 10:00");
ddlTime.Items.Add("10:00 - 12:00");
ddlTime.Items.Add("12:00 - 14:00");
}
else if (ddlVenue.SelectedItem.Value.Equals("2"))
{
ddlVenue.Items.Remove(ddlVenue.Items.FindByText("Venue"));
ddlTime.Enabled = true;
ddlTime.Items.Add("08:30 - 10:30");
ddlTime.Items.Add("10:30 - 12:30");
ddlTime.Items.Add("12:30 - 14:30");
}
else if (ddlVenue.SelectedItem.Value.Equals("3"))
{
ddlVenue.Items.Remove(ddlVenue.Items.FindByText("Venue"));
ddlTime.Enabled = true;
ddlTime.Items.Add("08:15 - 10:15");
ddlTime.Items.Add("10:15 - 12:15");
ddlTime.Items.Add("12:15 - 14:15");
}
else if (ddlVenue.SelectedItem.Value.Equals("4"))
{
ddlVenue.Items.Remove(ddlVenue.Items.FindByText("Venue"));
ddlTime.Enabled = true;
ddlTime.Items.Add("08:00 - 10:00");
ddlTime.Items.Add("11:00 - 13:00");
ddlTime.Items.Add("16:00 - 18:00");
}
else
{
ddlTime.Enabled = false;
}
}
else
{
ddlVenue.Enabled = false;
ddlTime.Enabled = false;
}
}
protected void btnProceed_Click(object sender, EventArgs e)
{
if (1==1) {
Response.Redirect("CreateEvent.aspx",false);
Context.ApplicationInstance.CompleteRequest();
}
}
}
}