Exemplo n.º 1
0
        public ActionResult Language(AdminLanguageSettingViewModel setting)
        {
            if (ModelState.IsValid)
            {
                using (var unitOfWork = UnitOfWorkManager.NewUnitOfWork())
                {
                    setting.AllLanguage = LocalizationService.GetBaseSelectListLanguages(LocalizationService.GetAll());

                    try
                    {
                        SettingsService.SetSetting("LanguageDefault", setting.LanguageDefault.ToString());


                        unitOfWork.Commit();
                    }
                    catch (Exception ex)
                    {
                        unitOfWork.Rollback();
                        LoggingService.Error(ex);
                    }
                }
            }



            return(View("Language", setting));
        }
Exemplo n.º 2
0
        public ActionResult Language()
        {
            var model = new AdminLanguageSettingViewModel
            {
                LanguageDefault = LocalizationService.DefaultLanguage.Id,
                AllLanguage     = LocalizationService.GetBaseSelectListLanguages(LocalizationService.GetAll())
            };

            return(View("Language", model));
        }