IsValid() публичный статический Метод

public static IsValid ( System.DateTime earlierDate, System.DateTime laterDate ) : string
earlierDate System.DateTime
laterDate System.DateTime
Результат string
Пример #1
0
        public static string IsValid(DateTime?earlierDate, DateTime?laterDate)
        {
            string isValid = DateComesBeforeHelper.IsValid(laterDate, earlierDate);

            if (isValid != null)
            {
                isValid = isValid.Replace("cannot precede", "cannot be after");
            }

            return(isValid);
        }
        protected override string IsValidCore(DateTime?toCheck, DateTime?toCompare)
        {
            string validationResult = DateComesBeforeHelper.IsValid(toCheck, toCompare);

            if (string.IsNullOrEmpty(validationResult))
            {
                return(Success());
            }

            return(validationResult);
        }
Пример #3
0
        public static string IsValid(DateTime?earlierDate, DateTime?laterDate)
        {
            string isValid = DateComesBeforeHelper.IsValid(earlierDate, laterDate);

            if (string.IsNullOrEmpty(isValid))
            {
                return(isValid);
            }

            if (isValid.StartsWith("Time on"))
            {
                return("{0} cannot precede {1}");
            }

            return(isValid);
        }