private void SaveSessionInfo() { //Store new login in session Session["login"] = Utilities.GetEmployeeLoginById(txtEmployeeLookup.SelectedEmployeeID); Utilities.GetSetLoggedOnUser = Session["login"].ToString(); //Refresh security credentials //Access Role int current_user_security = AppSecurity.Get_Current_User_Access_Level(); Session["current_user_access_level"] = current_user_security.ToString(); AppSecurity.Current_Login_Security_Access_Level = current_user_security; //Accessible Sites string session_accessible_sites = AppSecurity.Get_Current_User_Accessible_Site(); Session["current_user_accessible_sites"] = session_accessible_sites; AppSecurity.Current_Login_Accessible_Sites = session_accessible_sites; //Reload logged on user lblLoggedOnUser.Text = "Welcome " + Utilities.GetEmployeeDisplayName(Utilities.GetLoggedOnUser()) + "!"; //Apply security to navigation. AppSecurity.Apply_CAIRS_Security_To_UserControls(menu.Controls); }
protected void Page_Load(object sender, EventArgs e) { SetDevHeaderMenuStyle(); string page = Path.GetFileName(Request.Path); if (!IsPostBack) { if (Session["login"] != null) { Utilities.GetSetLoggedOnUser = Session["login"].ToString(); } lblLoggedOnUser.Text = "Welcome " + Utilities.GetEmployeeDisplayName(Utilities.GetLoggedOnUser()) + "!"; menu.Visible = IsDisplayHideNavigation; divMenuPlaceHolder.Visible = !IsDisplayHideNavigation; bool Is_Security_Admin = AppSecurity.Is_User_Security_Admin(); lnkBtnChangeLogin.Visible = !Utilities.IsEnvironmentProductionMode() && Is_Security_Admin; //Apply security to navigation. AppSecurity.Apply_CAIRS_Security_To_UserControls(menu.Controls); } }