jj_02_02_16
This commit is contained in:
@@ -12,13 +12,30 @@
|
||||
End Enum
|
||||
|
||||
Public Function NotNull(Of T)(ByVal value As T, ByVal defaultValue As T) As T
|
||||
If value Is Nothing OrElse String.IsNullOrEmpty(value.ToString) OrElse IsDBNull(value) Then
|
||||
If IsNothing(value) OrElse String.IsNullOrEmpty(value.ToString) OrElse IsDBNull(value) Then
|
||||
Return defaultValue
|
||||
Else
|
||||
Return value
|
||||
End If
|
||||
End Function
|
||||
|
||||
Public Function NotNull(ByVal value As Integer, ByVal defaultValue As Integer) As Integer
|
||||
If IsNothing(value) OrElse IsDBNull(value) OrElse value = 0 Then
|
||||
Return defaultValue
|
||||
Else
|
||||
Return value
|
||||
End If
|
||||
End Function
|
||||
|
||||
Public Function NotNull(ByVal value As String, ByVal defaultValue As String) As String
|
||||
If IsNothing(value) OrElse IsDBNull(value) OrElse String.IsNullOrEmpty(value) Then
|
||||
Return defaultValue
|
||||
Else
|
||||
Return value
|
||||
End If
|
||||
End Function
|
||||
|
||||
|
||||
Public Function BoolToInt(bool As Boolean) As Integer
|
||||
' Wandelt einen Boolean Wert in einen Int um
|
||||
Return IIf(bool, 1, 0)
|
||||
|
||||
Reference in New Issue
Block a user