Public Function EsDiaHabilNormal(ByVal Fecha As DateTime) As Boolean
If Fecha.DayOfWeek = DayOfWeek.Sunday Then
Return False Else Dim drs As DataRow() drs = dtSabadoNoLaborable.Select(DIASNOLABDATOS.FECHA_CAMPO & "= ' #" & DateSerial(Fecha.Year, Fecha.Month, Fecha.Day) & "#' and " & DIASNOLABDATOS.MOTIVO_CAMPO & " in(1,3,4)") If drs.GetLength(0) = 0 Then Return True Else Return False End If End If
End Function
Public Function AddDiasHabilesNormal(ByVal Incremento As Integer, ByVal Fecha
As DateTime) As DateTime Dim Count As Integer = 0 Dim fecha1 As DateTime = Fecha While Count <= Incremento Fecha.AddDays(1) If EsDiaHabilNormal(Fecha) Then Count += 1 End If End While Return fecha1 End Function