Custom Rules library

Custom Rules library

Old forum URL: forums.lhotka.net/forums/t/3277.aspx


Wal972 posted on Friday, July 27, 2007

I use the date check start < end heaps in my code. I am trying to extract it, but each times it fails.

i have my code

Namespace RulesCheck

Public Class Common

Public Function StartGTEnd(ByVal target As IDatesCheck, ByVal e As RuleArgs) As Boolean

If CDate(target.Starting) > CDate(target.Ending) Then

e.Description = "Start Date can't be after the end date"

Return False

Else

Return True

End If

End Function

End Class

End Namespace

But when I use the addrule method it doesn't work.

Help

Thanks

Ellie

JonStonecash replied on Friday, July 27, 2007

I believe that the StartGTEnd method should be a shared method.  The problem is that there is no instance of the common class upon which to invoke the method.  A shared method gets around that problem.

Jon Stonecash

Public Class Common

Public Function StartGTEnd(ByVal target As IDatesCheck, ByVal e As RuleArgs) As Boolean


Copyright (c) Marimer LLC