jj_02_02_16

This commit is contained in:
JenneJ
2016-02-02 10:54:10 +01:00
parent 666c9d039f
commit 57d073fe88
5 changed files with 34 additions and 88 deletions

View File

@@ -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)