public BaseController() { try { FSCUserSession objSession = GetSession.GetSessionFromContext(); if (objSession != null) { ViewBag.UserName = objSession.UserName; } } catch (Exception exc) { throw exc; } }
public static bool InitialiseSession(Int64 UserId) { bool isSessionInitialised = false; FSCUserSession objFSCUserSession = new FSCUserSession(); try { FSCUserDetail userDetails = new ClsLogin().GetUserDetails(UserId); objFSCUserSession.UserId = userDetails.UserId; objFSCUserSession.UserName = userDetails.FirstName + " " + userDetails.LastName; HttpContext.Current.Session["UserDetails"] = objFSCUserSession; isSessionInitialised = true; } catch (Exception exc) { isSessionInitialised = false; throw exc; } return(isSessionInitialised); }