Bugfixes, "Verbesserungen"

This commit is contained in:
ms
2019-09-25 10:01:04 +02:00
parent d07cbe0676
commit c0d894546a
18 changed files with 292 additions and 155 deletions

View File

@@ -32,29 +32,33 @@ Public Class cEintrag
Public Function getFromSQL() '(ip As String)
Dim ds As New DataSet
Dim test As String = ""
SQL.SQL2DS("SELECT * FROM TbL_Allgemein WHERE ID = '" & Me.ID & "'", ds)
If ds.Tables(0).Rows.Count > 0 Then
For Each c As DataColumn In ds.Tables(0).Columns
Dim propInfo As PropertyInfo = Me.GetType.GetProperty(c.ColumnName)
If propInfo IsNot Nothing Then
If Not IsDBNull(c.Table.Rows(0).Item(c)) Then
propInfo.SetValue(Me, c.Table.Rows(0).Item(c))
Try
SQL.SQL2DS("SELECT * FROM TbL_Allgemein WHERE ID = '" & Me.ID & "'", ds)
If ds.Tables(0).Rows.Count > 0 Then
For Each c As DataColumn In ds.Tables(0).Columns
Dim propInfo As PropertyInfo = Me.GetType.GetProperty(c.ColumnName)
If propInfo IsNot Nothing Then
If Not IsDBNull(c.Table.Rows(0).Item(c)) Then
propInfo.SetValue(Me, c.Table.Rows(0).Item(c))
End If
End If
End If
Next
Else
ds.Clear()
SQL.SQL2DS("SELECT * FROM TbL_Allgemein WHERE Rubrik = '" & rubrik & "' AND Titel = '" & Titel & "'", ds)
For Each c As DataColumn In ds.Tables(0).Columns
Dim propInfo As PropertyInfo = Me.GetType.GetProperty(c.ColumnName)
If propInfo IsNot Nothing Then
If Not IsDBNull(c.Table.Rows(0).Item(c)) Then
propInfo.SetValue(Me, c.Table.Rows(0).Item(c))
Next
Else
ds.Clear()
SQL.SQL2DS("SELECT * FROM TbL_Allgemein WHERE Rubrik = '" & rubrik & "' AND Titel = '" & Titel & "'", ds)
For Each c As DataColumn In ds.Tables(0).Columns
Dim propInfo As PropertyInfo = Me.GetType.GetProperty(c.ColumnName)
If propInfo IsNot Nothing Then
If Not IsDBNull(c.Table.Rows(0).Item(c)) Then
propInfo.SetValue(Me, c.Table.Rows(0).Item(c))
End If
End If
End If
Next
Me.ID = Guid.NewGuid().ToString("N") : NewID = True
End If
Next
Me.ID = Guid.NewGuid().ToString("N") : NewID = True
End If
Catch
Return -1
End Try
' MsgBox("hier")
End Function