예제 #1
0
        public CustomFieldType(CustomFieldTypeId customFieldTypeId, string name, string dictionaryName,
                               long minValue, long maxValue, EntityTypeEnum entityId, string typeId)
        {
            if (customFieldTypeId == null)
            {
                throw new ArgumentNullException("customFieldTypeId");
            }
            id = customFieldTypeId;
            if (string.IsNullOrWhiteSpace(name))
            {
                throw new CustomFieldTypeArgumentException("CustomFieldType", "Name");
            }
            this.name = name;
            if (string.IsNullOrWhiteSpace(name))
            {
                throw new CustomFieldTypeArgumentException("CustomFieldType", "DictionaryName");
            }
            this.dictionaryName = dictionaryName;
            if (minValue > maxValue)
            {
                throw new CustomFieldTypeCompareException("CustomFieldType", "MinValue", "MaxValue");
            }
            this.minValue = minValue;
            this.maxValue = maxValue;

            this.entityId = entityId;
            this.typeId   = typeId;
        }
예제 #2
0
        public virtual void Update(string nameParam, string dictionaryNameParam, long minValueParam, long maxValueParam, EntityTypeEnum entityIdParam, string typeIdParam)
        {
            if (string.IsNullOrWhiteSpace(nameParam))
            {
                throw new CustomFieldTypeArgumentException("CustomFieldType", "Name");
            }
            this.name = nameParam;
            if (string.IsNullOrWhiteSpace(dictionaryNameParam))
            {
                throw new CustomFieldTypeArgumentException("CustomFieldType", "DictionaryName");
            }
            this.dictionaryName = dictionaryNameParam;
            if (minValueParam > maxValueParam)
            {
                throw new CustomFieldTypeCompareException("CustomFieldType", "MinValue", "MaxValue");
            }
            this.minValue = minValueParam;
            this.maxValue = maxValueParam;

            this.entityId = entityIdParam;
            this.typeId   = typeIdParam;
        }