-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDefault.aspx.cs
More file actions
53 lines (34 loc) · 1.36 KB
/
Default.aspx.cs
File metadata and controls
53 lines (34 loc) · 1.36 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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page {
private const int OFFERS = 6;
protected void Page_Load(object sender, EventArgs e) {
}
protected void Page_Init(object sender, EventArgs e) {
if (!IsPostBack) {
lblCompanies.Text = Company.Count().ToString();
lblOffers.Text = JobOffer.Count().ToString();
jobRepeater.DataSource = JobOffer.GetLatest(OFFERS);
jobRepeater.DataBind();
regionRepeater.DataSource = Region.GetRegions();
regionRepeater.DataBind();
Logger log;
if (Session["LoggerID"] != null && (log = Logger.GetLogger(Session["LoggerID"])) != null) {
if (log.IsUser) {
lblNewOffers.Text = log.CountOffers().ToString();
loggedViews.ActiveViewIndex = 1;
} else if (log.IsCompany) {
lblNewApplications.Text = log.CountApplications().ToString();
loggedViews.ActiveViewIndex = 2;
}
}
}
}
protected void lnkSearch_Click(object sender, EventArgs e) {
Response.Redirect(string.Format("joboffers.aspx?mode=browse&q={0}", txtQuery.Text));
}
}