Ejemplo n.º 1
0
        public string GetSetting(SettingsTitles title)
        {
            if (title == SettingsTitles.PRODUCT_TYPES_FIELD_NAME)
            {
                return("Type");
            }

            throw new NotImplementedException();
        }
Ejemplo n.º 2
0
 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");
     }
 }
Ejemplo n.º 3
0
        private bool GetBoolValue(SettingsTitles title, bool defaultValue)
        {
            var value = SettingsService.GetSetting(title);

            if (string.IsNullOrEmpty(value))
            {
                return(false);
            }
            else
            {
                return(bool.Parse(value));
            }
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
 public string GetSetting(SettingsTitles title)
 {
     return(GetSetting(title.ToString()));
 }
Ejemplo n.º 6
0
 private int GetIntValue(SettingsTitles title)
 {
     return(int.Parse(_settingsService.GetSetting(title)));
 }