-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapplication.aspx.cs
More file actions
64 lines (45 loc) · 2.09 KB
/
application.aspx.cs
File metadata and controls
64 lines (45 loc) · 2.09 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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class application : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Page_Init(object sender, EventArgs e) {
if (!IsPostBack) {
Logger log;
int id;
Application appl;
if (Request.QueryString["id"] == null || !int.TryParse(Request.QueryString["id"], out id) || (appl = global::Application.GetApplication(id)) == null) {
Response.Redirect("joboffers.aspx");
} else if (Session["LoggerID"] == null || (log = Logger.GetLogger(Session["LoggerID"])) == null || !log.IsCompany || appl.JobOffer.CompanyId != log.Company.ID) {
Response.Redirect(string.Format("joboffer.aspx?id={0}", appl.OfferId));
} else {
litTitle.Text = appl.JobOffer.Title;
lnkUser.CommandArgument = appl.UserId.ToString();
lnkTitle.Text = appl.JobOffer.Title;
lnkTitle.CommandArgument = appl.OfferId.ToString();
lnkImg.ImageUrl = string.Format("files/users/imgs/{0}", appl.User.ImageName);
lblFirstname.Text = appl.User.Firstname;
lblLastname.Text = appl.User.Lastname;
descrTextPanel.Text = string.Format("<p>{0}</p>\n", string.Join("</p>\n<p>", appl.User.Description.Split('\n')));
if (appl.User.ShowMail) {
mailPanel.Visible = true;
lblMail.Text = appl.User.Email;
}
lblPhone.Text = appl.User.Telephone;
tagPanel.Text = appl.User.TagPs;
motivationPanel.Text = string.Format("<p>{0}</p>\n", string.Join("</p>\n<p>", appl.Motivation.Split('\n')));
}
}
}
#region - Interaction -
protected void lnkUser_Command(object sender, CommandEventArgs e) {
Response.Redirect(string.Format("user.aspx?id={0}", e.CommandArgument));
}
#endregion
}