@namespace SZUAbsolventenverein.Module.EventRegistration @inherits ModuleBase @inject ISettingService SettingService @inject IStringLocalizer Localizer
@code { private string resourceType = "SZUAbsolventenverein.Module.EventRegistration.Settings, SZUAbsolventenverein.Module.EventRegistration.Client.Oqtane"; // for localization public override string Title => "EventRegistration Settings"; string _value; protected override async Task OnInitializedAsync() { try { Dictionary settings = await SettingService.GetModuleSettingsAsync(ModuleState.ModuleId); _value = SettingService.GetSetting(settings, "SettingName", ""); } catch (Exception ex) { AddModuleMessage(ex.Message, MessageType.Error); } } public async Task UpdateSettings() { try { Dictionary settings = await SettingService.GetModuleSettingsAsync(ModuleState.ModuleId); SettingService.SetSetting(settings, "SettingName", _value); await SettingService.UpdateModuleSettingsAsync(settings, ModuleState.ModuleId); } catch (Exception ex) { AddModuleMessage(ex.Message, MessageType.Error); } } }