开发者

Alternate a 'due' date based on two other dates in VB.Net?

开发者 https://www.devze.com 2023-01-17 14:23 出处:网络
I would like t开发者_运维百科o get a \'due\' or predicted inspection date based on alternating with another date? How would I go about this ?

I would like t开发者_运维百科o get a 'due' or predicted inspection date based on alternating with another date? How would I go about this ?

Thankyou!

Enum EnumSiteInspectionFrequency As Integer ' alternating with WRA
            None = 0  ' None
            Yearly = 12  '12 months
            SecondYearly = 24  '24 months
End Enum

Sub Calculate()
Dim SiteName as String = "Worksite Name Here"
Dim SiteInspectionFrequency = EnumSiteInspectionFrequency.SecondYearly

' Dates
Dim LastInspection As Date = DateTime.Parse("01/01/2010")
Dim LastSafetyInspection As Date = DateTime.Parse("22/03/2010")

Dim DueInspection As Date

' The due inspection either can be 24 months (second yearly) but it has to alternate with the last safety inspection.

End Sub


Question answered using vb.net Timespan

0

精彩评论

暂无评论...
验证码 换一张
取 消