remove obsolete mysqlserver methods

This commit is contained in:
Jonathan Jenne 2020-06-23 11:13:37 +02:00
parent c4e5557d4d
commit e2b9e9fe49
7 changed files with 22 additions and 40 deletions

View File

@ -53,9 +53,6 @@
<Reference Include="DevExpress.XtraBars.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.XtraBars.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.XtraEditors.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.XtraEditors.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.XtraGrid.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.XtraGrid.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DigitalData.Controls.ChatNewConv">
<HintPath>..\Controls.ChatNewConv\obj\Debug\DigitalData.Controls.ChatNewConv.dll</HintPath>
</Reference>
<Reference Include="DigitalData.Modules.Database, Version=1.0.0.6, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="DigitalData.Modules.Database, Version=1.0.0.6, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\Modules.Database\bin\Debug\DigitalData.Modules.Database.dll</HintPath> <HintPath>..\Modules.Database\bin\Debug\DigitalData.Modules.Database.dll</HintPath>
@ -146,6 +143,10 @@
<Project>{1f278760-4f6b-42e8-b82d-01d4c8618340}</Project> <Project>{1f278760-4f6b-42e8-b82d-01d4c8618340}</Project>
<Name>ChatControl</Name> <Name>ChatControl</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\Controls.ChatNewConv\ChatNewConv.vbproj">
<Project>{86d27ffa-480f-481d-8d23-26deae92fe6c}</Project>
<Name>ChatNewConv</Name>
</ProjectReference>
<ProjectReference Include="..\Modules.Logging\Logging.vbproj"> <ProjectReference Include="..\Modules.Logging\Logging.vbproj">
<Project>{903b2d7d-3b80-4be9-8713-7447b704e1b0}</Project> <Project>{903b2d7d-3b80-4be9-8713-7447b704e1b0}</Project>
<Name>Logging</Name> <Name>Logging</Name>

View File

@ -66,7 +66,7 @@ Public Class ChatNewConv
If _Database.ExecuteNonQuery(oSQL) = True Then If _Database.ExecuteNonQuery(oSQL) = True Then
Dim oError As Boolean = False Dim oError As Boolean = False
oSQL = $"SELECT MAX(CONVERSATION_ID) FROM VWIDB_CONVERSATION WHERE IDB_OBJ_ID = {IDBObjectId}" oSQL = $"SELECT MAX(CONVERSATION_ID) FROM VWIDB_CONVERSATION WHERE IDB_OBJ_ID = {IDBObjectId}"
Dim oCONV_ID = _Database.NewExecuteScalar(oSQL) Dim oCONV_ID = _Database.GetScalarValue(oSQL)
If Not IsNothing(oCONV_ID) Then If Not IsNothing(oCONV_ID) Then
NewConversation = oCONV_ID NewConversation = oCONV_ID
Dim oSelectedUsers As Integer() = GridViewUsers.GetSelectedRows() Dim oSelectedUsers As Integer() = GridViewUsers.GetSelectedRows()

View File

@ -108,7 +108,7 @@ Public Class MSSQLServer
Return Nothing Return Nothing
End If End If
_Logger.Debug("Running Query: {0}", SqlCommand) _Logger.Debug("GetDatatable: Running Query [{0}]", SqlCommand)
Using oConnection = GetSQLConnection() Using oConnection = GetSQLConnection()
Using oSQLCOmmand = oConnection.CreateCommand() Using oSQLCOmmand = oConnection.CreateCommand()
@ -123,7 +123,8 @@ Public Class MSSQLServer
End Using End Using
Catch ex As Exception Catch ex As Exception
_Logger.Error(ex) _Logger.Error(ex)
_Logger.Warn("sqlcommand: " & SqlCommand) _Logger.Warn("GetDatatable failed with:")
_Logger.Warn("SQL Query: {0}", SqlCommand)
Return Nothing Return Nothing
End Try End Try
End Function End Function
@ -138,7 +139,7 @@ Public Class MSSQLServer
Return Nothing Return Nothing
End If End If
_Logger.Debug("Running Query: {0}", SqlCommand) _Logger.Debug("GetDatatableWithConnection: Running Query [{0}]", SqlCommand)
Using oConnection = GetSQLConnection(ConnectionString) Using oConnection = GetSQLConnection(ConnectionString)
Using oSQLCOmmand = oConnection.CreateCommand() Using oSQLCOmmand = oConnection.CreateCommand()
@ -155,22 +156,11 @@ Public Class MSSQLServer
_Logger.Error(ex) _Logger.Error(ex)
_Logger.Warn("GetDatatableWithConnection failed with:") _Logger.Warn("GetDatatableWithConnection failed with:")
_Logger.Warn("ConnectionString: ") _Logger.Warn("ConnectionString: ")
_Logger.Warn("SQL Query: " & SqlCommand) _Logger.Warn("SQL Query: {0}", SqlCommand)
Return Nothing Return Nothing
End Try End Try
End Function End Function
''' <summary>
''' Executes the passed sql-statement
''' </summary>
''' <param name="executeStatement">the sql statement</param>
''' <returns>Returns true if properly executed, else false</returns>
''' <remarks></remarks>
Public Function NewExecutenonQuery(executeStatement As String) As Boolean
'_Logger.Warn("NewExecutenonQuery is deprecated. Use ExecuteNonQuery instead.")
Return ExecuteNonQuery(executeStatement)
End Function
Public Function ExecuteNonQuery(SQLCommand As String, Timeout As Integer) As Boolean Implements IDatabase.ExecuteNonQuery Public Function ExecuteNonQuery(SQLCommand As String, Timeout As Integer) As Boolean Implements IDatabase.ExecuteNonQuery
Try Try
If TestCanConnect() = False Then If TestCanConnect() = False Then
@ -189,7 +179,8 @@ Public Class MSSQLServer
End Using End Using
Catch ex As Exception Catch ex As Exception
_Logger.Error(ex) _Logger.Error(ex)
_Logger.Warn("executeStatement: " & SQLCommand) _Logger.Warn("ExecuteNonQuery failed:")
_Logger.Warn("SQL Query: " & SQLCommand)
Return False Return False
End Try End Try
End Function End Function
@ -220,16 +211,6 @@ Public Class MSSQLServer
Return ExecuteNonQuery(SQLCommand, _Timeout) Return ExecuteNonQuery(SQLCommand, _Timeout)
End Function End Function
''' <summary>
''' Executes the passed sql-statement as Scalar
''' </summary>
''' <param name="ScalarSQL">the sql statement</param>
''' <returns>Returns true if properly executed, else false</returns>
Public Function NewExecuteScalar(ScalarSQL As String) As Object
_Logger.Warn("NewExecuteScalar is deprecated. Use GetScalarValue instead.")
Return GetScalarValue(ScalarSQL)
End Function
Public Function GetScalarValue(SQLCommand As String, Timeout As Integer) As Object Implements IDatabase.GetScalarValue Public Function GetScalarValue(SQLCommand As String, Timeout As Integer) As Object Implements IDatabase.GetScalarValue
Try Try
If TestCanConnect() = False Then If TestCanConnect() = False Then
@ -286,7 +267,7 @@ Public Class MSSQLServer
Return Nothing Return Nothing
End If End If
_Logger.Debug("Running Query: {0}", SQLCommand) _Logger.Debug("GetScalarValue: Running Query [{0}]", SQLCommand)
If SQLCommand.CommandText.Contains(" ") Then If SQLCommand.CommandText.Contains(" ") Then
SQLCommand.CommandType = CommandType.Text SQLCommand.CommandType = CommandType.Text
@ -349,7 +330,7 @@ Public Class MSSQLServer
Exit Sub Exit Sub
End If End If
_Logger.Debug("Running Query: {0}", SqlCommand) _Logger.Debug("NewExecuteNonQueryAsync: Running Query [{0}]", SqlCommand)
Try Try
Dim oCallback As New AsyncCallback(AddressOf NewExecuteNonQueryAsync_Callback) Dim oCallback As New AsyncCallback(AddressOf NewExecuteNonQueryAsync_Callback)

View File

@ -124,7 +124,7 @@ Namespace SyncUsers
Dim oResult = True Dim oResult = True
If _mssql.GetScalarValue(oSQL) = 0 Then If _mssql.GetScalarValue(oSQL) = 0 Then
oSQL = $"INSERT INTO TBDD_GROUPS_USER (USER_ID, GROUP_ID, ADDED_WHO) VALUES ({UserId}, {GroupId}, '{ADDED_WHO}')" oSQL = $"INSERT INTO TBDD_GROUPS_USER (USER_ID, GROUP_ID, ADDED_WHO) VALUES ({UserId}, {GroupId}, '{ADDED_WHO}')"
oResult = _mssql.NewExecutenonQuery(oSQL) oResult = _mssql.ExecuteNonQuery(oSQL)
Else Else
_logger.Debug($"UserGroup-Relation [{UserId}/{GroupId}] already existing") _logger.Debug($"UserGroup-Relation [{UserId}/{GroupId}] already existing")
Return False Return False
@ -179,7 +179,7 @@ Namespace SyncUsers
Dim oUserId As Integer = GetUserId(User.samAccountName) Dim oUserId As Integer = GetUserId(User.samAccountName)
If oUserId = 0 Then If oUserId = 0 Then
Dim oSQL As String = $"INSERT INTO TBDD_USER (PRENAME, NAME, USERNAME, EMAIL, ADDED_WHO) VALUES ('{User.GivenName}', '{User.Surname}', UPPER('{User.samAccountName}'), '{User.Email}', '{ADDED_WHO}')" Dim oSQL As String = $"INSERT INTO TBDD_USER (PRENAME, NAME, USERNAME, EMAIL, ADDED_WHO) VALUES ('{User.GivenName}', '{User.Surname}', UPPER('{User.samAccountName}'), '{User.Email}', '{ADDED_WHO}')"
Dim oResult = _mssql.NewExecutenonQuery(oSQL) Dim oResult = _mssql.ExecuteNonQuery(oSQL)
If oResult = True Then If oResult = True Then
oUserId = _mssql.GetScalarValue("SELECT MAX(GUID) FROM TBDD_USER") oUserId = _mssql.GetScalarValue("SELECT MAX(GUID) FROM TBDD_USER")
@ -202,7 +202,7 @@ Namespace SyncUsers
Dim oUserId As Integer = GetUserId(User.samAccountName) Dim oUserId As Integer = GetUserId(User.samAccountName)
If oUserId > 0 Then If oUserId > 0 Then
Dim oSQL As String = $"UPDATE TBDD_USER SET PRENAME = '{User.GivenName}', NAME = '{User.Surname}', EMAIL = '{User.Email}', CHANGED_WHO = '{ADDED_WHO}' WHERE GUID = {oUserId}" Dim oSQL As String = $"UPDATE TBDD_USER SET PRENAME = '{User.GivenName}', NAME = '{User.Surname}', EMAIL = '{User.Email}', CHANGED_WHO = '{ADDED_WHO}' WHERE GUID = {oUserId}"
Dim oResult = _mssql.NewExecutenonQuery(oSQL) Dim oResult = _mssql.ExecuteNonQuery(oSQL)
If oResult = True Then If oResult = True Then
Return oUserId Return oUserId
@ -226,7 +226,7 @@ Namespace SyncUsers
For Each oAttribute In oCustomAttributes For Each oAttribute In oCustomAttributes
_logger.Debug("Adding Custom Attribute [{0}] with value [{1}] to User [{2}]", oAttribute.MSSQLColumn, oAttribute.Value, User) _logger.Debug("Adding Custom Attribute [{0}] with value [{1}] to User [{2}]", oAttribute.MSSQLColumn, oAttribute.Value, User)
Dim oSQL As String = $"UPDATE TBDD_USER SET {oAttribute.MSSQLColumn} = '{oAttribute.Value}', CHANGED_WHO = '{ADDED_WHO}' WHERE GUID = {UserId}" Dim oSQL As String = $"UPDATE TBDD_USER SET {oAttribute.MSSQLColumn} = '{oAttribute.Value}', CHANGED_WHO = '{ADDED_WHO}' WHERE GUID = {UserId}"
Dim oResult = _mssql.NewExecutenonQuery(oSQL) Dim oResult = _mssql.ExecuteNonQuery(oSQL)
If oResult = False Then If oResult = False Then
_logger.Debug("Custom Attribute {0} could not be added to user {1}", oAttribute.Name, User.samAccountName) _logger.Debug("Custom Attribute {0} could not be added to user {1}", oAttribute.Name, User.samAccountName)

View File

@ -101,7 +101,7 @@ Public Class ImportZUGFeRDFiles
Try Try
'PRCUST_ADD_HISTORY_STATE: @MessageID VARCHAR(250), @TITLE1 VARCHAR(250), @TITLE2 VARCHAR(250) 'PRCUST_ADD_HISTORY_STATE: @MessageID VARCHAR(250), @TITLE1 VARCHAR(250), @TITLE2 VARCHAR(250)
Dim oSQL = $"EXEC PRCUST_ADD_HISTORY_STATE '{oMessageID}','{oTitle}','{oTitle1}','{oComment}'" Dim oSQL = $"EXEC PRCUST_ADD_HISTORY_STATE '{oMessageID}','{oTitle}','{oTitle1}','{oComment}'"
_mssql.NewExecutenonQuery(oSQL) _mssql.ExecuteNonQuery(oSQL)
Catch ex As Exception Catch ex As Exception
_logger.Error(ex) _logger.Error(ex)
End Try End Try
@ -434,7 +434,7 @@ Public Class ImportZUGFeRDFiles
_logger.Debug("Mapping Property [{0}] to value [{1}] . Will be inserted into table {2}", oProperty.Description, oProperty.Value, oProperty.TableName) _logger.Debug("Mapping Property [{0}] to value [{1}] . Will be inserted into table {2}", oProperty.Description, oProperty.Value, oProperty.TableName)
' Insert into SQL Server ' Insert into SQL Server
If oArgs.InsertIntoSQLServer = True Then If oArgs.InsertIntoSQLServer = True Then
Dim oResult = _mssql.NewExecutenonQuery(oCommand) Dim oResult = _mssql.ExecuteNonQuery(oCommand)
If oResult = False Then If oResult = False Then
_logger.Warn($"SQL Command [{oCommand}] was not successful. Check the log.") _logger.Warn($"SQL Command [{oCommand}] was not successful. Check the log.")
End If End If

View File

@ -312,7 +312,7 @@ Public Class MyComService
' End If ' End If
If oSendResult = True Then If oSendResult = True Then
Dim oUpdCommand = "UPDATE TBEMLP_EMAIL_OUT SET EMAIL_SENT = GETDATE() WHERE GUID = " & oGUID Dim oUpdCommand = "UPDATE TBEMLP_EMAIL_OUT SET EMAIL_SENT = GETDATE() WHERE GUID = " & oGUID
_MSSQL.NewExecutenonQuery(oUpdCommand) _MSSQL.ExecuteNonQuery(oUpdCommand)
End If End If
Next Next
Else Else

View File

@ -314,7 +314,7 @@ Public Class EmailService
If oSQL.Contains(",COMMENT = ''") Then If oSQL.Contains(",COMMENT = ''") Then
oSQL.Replace(",COMMENT = ''", "") oSQL.Replace(",COMMENT = ''", "")
End If End If
MSSQLInstance.NewExecutenonQuery(oSQL) MSSQLInstance.ExecuteNonQuery(oSQL)
End Select End Select
_Logger.Info($"Email has been send to: {oEmailTo} - Subject: {oSubject}") _Logger.Info($"Email has been send to: {oEmailTo} - Subject: {oSubject}")
Threading.Thread.Sleep(500) Threading.Thread.Sleep(500)