OpenPetra
Free Administration Software for Non-Profits
Ict.Common.Verification.TDateChecks Class Reference

Class for date verifications that are needed both on Server and Client side. More...

Static Public Member Functions

static TVerificationResult IsNotUndefinedDateTime (DateTime? ADate, String ADescription, bool ATreatNullAsInvalid=false, object AResultContext=null, System.Data.DataColumn AResultColumn=null)
 Checks whether the date is not undefined. DateTime.MinValue is seen as undefined by this Method. Null values are accepted. They are treated as valid, unless ATreatNullAsInvalid is set to true. More...
 
static TVerificationResult IsNotCorporateDateTime (DateTime? ADate, String ADescription, object AResultContext=null, System.Data.DataColumn AResultColumn=null, int AAlternativeFirstDayOfPeriod=1)
 Checks whether the date is not undefined. DateTime.MinValue is seen as undefined by this Method. Null values are accepted. More...
 
static TVerificationResult IsValidDateTime (String AString, String ADescription, object AResultContext=null, System.Data.DataColumn AResultColumn=null)
 Checks whether the string AString contains a valid DateTime. More...
 
static TVerificationResult IsCurrentOrFutureDate (DateTime? ADate, String ADescription, object AResultContext=null, System.Data.DataColumn AResultColumn=null)
 Checks whether the date is today or in the future. Null values are accepted. More...
 
static TVerificationResult IsCurrentOrPastDate (DateTime? ADate, String ADescription, object AResultContext=null, System.Data.DataColumn AResultColumn=null)
 Checks whether the date is today or in the past. Null values are accepted. More...
 
static TVerificationResult IsDateBetweenDates (DateTime? ADate, DateTime? ALowerDateRangeEnd, DateTime? AUpperDateRangeEnd, String ADescription, TDateBetweenDatesCheckType ALowerRangeCheckType=TDateBetweenDatesCheckType.dbdctUnspecific, TDateBetweenDatesCheckType AUpperRangeCheckType=TDateBetweenDatesCheckType.dbdctUnspecific, object AResultContext=null, System.Data.DataColumn AResultColumn=null)
 Checks whether the date is within a specified date range. Null values are accepted. More...
 
static TVerificationResult FirstLesserOrEqualThanSecondDate (DateTime? ADate1, DateTime? ADate2, string AFirstDateDescription, string ASecondDateDescription, object AResultContext=null, System.Data.DataColumn AResultColumn=null)
 Checks whether the first submitted date is earlier or equal than the second submitted date. Null dates are accepted. More...
 
static TVerificationResult FirstLesserThanSecondDate (DateTime? ADate1, DateTime? ADate2, string AFirstDateDescription, string ASecondDateDescription, object AResultContext=null, System.Data.DataColumn AResultColumn=null)
 Checks whether the first submitted date is earlier than the second submitted date. Null dates are accepted. More...
 
static TVerificationResult FirstGreaterOrEqualThanSecondDate (DateTime? ADate1, DateTime? ADate2, string AFirstDateDescription, string ASecondDateDescription, object AResultContext=null, System.Data.DataColumn AResultColumn=null)
 Checks whether the first submitted date is later or equal than the second submitted date. Null dates are accepted. More...
 
static TVerificationResult FirstGreaterThanSecondDate (DateTime? ADate1, DateTime? ADate2, string AFirstDateDescription, string ASecondDateDescription, object AResultContext=null, System.Data.DataColumn AResultColumn=null)
 Checks whether the first submitted date is later than the second submitted date. Null dates are accepted. More...
 
static TVerificationResult GetInvalidDateVerificationResult (String ADescription, object AResultContext=null)
 This is called in case a date is invalid, in order to generate a generic TVerificationResult. More...
 

Detailed Description

Class for date verifications that are needed both on Server and Client side.

None of the data verifications in here must access the database since the Client doesn't have access to the database!

Member Function Documentation

◆ FirstGreaterOrEqualThanSecondDate()

static TVerificationResult Ict.Common.Verification.TDateChecks.FirstGreaterOrEqualThanSecondDate ( DateTime?  ADate1,
DateTime?  ADate2,
string  AFirstDateDescription,
string  ASecondDateDescription,
object  AResultContext = null,
System.Data.DataColumn  AResultColumn = null 
)
inlinestatic

Checks whether the first submitted date is later or equal than the second submitted date. Null dates are accepted.

Parameters
ADate1First date.
ADate2Second date.
AFirstDateDescriptionDescription what the first date is about (for the error message).
ASecondDateDescriptionDescription what the second date is about (for the error message).
AResultContextContext of verification (can be null).
AResultColumnWhich System.Data.DataColumn failed (can be null).
Returns
Null if validation succeeded, otherwise a TVerificationResult is returned that contains details about the problem, with a message that uses AFirstDateDescription and ASecondDateDescription .

◆ FirstGreaterThanSecondDate()

static TVerificationResult Ict.Common.Verification.TDateChecks.FirstGreaterThanSecondDate ( DateTime?  ADate1,
DateTime?  ADate2,
string  AFirstDateDescription,
string  ASecondDateDescription,
object  AResultContext = null,
System.Data.DataColumn  AResultColumn = null 
)
inlinestatic

Checks whether the first submitted date is later than the second submitted date. Null dates are accepted.

Parameters
ADate1First date.
ADate2Second date.
AFirstDateDescriptionDescription what the first date is about (for the error message).
ASecondDateDescriptionDescription what the second date is about (for the error message).
AResultContextContext of verification (can be null).
AResultColumnWhich System.Data.DataColumn failed (can be null).
Returns
Null if validation succeeded, otherwise a TVerificationResult is returned that contains details about the problem, with a message that uses AFirstDateDescription and ASecondDateDescription .

◆ FirstLesserOrEqualThanSecondDate()

static TVerificationResult Ict.Common.Verification.TDateChecks.FirstLesserOrEqualThanSecondDate ( DateTime?  ADate1,
DateTime?  ADate2,
string  AFirstDateDescription,
string  ASecondDateDescription,
object  AResultContext = null,
System.Data.DataColumn  AResultColumn = null 
)
inlinestatic

Checks whether the first submitted date is earlier or equal than the second submitted date. Null dates are accepted.

Parameters
ADate1First date.
ADate2Second date.
AFirstDateDescriptionDescription what the first date is about (for the error message).
ASecondDateDescriptionDescription what the second date is about (for the error message).
AResultContextContext of verification (can be null).
AResultColumnWhich System.Data.DataColumn failed (can be null).
Returns
Null if validation succeeded, otherwise a TVerificationResult is returned that contains details about the problem, with a message that uses AFirstDateDescription and ASecondDateDescription .

◆ FirstLesserThanSecondDate()

static TVerificationResult Ict.Common.Verification.TDateChecks.FirstLesserThanSecondDate ( DateTime?  ADate1,
DateTime?  ADate2,
string  AFirstDateDescription,
string  ASecondDateDescription,
object  AResultContext = null,
System.Data.DataColumn  AResultColumn = null 
)
inlinestatic

Checks whether the first submitted date is earlier than the second submitted date. Null dates are accepted.

Parameters
ADate1First date.
ADate2Second date
AFirstDateDescriptionDescription what the first date is about (for the error message).
ASecondDateDescriptionDescription what the second date is about (for the error message).
AResultContextContext of verification (can be null).
AResultColumnWhich System.Data.DataColumn failed (can be null).
Returns
Null if validation succeeded, otherwise a TVerificationResult is returned that contains details about the problem, with a message that uses AFirstDateDescription and ASecondDateDescription .

◆ GetInvalidDateVerificationResult()

static TVerificationResult Ict.Common.Verification.TDateChecks.GetInvalidDateVerificationResult ( String  ADescription,
object  AResultContext = null 
)
inlinestatic

This is called in case a date is invalid, in order to generate a generic TVerificationResult.

Parameters
ADescriptionEither a name for the date value or an empty string.
AResultContextContext of verification (can be null).
Returns
A Verification Result with the error message.

◆ IsCurrentOrFutureDate()

static TVerificationResult Ict.Common.Verification.TDateChecks.IsCurrentOrFutureDate ( DateTime?  ADate,
String  ADescription,
object  AResultContext = null,
System.Data.DataColumn  AResultColumn = null 
)
inlinestatic

Checks whether the date is today or in the future. Null values are accepted.

Parameters
ADateDate to check.
ADescriptionName of the date value.
AResultContextContext of verification (can be null).
AResultColumnWhich System.Data.DataColumn failed (can be null).
Returns
Null if the date ADate is today or in the future, otherwise a verification result with a message that uses ADescription .

◆ IsCurrentOrPastDate()

static TVerificationResult Ict.Common.Verification.TDateChecks.IsCurrentOrPastDate ( DateTime?  ADate,
String  ADescription,
object  AResultContext = null,
System.Data.DataColumn  AResultColumn = null 
)
inlinestatic

Checks whether the date is today or in the past. Null values are accepted.

Parameters
ADateThe date to check.
ADescriptionThe name of the date value.
AResultContextContext of verification (can be null).
AResultColumnWhich System.Data.DataColumn failed (can be null).
Returns
Null if the date ADate is today or in the past, otherwise a verification result with a message that uses ADescription .

◆ IsDateBetweenDates()

static TVerificationResult Ict.Common.Verification.TDateChecks.IsDateBetweenDates ( DateTime?  ADate,
DateTime?  ALowerDateRangeEnd,
DateTime?  AUpperDateRangeEnd,
String  ADescription,
TDateBetweenDatesCheckType  ALowerRangeCheckType = TDateBetweenDatesCheckType.dbdctUnspecific,
TDateBetweenDatesCheckType  AUpperRangeCheckType = TDateBetweenDatesCheckType.dbdctUnspecific,
object  AResultContext = null,
System.Data.DataColumn  AResultColumn = null 
)
inlinestatic

Checks whether the date is within a specified date range. Null values are accepted.

This Method is capable of returning varyingTVerificationResult objects! The objects returned are determined by the values specified for ALowerRangeCheckType and AUpperRangeCheckType !

Parameters
ADateDate to check.
ALowerDateRangeEndLower end of the valid Date Range.
AUpperDateRangeEndUpper end of the valid Date Range.
ADescriptionName of the date value.
ALowerRangeCheckTypeType of Date Check: lower end of the valid Date Range (defaults to TDateBetweenDatesCheckType.dbdctUnspecific).
AUpperRangeCheckTypeType of Date Check: upper end of the valid Date Range (defaults to TDateBetweenDatesCheckType.dbdctUnspecific).
AResultContextContext of verification (can be null).
AResultColumnWhich System.Data.DataColumn failed (can be null).
Returns
Null if the date ADate is between the lower and the upper end of the Date Range specified (lower and upper end dates are included), otherwise a verification result with a message that uses ADescription .

◆ IsNotCorporateDateTime()

static TVerificationResult Ict.Common.Verification.TDateChecks.IsNotCorporateDateTime ( DateTime?  ADate,
String  ADescription,
object  AResultContext = null,
System.Data.DataColumn  AResultColumn = null,
int  AAlternativeFirstDayOfPeriod = 1 
)
inlinestatic

Checks whether the date is not undefined. DateTime.MinValue is seen as undefined by this Method. Null values are accepted.

Parameters
ADateThe date to check.
ADescriptionThe name of the date value.
AResultContextContext of verification (can be null).
AResultColumnWhich System.Data.DataColumn failed (can be null).
AAlternativeFirstDayOfPeriod

Usage in the Data Validation Framework: rather than using this Method, use Method 'TValidationControlHelper.IsNotInvalidDate' for checking the validity of dates as the latter can deal not only with empty dates, but dates that are invalid in other respects (e.g. exceeding a valid date range)!!!

Returns
Null if validation succeeded, otherwise a TVerificationResult is returned that contains details about the problem.

◆ IsNotUndefinedDateTime()

static TVerificationResult Ict.Common.Verification.TDateChecks.IsNotUndefinedDateTime ( DateTime?  ADate,
String  ADescription,
bool  ATreatNullAsInvalid = false,
object  AResultContext = null,
System.Data.DataColumn  AResultColumn = null 
)
inlinestatic

Checks whether the date is not undefined. DateTime.MinValue is seen as undefined by this Method. Null values are accepted. They are treated as valid, unless ATreatNullAsInvalid is set to true.

Parameters
ADateThe date to check.
ADescriptionThe name of the date value.
ATreatNullAsInvalidSet this to true to treated null value in ADate as invalid.
AResultContextContext of verification (can be null).
AResultColumnWhich System.Data.DataColumn failed (can be null).

Usage in the Data Validation Framework: rather than using this Method, use Method 'TValidationControlHelper.IsNotInvalidDate' for checking the validity of dates as the latter can deal not only with empty dates, but dates that are invalid in other respects (e.g. exceeding a valid date range)!!!

Returns
Null if validation succeeded, otherwise a TVerificationResult is returned that contains details about the problem.

◆ IsValidDateTime()

static TVerificationResult Ict.Common.Verification.TDateChecks.IsValidDateTime ( String  AString,
String  ADescription,
object  AResultContext = null,
System.Data.DataColumn  AResultColumn = null 
)
inlinestatic

Checks whether the string AString contains a valid DateTime.

Parameters
AStringThe date to check.
ADescriptionThe name of the date value.
AResultContextContext of verification (can be null).
AResultColumnWhich System.Data.DataColumn failed (can be null).
Returns
Null if AString contains a valid DateTime, otherwise a TVerificationResult with a message which uses ADescription is returned.

The documentation for this class was generated from the following file: