EDMIClient: Add _FromConnection variants for database functions
This commit is contained in:
parent
31ce9b05b1
commit
73b8d5c169
@ -552,12 +552,12 @@ Public Class Client
|
|||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function GetDatatableFromIDB(pSQL As String, Optional pConnectionId As Integer = 0) As GetDatatableResponse
|
#Region "GetDatatable"
|
||||||
|
Public Function GetDatatableFromIDB(pSQL As String) As GetDatatableResponse
|
||||||
Try
|
Try
|
||||||
Dim oResponse = Channel.ReturnDatatable(New GetDatatableRequest() With {
|
Dim oResponse = Channel.ReturnDatatable(New GetDatatableRequest() With {
|
||||||
.SqlCommand = pSQL,
|
.SqlCommand = pSQL,
|
||||||
.NamedDatabase = DatabaseName.IDB,
|
.NamedDatabase = DatabaseName.IDB
|
||||||
.ConnectionId = pConnectionId
|
|
||||||
})
|
})
|
||||||
Return oResponse
|
Return oResponse
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
@ -566,11 +566,24 @@ Public Class Client
|
|||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function GetDatatableFromECM(pSQL As String, Optional pConnectionId As Integer = 0) As GetDatatableResponse
|
Public Function GetDatatableFromECM(pSQL As String) As GetDatatableResponse
|
||||||
Try
|
Try
|
||||||
Dim oResponse = Channel.ReturnDatatable(New GetDatatableRequest() With {
|
Dim oResponse = Channel.ReturnDatatable(New GetDatatableRequest() With {
|
||||||
.SqlCommand = pSQL,
|
.SqlCommand = pSQL,
|
||||||
.NamedDatabase = DatabaseName.ECM,
|
.NamedDatabase = DatabaseName.ECM
|
||||||
|
})
|
||||||
|
Return oResponse
|
||||||
|
Catch ex As Exception
|
||||||
|
Logger.Error(ex)
|
||||||
|
Throw ex
|
||||||
|
End Try
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Function GetDatatableFromConnection(pSQL As String, pConnectionId As Integer) As GetDatatableResponse
|
||||||
|
Try
|
||||||
|
Dim oResponse = Channel.ReturnDatatable(New GetDatatableRequest() With {
|
||||||
|
.SqlCommand = pSQL,
|
||||||
|
.NamedDatabase = DatabaseName.None,
|
||||||
.ConnectionId = pConnectionId
|
.ConnectionId = pConnectionId
|
||||||
})
|
})
|
||||||
Return oResponse
|
Return oResponse
|
||||||
@ -580,12 +593,11 @@ Public Class Client
|
|||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Async Function GetDatatableFromIDBAsync(pSQL As String, Optional pConnectionId As Integer = 0) As Task(Of GetDatatableResponse)
|
Public Async Function GetDatatableFromIDBAsync(pSQL As String) As Task(Of GetDatatableResponse)
|
||||||
Try
|
Try
|
||||||
Dim oResponse = Await Channel.ReturnDatatableAsync(New GetDatatableRequest() With {
|
Dim oResponse = Await Channel.ReturnDatatableAsync(New GetDatatableRequest() With {
|
||||||
.SqlCommand = pSQL,
|
.SqlCommand = pSQL,
|
||||||
.NamedDatabase = DatabaseName.IDB,
|
.NamedDatabase = DatabaseName.IDB
|
||||||
.ConnectionId = pConnectionId
|
|
||||||
})
|
})
|
||||||
Return oResponse
|
Return oResponse
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
@ -594,12 +606,11 @@ Public Class Client
|
|||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Async Function GetDatatableFromECMAsync(pSQL As String, Optional pConnectionId As Integer = 0) As Task(Of GetDatatableResponse)
|
Public Async Function GetDatatableFromECMAsync(pSQL As String) As Task(Of GetDatatableResponse)
|
||||||
Try
|
Try
|
||||||
Dim oResponse = Await Channel.ReturnDatatableAsync(New GetDatatableRequest() With {
|
Dim oResponse = Await Channel.ReturnDatatableAsync(New GetDatatableRequest() With {
|
||||||
.SqlCommand = pSQL,
|
.SqlCommand = pSQL,
|
||||||
.NamedDatabase = DatabaseName.ECM,
|
.NamedDatabase = DatabaseName.ECM
|
||||||
.ConnectionId = pConnectionId
|
|
||||||
})
|
})
|
||||||
Return oResponse
|
Return oResponse
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
@ -608,12 +619,27 @@ Public Class Client
|
|||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function GetScalarValueFromIDB(pSQL As String, Optional pConnectionId As Integer = 0) As GetScalarValueResponse
|
Public Async Function GetDatatableFromConnectionAsync(pSQL As String, Optional pConnectionId As Integer = 0) As Task(Of GetDatatableResponse)
|
||||||
|
Try
|
||||||
|
Dim oResponse = Await Channel.ReturnDatatableAsync(New GetDatatableRequest() With {
|
||||||
|
.SqlCommand = pSQL,
|
||||||
|
.NamedDatabase = DatabaseName.None,
|
||||||
|
.ConnectionId = pConnectionId
|
||||||
|
})
|
||||||
|
Return oResponse
|
||||||
|
Catch ex As Exception
|
||||||
|
Logger.Error(ex)
|
||||||
|
Throw ex
|
||||||
|
End Try
|
||||||
|
End Function
|
||||||
|
#End Region
|
||||||
|
|
||||||
|
#Region "GetScalarValue"
|
||||||
|
Public Function GetScalarValueFromIDB(pSQL As String) As GetScalarValueResponse
|
||||||
Try
|
Try
|
||||||
Dim oResponse = Channel.ReturnScalarValue(New GetScalarValueRequest() With {
|
Dim oResponse = Channel.ReturnScalarValue(New GetScalarValueRequest() With {
|
||||||
.SqlCommand = pSQL,
|
.SqlCommand = pSQL,
|
||||||
.NamedDatabase = DatabaseName.IDB,
|
.NamedDatabase = DatabaseName.IDB
|
||||||
.ConnectionId = pConnectionId
|
|
||||||
})
|
})
|
||||||
Return oResponse
|
Return oResponse
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
@ -622,11 +648,24 @@ Public Class Client
|
|||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function GetScalarValueFromECM(pSQL As String, Optional pConnectionId As Integer = 0) As GetScalarValueResponse
|
Public Function GetScalarValueFromECM(pSQL As String) As GetScalarValueResponse
|
||||||
Try
|
Try
|
||||||
Dim oResponse = Channel.ReturnScalarValue(New GetScalarValueRequest() With {
|
Dim oResponse = Channel.ReturnScalarValue(New GetScalarValueRequest() With {
|
||||||
.SqlCommand = pSQL,
|
.SqlCommand = pSQL,
|
||||||
.NamedDatabase = DatabaseName.ECM,
|
.NamedDatabase = DatabaseName.ECM
|
||||||
|
})
|
||||||
|
Return oResponse
|
||||||
|
Catch ex As Exception
|
||||||
|
Logger.Error(ex)
|
||||||
|
Throw ex
|
||||||
|
End Try
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Function GetScalarValueFromConnection(pSQL As String, pConnectionId As Integer) As GetScalarValueResponse
|
||||||
|
Try
|
||||||
|
Dim oResponse = Channel.ReturnScalarValue(New GetScalarValueRequest() With {
|
||||||
|
.SqlCommand = pSQL,
|
||||||
|
.NamedDatabase = DatabaseName.None,
|
||||||
.ConnectionId = pConnectionId
|
.ConnectionId = pConnectionId
|
||||||
})
|
})
|
||||||
Return oResponse
|
Return oResponse
|
||||||
@ -636,12 +675,11 @@ Public Class Client
|
|||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Async Function GetScalarValueFromIDBAsync(pSQL As String, Optional pConnectionId As Integer = 0) As Task(Of GetScalarValueResponse)
|
Public Async Function GetScalarValueFromIDBAsync(pSQL As String) As Task(Of GetScalarValueResponse)
|
||||||
Try
|
Try
|
||||||
Dim oResponse = Await Channel.ReturnScalarValueAsync(New GetScalarValueRequest() With {
|
Dim oResponse = Await Channel.ReturnScalarValueAsync(New GetScalarValueRequest() With {
|
||||||
.SqlCommand = pSQL,
|
.SqlCommand = pSQL,
|
||||||
.NamedDatabase = DatabaseName.IDB,
|
.NamedDatabase = DatabaseName.IDB
|
||||||
.ConnectionId = pConnectionId
|
|
||||||
})
|
})
|
||||||
Return oResponse
|
Return oResponse
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
@ -650,12 +688,11 @@ Public Class Client
|
|||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Async Function GetScalarValueFromECMAsync(pSQL As String, Optional pConnectionId As Integer = 0) As Task(Of GetScalarValueResponse)
|
Public Async Function GetScalarValueFromECMAsync(pSQL As String) As Task(Of GetScalarValueResponse)
|
||||||
Try
|
Try
|
||||||
Dim oResponse = Await Channel.ReturnScalarValueAsync(New GetScalarValueRequest() With {
|
Dim oResponse = Await Channel.ReturnScalarValueAsync(New GetScalarValueRequest() With {
|
||||||
.SqlCommand = pSQL,
|
.SqlCommand = pSQL,
|
||||||
.NamedDatabase = DatabaseName.ECM,
|
.NamedDatabase = DatabaseName.ECM
|
||||||
.ConnectionId = pConnectionId
|
|
||||||
})
|
})
|
||||||
Return oResponse
|
Return oResponse
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
@ -664,12 +701,27 @@ Public Class Client
|
|||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function ExecuteNonQueryFromIDB(pSQL As String, Optional pConnectionId As Integer = 0) As ExecuteNonQueryResponse
|
Public Async Function GetScalarValueFromConnectionAsync(pSQL As String, pConnectionId As Integer) As Task(Of GetScalarValueResponse)
|
||||||
|
Try
|
||||||
|
Dim oResponse = Await Channel.ReturnScalarValueAsync(New GetScalarValueRequest() With {
|
||||||
|
.SqlCommand = pSQL,
|
||||||
|
.NamedDatabase = DatabaseName.None,
|
||||||
|
.ConnectionId = pConnectionId
|
||||||
|
})
|
||||||
|
Return oResponse
|
||||||
|
Catch ex As Exception
|
||||||
|
Logger.Error(ex)
|
||||||
|
Throw ex
|
||||||
|
End Try
|
||||||
|
End Function
|
||||||
|
#End Region
|
||||||
|
|
||||||
|
#Region "ExecuteNonQuery"
|
||||||
|
Public Function ExecuteNonQueryFromIDB(pSQL As String) As ExecuteNonQueryResponse
|
||||||
Try
|
Try
|
||||||
Dim oResponse = Channel.ExecuteNonQuery(New ExecuteNonQueryRequest() With {
|
Dim oResponse = Channel.ExecuteNonQuery(New ExecuteNonQueryRequest() With {
|
||||||
.SqlCommand = pSQL,
|
.SqlCommand = pSQL,
|
||||||
.NamedDatabase = DatabaseName.IDB,
|
.NamedDatabase = DatabaseName.IDB
|
||||||
.ConnectionId = pConnectionId
|
|
||||||
})
|
})
|
||||||
Return oResponse
|
Return oResponse
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
@ -678,11 +730,24 @@ Public Class Client
|
|||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function ExecuteNonQueryFromECM(pSQL As String, Optional pConnectionId As Integer = 0) As ExecuteNonQueryResponse
|
Public Function ExecuteNonQueryFromECM(pSQL As String) As ExecuteNonQueryResponse
|
||||||
Try
|
Try
|
||||||
Dim oResponse = Channel.ExecuteNonQuery(New ExecuteNonQueryRequest() With {
|
Dim oResponse = Channel.ExecuteNonQuery(New ExecuteNonQueryRequest() With {
|
||||||
.SqlCommand = pSQL,
|
.SqlCommand = pSQL,
|
||||||
.NamedDatabase = DatabaseName.ECM,
|
.NamedDatabase = DatabaseName.ECM
|
||||||
|
})
|
||||||
|
Return oResponse
|
||||||
|
Catch ex As Exception
|
||||||
|
Logger.Error(ex)
|
||||||
|
Throw ex
|
||||||
|
End Try
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Function ExecuteNonQueryFromConnection(pSQL As String, pConnectionId As Integer) As ExecuteNonQueryResponse
|
||||||
|
Try
|
||||||
|
Dim oResponse = Channel.ExecuteNonQuery(New ExecuteNonQueryRequest() With {
|
||||||
|
.SqlCommand = pSQL,
|
||||||
|
.NamedDatabase = DatabaseName.None,
|
||||||
.ConnectionId = pConnectionId
|
.ConnectionId = pConnectionId
|
||||||
})
|
})
|
||||||
Return oResponse
|
Return oResponse
|
||||||
@ -692,12 +757,11 @@ Public Class Client
|
|||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Async Function ExecuteNonQueryFromIDBAsync(pSQL As String, Optional pConnectionId As Integer = 0) As Task(Of ExecuteNonQueryResponse)
|
Public Async Function ExecuteNonQueryFromIDBAsync(pSQL As String) As Task(Of ExecuteNonQueryResponse)
|
||||||
Try
|
Try
|
||||||
Dim oResponse = Await Channel.ExecuteNonQueryAsync(New ExecuteNonQueryRequest() With {
|
Dim oResponse = Await Channel.ExecuteNonQueryAsync(New ExecuteNonQueryRequest() With {
|
||||||
.SqlCommand = pSQL,
|
.SqlCommand = pSQL,
|
||||||
.NamedDatabase = DatabaseName.IDB,
|
.NamedDatabase = DatabaseName.IDB
|
||||||
.ConnectionId = pConnectionId
|
|
||||||
})
|
})
|
||||||
Return oResponse
|
Return oResponse
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
@ -706,11 +770,24 @@ Public Class Client
|
|||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Async Function ExecuteNonQueryFromECMAsync(pSQL As String, Optional pConnectionId As Integer = 0) As Task(Of ExecuteNonQueryResponse)
|
Public Async Function ExecuteNonQueryFromECMAsync(pSQL As String) As Task(Of ExecuteNonQueryResponse)
|
||||||
Try
|
Try
|
||||||
Dim oResponse = Await Channel.ExecuteNonQueryAsync(New ExecuteNonQueryRequest() With {
|
Dim oResponse = Await Channel.ExecuteNonQueryAsync(New ExecuteNonQueryRequest() With {
|
||||||
.SqlCommand = pSQL,
|
.SqlCommand = pSQL,
|
||||||
.NamedDatabase = DatabaseName.ECM,
|
.NamedDatabase = DatabaseName.ECM
|
||||||
|
})
|
||||||
|
Return oResponse
|
||||||
|
Catch ex As Exception
|
||||||
|
Logger.Error(ex)
|
||||||
|
Throw ex
|
||||||
|
End Try
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Async Function ExecuteNonQueryFromConnectionAsync(pSQL As String, pConnectionId As Integer) As Task(Of ExecuteNonQueryResponse)
|
||||||
|
Try
|
||||||
|
Dim oResponse = Await Channel.ExecuteNonQueryAsync(New ExecuteNonQueryRequest() With {
|
||||||
|
.SqlCommand = pSQL,
|
||||||
|
.NamedDatabase = DatabaseName.None,
|
||||||
.ConnectionId = pConnectionId
|
.ConnectionId = pConnectionId
|
||||||
})
|
})
|
||||||
Return oResponse
|
Return oResponse
|
||||||
@ -719,6 +796,8 @@ Public Class Client
|
|||||||
Throw ex
|
Throw ex
|
||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
#End Region
|
||||||
|
|
||||||
|
|
||||||
Public Function GetDatatableByName(DatatableName As String, Optional FilterExpression As String = "", Optional SortByColumn As String = "") As TableResult
|
Public Function GetDatatableByName(DatatableName As String, Optional FilterExpression As String = "", Optional SortByColumn As String = "") As TableResult
|
||||||
Try
|
Try
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user