10.01.2016

This commit is contained in:
SchreiberM
2017-01-11 10:53:58 +01:00
parent 26812ffeb7
commit 03ae19ae3e
25 changed files with 666 additions and 390 deletions

View File

@@ -62,53 +62,10 @@
End Try
End Function
Public Shared Function DeleteFunction(ControlId As Integer)
Try
Dim SQL As String = "DELETE FROM TBPMO_FUNCTION_GENERAL WHERE CONTROL_ID = " & ControlId
ClassDatabase.Execute_non_Query(SQL)
Return True
Catch ex As Exception
MsgBox("Fehler beim Löschen der KalenderFunktion:" & vbNewLine & ex.Message)
End Try
End Function
Public Shared Function InsertValue(ControlID As Integer, RecordID As Integer, Value As Object)
Try
Dim SQL As String = String.Format("INSERT INTO TBPMO_CONTROL_VALUE (CONTROL_ID, RECORD_ID, VALUE) VALUES({0}, {1}, '{2}')", ControlID, RecordID, Value)
If ClassDatabase.Execute_non_Query(SQL) = True Then
Return True
Else : Return False
End If
Catch ex As Exception
MsgBox("Fehler bei InsertValue:" & vbNewLine & ex.Message)
Return False
End Try
End Function
Public Shared Function UpdateValue(ControlID As Integer, RecordID As Integer, Value As Object)
Try
Dim SQL As String = String.Format("SELECT COUNT(*) FROM TBPMO_CONTROL_VALUE WHERE CONTROL_ID = {0} AND RECORD_ID = {1}", ControlID, RecordID)
Dim ValueExists = ClassDatabase.Execute_Scalar(SQL)
If ValueExists = 0 Then
Return InsertValue(ControlID, RecordID, Value)
Else
SQL = String.Format("UPDATE TBPMO_CONTROL_VALUE SET VALUE = '{0}',CHANGED_WHO = '{1}' WHERE CONTROL_ID = {2} AND RECORD_ID = {3}", Value, USER_USERNAME, ControlID, RecordID)
If ClassDatabase.Execute_non_Query(SQL) = True Then
Return True
Else : Return False
End If
End If
Catch ex As Exception
MsgBox("Fehler bei UpdateValue:" & vbNewLine & ex.Message)
Return False
End Try
End Function
Public Shared Function GETCONTROL_ID_FOR_COL_NAME(FORM_ID As Integer, Column_Name As String)
Try
Dim SQL As String = "SELECT GUID FROM TBPMO_CONTROL WHERE FORM_ID = " & FORM_ID & " AND COL_NAME = '" & Column_Name & "'"
Dim result = ClassDatabase.Execute_Scalar(SQL)
Dim result = ClassDatabase.Execute_Scalar(SQL, True)
Return result
Catch ex As Exception
MsgBox("Error in GETCONTROL_ID_FOR_COL_NAME:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)