-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPreboardingHome.aspx.cs
More file actions
103 lines (98 loc) · 3.74 KB
/
PreboardingHome.aspx.cs
File metadata and controls
103 lines (98 loc) · 3.74 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
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CAPRES.ValueObjects;
using CAPRES.BusinessLogicObjects;
using System.Data;
namespace CAPRES
{
public partial class PreboardingHome : System.Web.UI.Page
{
protected void Page_PreInit(Object sender, EventArgs e)
{
CheckPreboardingLogin();
}
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
DataTable dt = new DataTable();
HRBLO hrBLO = new HRBLO();
dt = hrBLO.SelectAllPreboarders();
foreach (DataRow dr in dt.Rows)
{
blPreboarders.Items.Add(dr[0].ToString() + " " + dr[1].ToString()
+ " (" + dr[2].ToString() + ")");
}
}
}
private void CheckPreboardingLogin()
{
List<string> list;
if (Session["Candidate"] != null || Request.Cookies["Candidate"] != null)
{
list = (List<string>)Session["Candidate"];
string status = list == null
? Request.Cookies["Candidate"]["Status"] : list[1];
if (status.Equals("preboarding"))
{
this.MasterPageFile = "SmartStart.master";
int candidateId = list == null
? int.Parse(Request.Cookies["Candidate"]["ID"].ToString())
: int.Parse(list[0].ToString());
Label lblHeader = this.Master.FindControl("lblHeader") as Label;
lblHeader.Text = "PRE-EMPLOYMENT REQUIREMENTS";
Label lblUser = this.Master.FindControl("lblUser") as Label;
lblUser.Text = "Hello Candidate #" + candidateId;
}
else if (status.Equals("hiring"))
{
Response.Redirect("HiringHome.aspx");
}
else if (status.Equals("applicant") || status.Equals("pending"))
{
Response.Redirect("ApplicantHome");
}
}
else if (Session["HR"] != null || Request.Cookies["HR"] != null)
{
list = (List<string>)Session["HR"];
string type = list == null
? Request.Cookies["HR"]["Type"] : list[1];
if (type.Equals("recruiter"))
{
Response.Redirect("RecruiterHome.aspx");
}
else if (type.Equals("preboarder"))
{
Response.Redirect("PreboarderHome.aspx");
}
else if (type.Equals("datamanager"))
{
Response.Redirect("DataManagerHome.aspx");
}
else if (type.Equals("admin"))
{
this.MasterPageFile = "SmartStartAdmin.master";
string hrEmail = list == null
? Request.Cookies["HR"]["Email"] : list[0];
Label lblHeader = this.Master.Master.FindControl("lblHeader") as Label;
lblHeader.Text = "PRE-EMPLOYMENT REQUIREMENTS";
Label lblUser = this.Master.Master.FindControl("lblUser") as Label;
lblUser.Text = hrEmail;
}
}
else
{
Response.Redirect("index.aspx");
}
}
protected void btnStart_Click(object sender, EventArgs e)
{
Response.Redirect("ApplicantPersonalForm.aspx");
}
}
}