This commit is contained in:
SchreiberM
2017-01-04 17:09:26 +01:00
128 changed files with 17813 additions and 20419 deletions

View File

@@ -2,22 +2,34 @@
Public Shared Sub LockRecord(RecordId As Integer)
Try
If RecordId = 0 Then
Exit Sub
End If
Dim Username As String = USER_USERNAME
Dim SQL As String = String.Format("UPDATE TBPMO_RECORD SET IN_WORK = 1, IN_WORK_WHO = '{0}' WHERE GUID = {1}", Username, RecordId)
If ClassProxy.MyPROXYConnectionString <> String.Empty Then
ClassDatabase.Execute_non_Query(SQL, True)
End If
ClassDatabase.Execute_non_Query(SQL)
Console.WriteLine("Record " & RecordId & " locked")
Catch ex As Exception
MsgBox("Error in LockRecord: " & vbNewLine & ex.Message,MsgBoxStyle.Critical)
MsgBox("Error in LockRecord: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
End Sub
Public Shared Sub UnlockRecord(RecordId As Integer)
Try
If RecordId = 0 Then
Exit Sub
End If
Dim RECLOCKED = IsRecordLocked(RecordId)
If IsNothing(RECLOCKED) Then
Exit Sub
End If
Dim SQL As String = String.Format("UPDATE TBPMO_RECORD SET IN_WORK = 0, IN_WORK_WHO = NULL WHERE GUID = {0}", RecordId)
If ClassProxy.MyPROXYConnectionString <> String.Empty Then
ClassDatabase.Execute_non_Query(SQL, True)
End If
ClassDatabase.Execute_non_Query(SQL)
Console.WriteLine("Record " & RecordId & " UNlocked")
Catch ex As Exception
MsgBox("Error in UnlockRecord: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
@@ -26,7 +38,7 @@
Public Shared Function IsRecordLocked(RecordId As Integer) As String
Try
Dim SQL As String = String.Format("SELECT IN_WORK, IN_WORK_WHO FROM TBPMO_RECORD WHERE GUID = {0}", RecordId)
Dim dt As DataTable = ClassDatabase.Return_Datatable(SQL)
Dim dt As DataTable = ClassDatabase.Return_Datatable(SQL, True)
If dt.Rows.Count = 1 Then
@@ -42,7 +54,7 @@
End If
ElseIf dt.Rows.Count = 0 Then
Throw New Exception("Record " & RecordId & " does not exist")
Return Nothing
Else
Throw New Exception("Record" & RecordId & " is not unique")
End If