Add RegexEditor, Improve Database Add Language

This commit is contained in:
Jonathan Jenne
2019-08-08 16:42:38 +02:00
parent f418074011
commit c9e0d8cec1
33 changed files with 1384 additions and 124 deletions

View File

@@ -46,6 +46,8 @@ Imports DigitalData.Modules.Logging
''' REMARKS: If the connection fails due to "wrong username or password", the cause might be that the server harddrive is full..
''' </summary>
Public Class Firebird
Inherits BaseClass
Private _Logger As Logger
Private _LogConfig As LogConfig
Private _connectionServer As String
@@ -183,7 +185,7 @@ Public Class Firebird
''' <param name="Connection">The Firebird connection to use</param>
''' <returns>True, if command was executed sucessfully. Otherwise false.</returns>
Public Function ExecuteNonQueryWithConnection(SqlCommand As String, Connection As FbConnection, Optional TransactionMode As TransactionMode = TransactionMode.WithTransaction, Optional Transaction As FbTransaction = Nothing) As Boolean
_logger.Debug("Executing Non-Query: {0}", SqlCommand)
_Logger.Debug("Executing Non-Query: {0}", SqlCommand)
If Connection Is Nothing Then
_Logger.Warn("Connection is nothing!")
@@ -219,7 +221,7 @@ Public Class Firebird
''' </summary>
''' <param name="SqlCommand">The command to execute</param>
''' <returns>True, if command was executed sucessfully. Otherwise false.</returns>
Public Function ExecuteNonQuery(SqlCommand As String) As Boolean
Public Overrides Function ExecuteNonQuery(SqlCommand As String) As Boolean
Dim oConnection As FbConnection = GetConnection()
Dim oScalarValue As Object = ExecuteNonQueryWithConnection(SqlCommand, oConnection)
oConnection.Close()
@@ -234,7 +236,7 @@ Public Class Firebird
''' <param name="Connection">The Firebird connection to use</param>
''' <returns>The scalar value if the command was executed successfully. Nothing otherwise.</returns>
Public Function GetScalarValueWithConnection(SqlQuery As String, Connection As FbConnection, Optional TransactionMode As TransactionMode = TransactionMode.WithTransaction, Optional Transaction As FbTransaction = Nothing) As Object
_logger.Debug("Fetching Scalar-Value: {0}", SqlQuery)
_Logger.Debug("Fetching Scalar-Value: {0}", SqlQuery)
If Connection Is Nothing Then
_Logger.Warn("Connection is nothing!")
@@ -252,7 +254,7 @@ Public Class Firebird
}
oResult = oCommand.ExecuteScalar()
Catch ex As Exception
_logger.Error(ex, $"Error in ReturnScalar while executing command: '{SqlQuery}'")
_Logger.Error(ex, $"Error in ReturnScalar while executing command: '{SqlQuery}'")
Throw ex
Finally
MaybeCommitTransaction(oTransaction, TransactionMode)
@@ -266,7 +268,7 @@ Public Class Firebird
''' </summary>
''' <param name="SqlQuery">The query to execute</param>
''' <returns>The scalar value if the command was executed successfully. Nothing otherwise.</returns>
Public Function GetScalarValue(SqlQuery As String) As Object
Public Overrides Function GetScalarValue(SqlQuery As String) As Object
Dim oConnection As FbConnection = GetConnection()
Dim oScalarValue As Object = GetScalarValueWithConnection(SqlQuery, oConnection)
oConnection.Close()
@@ -281,7 +283,7 @@ Public Class Firebird
''' <param name="Connection">The Firebird connection to use</param>
''' <returns>A datatable containing the results if the command was executed successfully. Nothing otherwise.</returns>
Public Function GetDatatableWithConnection(SqlQuery As String, Connection As FbConnection, Optional TransactionMode As TransactionMode = TransactionMode.NoTransaction, Optional Transaction As FbTransaction = Nothing) As DataTable
_logger.Debug("Fetching Datatable: {0}", SqlQuery)
_Logger.Debug("Fetching Datatable: {0}", SqlQuery)
If Connection Is Nothing Then
_Logger.Warn("Connection is nothing!")
@@ -302,7 +304,7 @@ Public Class Firebird
oAdapter.Fill(oDatatable)
Catch ex As Exception
_logger.Error(ex, $"Error in GetDatatableWithConnection while executing command: '{SqlQuery}'")
_Logger.Error(ex, $"Error in GetDatatableWithConnection while executing command: '{SqlQuery}'")
Throw ex
Finally
MaybeCommitTransaction(oTransaction, TransactionMode)
@@ -316,9 +318,9 @@ Public Class Firebird
''' </summary>
''' <param name="SqlQuery">The query to execute</param>
''' <returns>A datatable containing the results if the command was executed successfully. Nothing otherwise.</returns>
Public Function GetDatatable(SqlQuery As String, Optional TransactionMode As TransactionMode = TransactionMode.NoTransaction) As DataTable
Public Overrides Function GetDatatable(SqlQuery As String) As DataTable
Dim oConnection As FbConnection = GetConnection()
Dim oDatatable As DataTable = GetDatatableWithConnection(SqlQuery, oConnection, TransactionMode)
Dim oDatatable As DataTable = GetDatatableWithConnection(SqlQuery, oConnection)
oConnection.Close()
Return oDatatable