|
Partial Class ScheduleTaskDataset
Partial Class TaskRow
''' <summary>
''' Validate the current row
''' </summary>
''' <returns>Errors found</returns>
Public Function Validate() As String
Dim errorString As String = ""
'Required Fields
If Me.IsFriendlyNameNull Then
errorString &= "Task Name,"
End If
If Me.IsAssemblyNameNull Then
errorString &= " Assembly Name,"
End If
If Me.IsPerformTaskFromNull AndAlso Not Me.IsPerformTaskToNull Then
errorString &= " Perform From"
End If
If Not Me.IsPerformTaskFromNull AndAlso Me.IsPerformTaskToNull Then
errorString &= " Perform To"
End If
If errorString.Length > 0 Then
errorString &= vbCrLf & "Cannot be empty"
End If
'Check for valid hours
If Not Me.IsPerformTaskFromNull AndAlso Not Me.IsPerformTaskToNull AndAlso Me.PerformTaskFrom >= Me.PerformTaskTo Then
errorString &= vbCrLf & "Perform Task From must be lower than Perform Task To"
End If
'Check for valid dates
If Not Me.IsEndTimeNull AndAlso Me.EndTime <= Me.StartTime Then
errorString &= vbCrLf & "End Date/Time must be higher than Start Date/Time"
End If
'return errors found
Return errorString
End Function
End Class
End Class
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I am Pedro Ramirez from mexico, work for
www.sciodev.com, the company is located in Mexico, we do outsourcing and nearshore development, we are focused on SaaS nearshore development, I started with VB.Net, but now I am ambidextrous using VB.Net or C#.