Add My.Common Namespace for DB Commands and Views

This commit is contained in:
Jonathan Jenne
2019-03-22 16:24:20 +01:00
parent 743b936cdd
commit 0f4c04dde7
7 changed files with 150 additions and 32 deletions

View File

@@ -0,0 +1,33 @@
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 VWICM_FORM_CONTROL(FormId As Int64) As Task(Of DataTable)
Try
My.Channel.CreateDatabaseRequest("Load Controls", True)
Dim oSQL As String = $"SELECT * FROM VWICM_FORMCONTROL 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
End Class