Пример #1
0
        public ActionResult ToggleFullText(GeneralCommonSettingsModel model)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings))
            {
                return(AccessDeniedView());
            }

            var commonSettings = _settingService.LoadSetting <CommonSettings>();

            try
            {
                if (!_fulltextService.IsFullTextSupported())
                {
                    throw new NopException(
                              _localizationService.GetResource(
                                  "Admin.Configuration.Settings.GeneralCommon.FullTextSettings.NotSupported"));
                }

                if (commonSettings.UseFullTextSearch)
                {
                    _fulltextService.DisableFullText();

                    commonSettings.UseFullTextSearch = false;
                    _settingService.SaveSetting(commonSettings);

                    SuccessNotification(
                        _localizationService.GetResource(
                            "Admin.Configuration.Settings.GeneralCommon.FullTextSettings.Disabled"));
                }
                else
                {
                    _fulltextService.EnableFullText();

                    commonSettings.UseFullTextSearch = true;
                    _settingService.SaveSetting(commonSettings);

                    SuccessNotification(
                        _localizationService.GetResource(
                            "Admin.Configuration.Settings.GeneralCommon.FullTextSettings.Enabled"));
                }
            }
            catch (Exception exc)
            {
                ErrorNotification(exc);
            }

            //selected tab
            SaveSelectedTabIndex();

            return(RedirectToAction("GeneralCommon"));
        }
Пример #2
0
 /// <summary>
 /// Disable Full-Text support
 /// </summary>
 public void DisableFullText()
 {
     _fulltextService.DisableFullText();
 }