-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRecruiterViewApplication.aspx.cs
More file actions
218 lines (211 loc) · 8.44 KB
/
RecruiterViewApplication.aspx.cs
File metadata and controls
218 lines (211 loc) · 8.44 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
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
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 RecruiterViewApplication : System.Web.UI.Page
{
#region ObjectInstantiation
AFEVO afeVO = new AFEVO();
AFEBLO afeBLO = new AFEBLO();
File1VO file1VO = new File1VO();
File1BLO file1BLO = new File1BLO();
File2BLO file2BLO = new File2BLO();
File3BLO file3BLO = new File3BLO();
File4BLO file4BLO = new File4BLO();
File5BLO file5BLO = new File5BLO();
CandidateBLO candidateBLO = new CandidateBLO();
AnswerBLO answerBLO = new AnswerBLO();
QualificationBLO qualificationBLO = new QualificationBLO();
ProfessionalReferenceBLO professionalReferenceBLO = new ProfessionalReferenceBLO();
PersonalReferenceBLO personalReferenceBLO = new PersonalReferenceBLO();
#endregion
private int candidateId;
private int afeId;
protected void Page_PreInit(object sender, EventArgs e)
{
CheckRecruiterLogin();
}
protected void Page_Load(object sender, EventArgs e)
{
candidateId = int.Parse(Request.QueryString["cid"]);
afeId = afeBLO.SelectAFEIDOfCandidate(candidateId);
if (!Page.IsPostBack)
{
DataBindItems();
}
}
private void CheckRecruiterLogin()
{
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"))
{
Response.Redirect("PreboardingHome.aspx");
}
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("preboarder"))
{
btnPreboard.Visible = false;
}
else if (type.Equals("datamanager"))
{
Response.Redirect("DataManagerHome.aspx");
}
else if (type.Equals("admin"))
{
Response.Redirect("AdminHome.aspx");
}
}
else
{
Response.Redirect("index.aspx");
}
}
private void DataBindItems()
{
afeVO = afeBLO.SelectAFEOfCandidate(candidateId);
lblApplicationDate.Text = DateTime.Parse(afeVO.ApplicationDate).
ToString("MMMM d, yyyy");
lblPositionAppliedFor.Text = afeVO.PositionAppliedFor;
lblInterviewerName.Text = afeVO.InterviewerName;
file1VO = file1BLO.SelectFile1OfCandidateForPrint(candidateId);
lblName.Text = file1VO.FirstName
+ " “"
+ file1VO.NickName
+ "” "
+ file1VO.MiddleName
+ " "
+ file1VO.LastName
+ " "
+ file1VO.Affix;
lblApplicantMobileNumber.Text = file1VO.PresentTelephoneMobile;
lblApplicantEmailAddress.Text = candidateBLO.SelectCandidateEmail(candidateId);
lblApplicantDateOfBirth.Text = DateTime.Parse(file1VO.DateOfBirth).
ToString("MMMM d, yyyy");
lblApplicantPlaceOfBirth.Text = file1VO.PlaceOfBirth;
lblApplicantGender.Text = file1VO.Gender;
if (file1VO.CivilStatus != "Single")
{
lblApplicantCivilStatus.Text = file1VO.CivilStatus + " since " +
DateTime.Parse(file1VO.CivilStatusDate).ToString("MMMM d, yyyy");
}
else
{
lblApplicantCivilStatus.Text = file1VO.CivilStatus;
}
lblApplicantPresentAddress.Text =
file1VO.PresentAddress
+ ", "
+ file1VO.PresentCity
+ ", "
+ file1VO.PresentDistrict
+ ", "
+ file1VO.PresentCountry;
lblApplicantProvincialAddress.Text =
file1VO.ProvincialAddress
+ ", "
+ file1VO.ProvincialCity
+ ", "
+ file1VO.ProvincialDistrict
+ ", "
+ file1VO.ProvincialCountry;
lblApplicantHeight.Text = file1VO.Height;
lblApplicantWeight.Text = file1VO.Weight;
lblApplicantBloodType.Text = file1VO.BloodType;
gvEmployers.DataSource = file3BLO.SelectFile3OfCandidate(candidateId);
gvEmployers.DataBind();
gvOtherQualifications.DataSource = qualificationBLO.SelectQualificationOfAFE(afeId);
gvOtherQualifications.DataBind();
if (qualificationBLO.QualificationOfAFEHasOthers(afeId) == false)
{
gvOtherQualifications.Columns[2].Visible = false;
}
List<Label> answers = new List<Label>();
answers.Add(lblAnswer1);
answers.Add(lblAnswer2);
answers.Add(lblAnswer3);
answers.Add(lblAnswer4);
answers.Add(lblAnswer5);
answers.Add(lblAnswer6);
answers.Add(lblAnswer7);
List<Label> questions = new List<Label>();
questions.Add(lblQuestion1);
questions.Add(lblQuestion2);
questions.Add(lblQuestion3);
questions.Add(lblQuestion4);
questions.Add(lblQuestion5);
questions.Add(lblQuestion6);
questions.Add(lblQuestion7);
DataTable dt = new DataTable();
dt = answerBLO.SelectAnswerWithQuestionOfAFE(afeId);
for (int i = 0; i < dt.Rows.Count; i++)
{
questions[i].Text = dt.Rows[i]["question"].ToString();
if (dt.Rows[i]["answer"].ToString() == "False")
{
answers[i].Text = "No";
}
else if (dt.Rows[i]["answer"].ToString() == "True")
{
if (dt.Rows[i]["value"].ToString() != "")
{
answers[i].Text = "Yes: " + dt.Rows[i]["value"].ToString();
}
else if (dt.Rows[i]["relative_name"].ToString() != "" &&
dt.Rows[i]["company_name"].ToString() != "")
{
answers[i].Text = "Yes: " + dt.Rows[i]["relative_name"].ToString() +
" at " + dt.Rows[i]["company_name"].ToString();
}
}
}
gvDependents.DataSource = file5BLO.SelectFile5OfCandidate(candidateId);
gvDependents.DataBind();
gvProfessionalReferences.DataSource =
professionalReferenceBLO.SelectProfessionalReferenceOfAFE(afeId);
gvProfessionalReferences.DataBind();
gvPersonalReferences.DataSource =
personalReferenceBLO.SelectPersonalReferenceOfAFE(afeId);
gvPersonalReferences.DataBind();
}
protected void btnPreboard_Click(object sender, EventArgs e)
{
string email = candidateBLO.SelectCandidateEmail(candidateId);
candidateBLO.PreboardCandidate(candidateId, email);
Response.Redirect("RecruiterHome.aspx");
}
protected void btnBack_Click(object sender, EventArgs e)
{
Response.Redirect("RecruiterHome.aspx");
}
protected void btnDelete_Click(object sender, EventArgs e)
{
candidateBLO.DeleteCandidate(candidateId);
Response.Redirect("RecruiterHome.aspx");
}
}
}