Modules/GUIs.ClientSuite/Common/ClassCommonViews.vb
Jonathan Jenne 507e67309f workflows
2019-07-02 14:54:57 +02:00

78 lines
2.5 KiB
VB.net

Imports DigitalData.Modules.Logging
Public Class ClassCommonViews
Private _LogConfig As LogConfig
Private _Logger As Logger
Public Sub New(LogConfig As LogConfig)
_LogConfig = LogConfig
_Logger = LogConfig.GetLogger()
End Sub
Public Async Function VWIDB_FORM_CONTROL(FormId As Int64) As Task(Of DataTable)
Try
My.Channel.CreateDatabaseRequest("Load Controls", True)
Dim oSQL As String = $"SELECT * FROM VWIDB_FORM_CONTROL WHERE FORMID = {FormId}"
Dim oResult = Await My.Channel.ReturnDatatableAsync(oSQL)
Dim oTable = oResult.Table
If Not oResult.OK Then
_Logger.Error(New ApplicationException(oResult.ErrorMessage))
Return Nothing
End If
My.Channel.CloseDatabaseRequest()
Return oResult.Table
Catch ex As Exception
_Logger.Error(ex)
Throw ex
End Try
End Function
Public Async Function VWIDB_WF_REQUESTCONTROLDATA(FormId As Int64, RequestId As Int64) As Task(Of DataTable)
Try
My.Channel.CreateDatabaseRequest("Load Control Data", True)
Dim oSQL As String = $"SELECT * FROM VWIDB_WF_REQU_CTRL_DATA WHERE FORMID = {FormId} AND REQUESTID = {RequestId}"
Dim oResult = Await My.Channel.ReturnDatatableAsync(oSQL)
Dim oTable = oResult.Table
If Not oResult.OK Then
_Logger.Error(New ApplicationException(oResult.ErrorMessage))
Return Nothing
End If
My.Channel.CloseDatabaseRequest()
Return oResult.Table
Catch ex As Exception
_Logger.Error(ex)
Throw ex
End Try
End Function
Public Async Function VWIDB_GUI_WF_OVERVIEW(UserId As Int64, FormId As Int64) As Task(Of DataTable)
Try
My.Channel.CreateDatabaseRequest("Load Control Data", True)
Dim oSQL As String = $"SELECT * FROM VWIDB_GUI_WF_OVERVIEW WHERE USERID = {UserId} AND FORMID = {FormId}"
Dim oResult = Await My.Channel.ReturnDatatableAsync(oSQL)
Dim oTable = oResult.Table
If Not oResult.OK Then
_Logger.Error(New ApplicationException(oResult.ErrorMessage))
Return Nothing
End If
My.Channel.CloseDatabaseRequest()
Return oResult.Table
Catch ex As Exception
_Logger.Error(ex)
Throw ex
End Try
End Function
End Class