-
Notifications
You must be signed in to change notification settings - Fork 0
/
ListOfAppliedApplicants.aspx.cs
101 lines (85 loc) · 3.23 KB
/
ListOfAppliedApplicants.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
public partial class ListOfAppliedApplicants : System.Web.UI.Page
{
private int selectRow = 5;
protected void Page_Load(object sender, EventArgs e)
{
LoginModule myLoginModule = new LoginModule();
myLoginModule.checkLoginStatus();
myLoginModule.checkPermission(1);
JobsModule myJobsModule = new JobsModule();
if (!myJobsModule.doesJobBelongToUser((String)Session["userID"], Request["pId"]))
{
myLoginModule.checkPermission(3);
}
WelcomeLabel.Text = myLoginModule.getFirstName((String)Session["userID"]);
setTable();
}
protected void setTable()
{
SearchModule mySearchModule = new SearchModule();
DataTable myDataTable = new DataTable();
myDataTable = mySearchModule.ratedListOfApplicantsForJobPosition3(Request["pId"]).Copy();
myDataTable.Columns.Add("Select for Interview", typeof(String));
myDataTable.Columns.Add("Photo", typeof(String)).SetOrdinal(1);
ApplicantsListGridView.DataSource = myDataTable;
ApplicantsListGridView.DataBind();
foreach (GridViewRow row in ApplicantsListGridView.Rows)
{
HyperLink hp = new HyperLink();
hp.Text = row.Cells[2].Text;
hp.NavigateUrl = "~/SearchCandidates.aspx?userId=" + row.Cells[0].Text;
row.Cells[2].Controls.Add(hp);
CheckBox cb = new CheckBox();
row.Cells[selectRow].Controls.Add(cb);
row.Cells[1].Controls.Clear();
Image img = new Image();
img.ImageUrl = "~/ShowPhoto.aspx?userId=" + row.Cells[0].Text;
img.Height = 60;
row.Cells[1].Controls.Add(img);
}
}
protected void GridViewRowCreated(object sender, GridViewRowEventArgs e)
{
e.Row.Cells[0].Visible = false;
}
protected void RefreshRatingsButton_Click(object sender, EventArgs e)
{
RatingModule myRatingModule = new RatingModule(Request["pId"]);
setTable();
}
protected void SendForInterviewButton_Click(object sender, EventArgs e)
{
List<String> idList = new List<String>();
CheckBox cb = new CheckBox();
foreach (GridViewRow row in ApplicantsListGridView.Rows)
{
cb = (CheckBox)row.Cells[selectRow].Controls[0];
if (cb.Checked)
{
idList.Add(((GridViewRow)cb.NamingContainer).Cells[0].Text);
}
}
EmailModule myEmailModule = new EmailModule();
Employer emailSender = new Employer();
emailSender.sheduleAndCallForInterviews(idList, Request["pid"], StartingTimeTextBox.Text, DateTextBox.Text, VenueTextBox.Text);
/*
foreach (String applicantId in idList)
{
myEmailModule.sendEmailForInterview(applicantId, Request["pid"], "10.30AM", "06/06/2015", "Company Conference Hall");
}
*/
}
protected void Logout(object sender, EventArgs e)
{
Session["userID"] = null;
Session["prevPage"] = null;
Response.Redirect("~/WhereIsMyJob.aspx");
}
}