private void ValidateValue(GlobalSettingType type, String value)
        {
            switch (type)
            {
            case GlobalSettingType.String:
                break;

            case GlobalSettingType.Int:
                ValidateIntValue(value);
                break;

            case GlobalSettingType.Decimal:
                ValidateDecimalValue(value);
                break;

            case GlobalSettingType.Boolean:
                ValidateBooleanValue(value);
                break;

            case GlobalSettingType.Reference:
                ValidateReferenceValue(value);
                break;

            default:
                break;
            }
        }
Ejemplo n.º 2
0
        public GlobalSetting(string name, string value, string defaultValue, GlobalSettingType type)
        {
            m_Name = name;

            m_DefaultValue = defaultValue;
            m_Type = type;

            if (value == m_DefaultValue)
                m_Value = null;
            else
                m_Value = value;
        }
        private void SanitizeValue(Entity target, GlobalSettingType type, String value)
        {
            if (value == null)
            {
                return;
            }

            if (type == GlobalSettingType.String)
            {
                return;
            }

            target.AddOrUpdateAttribute(GlobalSettingEntity.ValueFieldName(_prefix), value.Trim().ToLower());
        }