public ActionResult ChangeLanguage(int CurrentLangId) { if (SessionHandler.Instance.Get(SessionEnum.Language_Info) == null) { GlobalizationManager _GlobalizationManager = new GlobalizationManager(); SessionHandler.Instance.Set(_GlobalizationManager, SessionEnum.Language_Info); } // Set Language Information. ManageUserLanguage(CurrentLangId); //Fill View Model. Models.HomeVM_UI model = new Models.HomeVM_UI(); model.currentUser = SessionHandler.Instance.Get <UserViewModel>(SessionEnum.User_Info); return(RedirectToAction("Index", "home", new { LangId = CurrentLangId })); // }
public ActionResult Index() { //UserViewModel user = new UserViewModel(); if (SessionHandler.Instance.Get(SessionEnum.Language_Info) == null) { SessionHandler.Instance.Set(_GlobalizationManager, SessionEnum.Language_Info); } // Set Language Information. ManageUserLanguage(GetActiveLanguage()); Models.HomeVM_UI model = new Models.HomeVM_UI(); if (Session[SessionEnum.User_Info.ToString()] != null) { UserViewModel user = (UserViewModel)Session[SessionEnum.User_Info.ToString()]; // User session. model.currentUser = user; } return(View(model)); }
public ActionResult Index() { UserViewModel user = new UserViewModel(); if (SessionHandler.Instance.Get(SessionEnum.Language_Info) == null) { SessionHandler.Instance.Set(_GlobalizationManager, SessionEnum.Language_Info); } if (SessionHandler.Instance.Get(SessionEnum.User_Info) == null) { SessionHandler.Instance.Set(user, SessionEnum.User_Info); } // Set Language Information. ManageUserLanguage(GetActiveLanguage()); //Fill View Model. Models.HomeVM_UI model = new Models.HomeVM_UI(); var cuurentuser = SessionHandler.Instance.Get(SessionEnum.User_Info); return(View(model)); }