private bool validateString(validationEntry entry, string value) {
			switch (entry.validationType) {
				case validationTypes.LowerThanZero:
					throw new Exception(string.Format("Ungültige Validierungsmethode {0} für den Datentyp string.",
					                                  entry.validationType));
				case validationTypes.GreatherThanZero:
					return value.Length > 0;
				case validationTypes.NotNull:
					return !string.IsNullOrEmpty(value);
				case validationTypes.Null:
					return string.IsNullOrEmpty(value);
			}
			return true;
		}
Beispiel #2
0
        private bool validateString(validationEntry entry, string value)
        {
            switch (entry.validationType)
            {
            case validationTypes.LowerThanZero:
                throw new Exception(string.Format("Ungültige Validierungsmethode {0} für den Datentyp string.",
                                                  entry.validationType));

            case validationTypes.GreatherThanZero:
                return(value.Length > 0);

            case validationTypes.NotNull:
                return(!string.IsNullOrEmpty(value));

            case validationTypes.Null:
                return(string.IsNullOrEmpty(value));
            }
            return(true);
        }
Beispiel #3
0
        private bool validateNumeric(validationEntry entry, object value)
        {
            decimal numValue = (decimal)value;

            switch (entry.validationType)
            {
            case validationTypes.GreatherThanZero:
                return(numValue > 0);

            case validationTypes.LowerThanZero:
                return(numValue < 0);

            case validationTypes.Null:
                return(numValue.Equals(0));

            case validationTypes.NotNull:
                return(!numValue.Equals(0));
            }
            return(true);
        }
Beispiel #4
0
 public void addEntry(validationEntry entry)
 {
     _entries.Add(entry);
 }
		private bool validateNumeric(validationEntry entry, object value) {
			decimal numValue = (decimal) value;
			switch (entry.validationType) {
				case validationTypes.GreatherThanZero:
					return numValue > 0;
				case validationTypes.LowerThanZero:
					return numValue < 0;
				case validationTypes.Null:
					return numValue.Equals(0);
				case validationTypes.NotNull:
					return !numValue.Equals(0);
			}
			return true;
		}
		public void addEntry(validationEntry entry) {
			_entries.Add(entry);
		}