示例#1
0
        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 }));
            //
        }
示例#2
0
        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));
        }
示例#3
0
        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));
        }