User Group Assignments
This commit is contained in:
47
EDMI_ClientSuite/ClassCommonCommands.vb
Normal file
47
EDMI_ClientSuite/ClassCommonCommands.vb
Normal file
@@ -0,0 +1,47 @@
|
||||
Imports DigitalData.Modules.Logging
|
||||
|
||||
Public Class ClassCommonCommands
|
||||
Private _LogConfig As LogConfig
|
||||
Private _Logger As Logger
|
||||
|
||||
Public Sub New(LogConfig As LogConfig)
|
||||
_LogConfig = LogConfig
|
||||
_Logger = LogConfig.GetLogger()
|
||||
End Sub
|
||||
|
||||
Public Async Function FNICM_RADM_NEW_USER2GROUP(GroupId As Integer, UserId As Integer) As Task(Of Integer)
|
||||
Try
|
||||
Dim oSQL = "SELECT FNICM_RADM_NEW_USER2GROUP({0},{1}, '{2}') FROM RDB$DATABASE;"
|
||||
Dim oRequest = Await My.Channel.CreateDatabaseRequestAsync($"Add User To Group", False)
|
||||
Dim oRecordIds As New List(Of Integer)
|
||||
|
||||
Dim oResult = Await My.Channel.ReturnScalarAsync(String.Format(oSQL, UserId, GroupId, Environment.UserName))
|
||||
Await My.Channel.CloseDatabaseRequestAsync()
|
||||
|
||||
If oResult.OK Then
|
||||
Return oResult.Scalar
|
||||
Else
|
||||
Return Nothing
|
||||
End If
|
||||
Catch ex As Exception
|
||||
_Logger.Error(ex)
|
||||
Throw ex
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Async Function FNICM_DELETE_RECORD_FINALLY(RecordId As Integer) As Task(Of Boolean)
|
||||
Try
|
||||
Dim oSQL = "SELECT FNICM_DELETE_RECORD_FINALLY({0},'{1}') FROM RDB$DATABASE;"
|
||||
Dim oRequest = Await My.Channel.CreateDatabaseRequestAsync($"Delete Record", False)
|
||||
|
||||
Dim oResult = Await My.Channel.ReturnScalarAsync(String.Format(oSQL, RecordId, Environment.UserName))
|
||||
Await My.Channel.CloseDatabaseRequestAsync()
|
||||
|
||||
Return oResult.OK
|
||||
Catch ex As Exception
|
||||
_Logger.Error(ex)
|
||||
Throw ex
|
||||
End Try
|
||||
End Function
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user