public string GetSetting(SettingsTitles title) { if (title == SettingsTitles.PRODUCT_TYPES_FIELD_NAME) { return("Type"); } throw new NotImplementedException(); }
private int GetContentId(SettingsTitles key) { if (int.TryParse(_settingsService.GetSetting(key), out int contentId)) { return(contentId); } else { throw new Exception($"Setting {key} must be a valid content id"); } }
private bool GetBoolValue(SettingsTitles title, bool defaultValue) { var value = SettingsService.GetSetting(title); if (string.IsNullOrEmpty(value)) { return(false); } else { return(bool.Parse(value)); } }
public string GetSettingStringValue(SettingsTitles key) { var valueStr = _settingsService.GetSetting(key); if (string.IsNullOrEmpty(valueStr)) { var result = new ActionTaskResultMessage() { ResourceClass = ResourceClass, ResourceName = nameof(RemoteValidationMessages.Settings_Missing), Parameters = new object[] { key } }; throw new ValidationException(result); } return(valueStr); }
public string GetSetting(SettingsTitles title) { return(GetSetting(title.ToString())); }
private int GetIntValue(SettingsTitles title) { return(int.Parse(_settingsService.GetSetting(title))); }