-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathselectsector.aspx.cs
More file actions
66 lines (60 loc) · 1.71 KB
/
selectsector.aspx.cs
File metadata and controls
66 lines (60 loc) · 1.71 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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class selectsector : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
// Response.Redirect("leaders.html");
if (Session["ttid"] == null)
{
Response.Redirect("index.aspx");
}
else
{
if (new User().IsSectorSelected(Convert.ToInt32(Session["ttid"])))
{
Response.Redirect("garage.aspx");
}
}
new User().CheckUsers();
}
protected void Unnamed_Click(object sender, EventArgs e)
{
if (Session["ttid"] != null)
{
int ttid = Convert.ToInt32(Session["ttid"]);
int i = Convert.ToInt16(hidden_server.Value);
if (i > 0 && i < 5)
{
new User().SelectSector(ttid, i);
if (new Cars().GetCarsOwnedByUser(ttid).Count == 0)
{
Response.Redirect("shop.aspx");
}
else
{
Response.Redirect("garage.aspx");
}
}
else
{
// user have changed the html. so show the error
}
}
else
{
Response.Redirect("index.aspx");
}
}
protected void lnk_click_Click(object sender, EventArgs e)
{
int ttid = Convert.ToInt32(Session["ttid"]);
int i = Convert.ToInt16(((LinkButton)sender).CommandArgument);
new User().SelectSector(ttid, i);
Response.Redirect("garage.aspx");
}
}