PageRenderTime 14ms CodeModel.GetById 2ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

/BaliEnterpriseSystems/BaliEnterpriseSystems/Best.Master.cs

https://github.com/sirivedula/BEST
C# | 54 lines | 50 code | 4 blank | 0 comment | 10 complexity | 89702f4ead95f3e3d414dfb1e723f44f MD5 | raw file
 1using System;
 2using System.Collections;
 3using System.Configuration;
 4using System.Data;
 5using System.Linq;
 6using System.Web;
 7using System.Web.Security;
 8using System.Web.UI;
 9using System.Web.UI.HtmlControls;
10using System.Web.UI.WebControls;
11using System.Web.UI.WebControls.WebParts;
12using System.Xml.Linq;
13
14namespace BaliEnterpriseSystems
15{
16    public partial class Best : System.Web.UI.MasterPage
17    {
18        protected void Page_Init(object sender, EventArgs e)
19        {
20
21        }
22
23        protected void Page_Load(object sender, EventArgs e)
24        {
25            if (HttpContext.Current.Session["CurrentUser"] == null)
26            {
27                Response.Redirect("Logout.aspx");
28            }
29            else if ((!Utils.User.BestUser.IsLoggedIn) && Utils.User.BestUser.initialPassword)
30            {
31                Response.Redirect("InitialPasswordChage.aspx");
32            }
33            else if (!Utils.User.BestUser.IsLoggedIn)
34            {
35                Response.Redirect("NotLoggedIn.aspx");
36            }
37
38            ltrUserName.Text = Utils.User.BestUser.userName;
39            ltrMainMenu.Text = UtilMenu.MainMenu();
40            string CenterId = "";
41            if (HttpContext.Current.Session["UserCenter"] == null)
42            {
43                CenterId = Utils.User.BestUser.CurrentCenterId;
44                HttpContext.Current.Session["UserCenter"] = CenterId;
45            }
46            CenterId = HttpContext.Current.Session["UserCenter"].ToString();
47            if (string.IsNullOrEmpty(CenterId))
48            {
49                CenterId = "No Center Assigned";
50            }
51            ltrChangeCenter.Text = "<a href=\"ChangeCenter.aspx\" style=\"color:#fff;text-decoration:none;\"><img src=\"images/coins.png\" alt=\"center\" style=\"vertical-align:bottom;\"/>&nbsp;" + CenterId + "</a>";
52        }
53    }
54}