Ejemplo n.º 1
0
        public ActionResult Index(OShopSettingsViewsModel model)
        {
            if (!Services.Authorizer.Authorize(OShopPermissions.ManageShopSettings, T("Not allowed to manage Shop Settings")))
                return new HttpUnauthorizedResult();

            var settings = Services.WorkContext.CurrentSite.As<OShopSettingsPart>();

            if (TryUpdateModel(settings)) {
                Services.Notifier.Information(T("OShop Settings saved successfully."));
            }
            else {
                Services.Notifier.Error(T("Could not save OShop Settings."));
            }

            return Index();
        }
Ejemplo n.º 2
0
        public ActionResult Index()
        {
            if(!Services.Authorizer.Authorize(OShopPermissions.ManageShopSettings, T("Not allowed to manage Shop Settings")))
                return new HttpUnauthorizedResult();

            var settings = Services.WorkContext.CurrentSite.As<OShopSettingsPart>();

            var model = new OShopSettingsViewsModel {
                CurrencyIsoCode = settings.CurrencyIsoCode,
                CurrencySymbol = settings.CurrencySymbol,
                CurrencyDecimalDigits = settings.CurrencyDecimalDigits,
                CurrencyNumberFormat = settings.CurrencyNumberFormat,
                CurrencyNumberFormats = GetNumberFormats(),
                CurrencyNegativePattern = settings.CurrencyNegativePattern,
                CurrencyPositivePatterns = GetCurrencyPositivePatterns(),
                CurrencyPositivePattern = settings.CurrencyPositivePattern,
                CurrencyNegativePatterns = GetCurrencyNegativePatterns()
            };

            return View(model);
        }