Validate dates - HxGN SDx - Update 63 - Administration & Configuration

Administration and Configuration of HxGN SDx

Language
English
Product
HxGN SDx
Search by Category
Administration & Configuration
SmartPlant Foundation / SDx Version
10

Picture properties can be used for validation rather than forcing formatting. This allows administrators to prevent users from inserting dates that are invalid, such as dates in the past.

Below are the constants that are supported and the logic performed. For example, if you enter FUTUREONLY in the picture, and the user enters a date that is before today, an error message appears.

Case "TODAY"

If ldatLocalDate.Date <> System.DateTime.Today Then

lstrReturnError = SPF.Client.Resources.SPFResources.GetStringWithParameters(9302, New String() {Picture})

End If

Case "FUTUREONLY"

If ldatLocalDate.Date <= System.DateTime.Today Then

lstrReturnError = SPF.Client.Resources.SPFResources.GetStringWithParameters(9302, New String() {Picture})

End If

Case "PASTONLY"

If ldatLocalDate.Date >= System.DateTime.Today Then

lstrReturnError = SPF.Client.Resources.SPFResources.GetStringWithParameters(9302, New String() {Picture})

End If

Case "NOTFUTURE" ' = today and past

If ldatLocalDate.Date > System.DateTime.Today Then

lstrReturnError = SPF.Client.Resources.SPFResources.GetStringWithParameters(9302, New String() {Picture})

End If

Case "NOTPAST" ' = today and future