-
Notifications
You must be signed in to change notification settings - Fork 0
/
Site.master.cs
54 lines (47 loc) · 2.07 KB
/
Site.master.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
using System;
using System.Web.UI;
using System.Web;
public partial class Site : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Page.Header.DataBind();
if (HttpContext.Current.User.Identity.IsAuthenticated)
{
this.pnlLogIn.Visible = false;
this.pnlLogedIn.Visible = true;
this.lblUser.InnerHtml = string.Format("{0} {1}", Public.ActiveUserRole.User.Person.FirstName, Public.ActiveUserRole.User.Person.LastName);
switch ((Public.Role)Public.ActiveUserRole.RoleID)
{
case Public.Role.AjancyManager:
this.lblRole.InnerHtml = string.Format("{0} {1}", Public.GetRoleName(Public.ActiveUserRole.RoleID), Public.ActiveAjancy.AjancyName);
break;
case Public.Role.ProvinceManager:
case Public.Role.AcademyProvince:
this.lblRole.InnerHtml = string.Format("{0} {1}", Public.GetRoleName(Public.ActiveUserRole.RoleID), Public.ActiveUserRole.User.Province.Name);
break;
case Public.Role.CityManager:
case Public.Role.AcademyCity:
this.lblRole.InnerHtml = string.Format("{0} {1}", Public.GetRoleName(Public.ActiveUserRole.RoleID), Public.ActiveUserRole.User.City.Name);
break;
default:
this.lblRole.InnerHtml = Public.GetRoleName(Public.ActiveUserRole.RoleID);
break;
}
}
}
}
protected void LoginStatus1_LoggedOut(object sender, EventArgs e)
{
HttpContext.Current.Session.Abandon();
Response.Redirect("~/Default.aspx");
}
protected void lnkLogOut_Click(object sender, EventArgs e)
{
HttpContext.Current.Session.Abandon();
System.Web.Security.FormsAuthentication.SignOut();
Response.Redirect("~/Default.aspx");
}
}