Modules.Database
This commit is contained in:
@@ -1,16 +1,15 @@
|
||||
Imports DD_FirebirdDLL
|
||||
Imports Modules.Database
|
||||
|
||||
Public Class ClassCurrentUser
|
||||
Public Username As String
|
||||
Public Language As String
|
||||
|
||||
Private DB As ClassFirebird
|
||||
Private DBFirebird As Firebird
|
||||
|
||||
Public Sub New(DB As ClassFirebird)
|
||||
Public Sub New(DBFirebird As Firebird)
|
||||
Username = Environment.UserName
|
||||
DB = DB
|
||||
|
||||
Dim sql As String = $"SELECT FNGET_USER_ACCESS('edm','{Username}') FROM rdb$database"
|
||||
Dim result = DB.ReturnScalar(sql)
|
||||
Dim result = DBFirebird.GetExecuteScalar(sql)
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
Imports System.IO
|
||||
Imports DD_FirebirdDLL
|
||||
Imports Modules.Database
|
||||
Public Class ClassInit
|
||||
Public Shared Function Init_user()
|
||||
Try
|
||||
USER_USERNAME = Environment.UserName
|
||||
Dim sql = String.Format("select FNGET_USER_ACCESS('edm','{0}') from rdb$database", USER_USERNAME)
|
||||
Dim result = ClassDBFirebird.ExecuteScalar(sql, LOGGERFilePath)
|
||||
'Dim result = Firebird.ExecuteScalar(sql, LOGGERFilePath)
|
||||
|
||||
sql = String.Format("SELECT * FROM VW_TBEDM_USER WHERE UPPER(LOGIN_NAME) = UPPER('{0}')", USER_USERNAME)
|
||||
DT_USER = ClassDBFirebird.ReturnDatatable(sql, LOGGERFilePath)
|
||||
If Not IsNothing(result) Then
|
||||
If Not IsNothing(DT_USER) Then
|
||||
USER_LANGUAGE = DT_USER.Rows(0).Item("LANGUAGE")
|
||||
End If
|
||||
Return result
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
'sql = String.Format("SELECT * FROM VW_TBEDM_USER WHERE UPPER(LOGIN_NAME) = UPPER('{0}')", USER_USERNAME)
|
||||
'DT_USER = ClassDBFirebird.ReturnDatatable(sql, LOGGERFilePath)
|
||||
'If Not IsNothing(result) Then
|
||||
' If Not IsNothing(DT_USER) Then
|
||||
' USER_LANGUAGE = DT_USER.Rows(0).Item("LANGUAGE")
|
||||
' End If
|
||||
' Return result
|
||||
'Else
|
||||
' Return False
|
||||
'End If
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
|
||||
@@ -47,9 +47,6 @@
|
||||
<OptionInfer>On</OptionInfer>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="DD_FirebirdDLL">
|
||||
<HintPath>..\..\DDFirebirdDLL\DD_FirebirdDLL\bin\Debug\DD_FirebirdDLL.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Data.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
||||
<Reference Include="DevExpress.Pdf.v18.1.Core, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
||||
<Reference Include="DevExpress.Office.v18.1.Core, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
||||
@@ -78,6 +75,9 @@
|
||||
<HintPath>..\packages\FirebirdSql.Data.FirebirdClient.6.1.0\lib\net452\FirebirdSql.Data.FirebirdClient.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="Modules.Database">
|
||||
<HintPath>..\Modules.Database\bin\Debug\Modules.Database.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NLog.4.5.8\lib\net45\NLog.dll</HintPath>
|
||||
</Reference>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Imports DD_FirebirdDLL
|
||||
Imports Modules.Database
|
||||
|
||||
Public Class FrmConnection
|
||||
Private Sub FrmConnection_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
@@ -11,7 +11,7 @@ Public Class FrmConnection
|
||||
Private Sub BtnConnect_Click(sender As Object, e As EventArgs) Handles btnConnect.Click
|
||||
My.Settings.Save()
|
||||
|
||||
Dim dbTest As New ClassFirebird(My.Settings.fbDatasource, My.Settings.fbDatabaseLocation, My.Settings.fbUser, My.Settings.fbPassword)
|
||||
Dim dbTest As New Firebird(My.Settings.fbDatasource, My.Settings.fbDatabaseLocation, My.Settings.fbUser, My.Settings.fbPassword)
|
||||
|
||||
If dbTest.ConnectionFailed Then
|
||||
MsgBox("Connection failed!", MsgBoxStyle.Information, "Database Connection")
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
Imports DD_FirebirdDLL
|
||||
Imports Modules.Database
|
||||
Imports Modules.Logging
|
||||
|
||||
Public Class FrmMain
|
||||
Private SelectedTable As Integer
|
||||
Private Logger As NLog.Logger
|
||||
Private LogWrapper As Logger
|
||||
Private DB As ClassFirebird
|
||||
Private DBFirebird As Firebird
|
||||
|
||||
Private Sub CreateTableNodesFromDatatable(dt As DataTable)
|
||||
' Node der Datenbank erstellen
|
||||
@@ -40,7 +40,7 @@ Public Class FrmMain
|
||||
End Sub
|
||||
|
||||
Private Function LoadTables()
|
||||
Return DB.ReturnDatatable("SELECT DISTINCT T.TABLE_ID,T.""TABLE"" from VWEDM_TABLE_COLUMN T")
|
||||
Return DBFirebird.GetDatatable("SELECT DISTINCT T.TABLE_ID,T.""TABLE"" from VWEDM_TABLE_COLUMN T")
|
||||
End Function
|
||||
|
||||
Private Function DatabaseSettingsExist()
|
||||
@@ -48,15 +48,15 @@ Public Class FrmMain
|
||||
End Function
|
||||
|
||||
Private Sub Init()
|
||||
DB = New ClassFirebird(My.Settings.fbDatasource, My.Settings.fbDatabaseLocation, My.Settings.fbUser, My.Settings.fbPassword)
|
||||
DBFirebird = New Firebird(My.Settings.fbDatasource, My.Settings.fbDatabaseLocation, My.Settings.fbUser, My.Settings.fbPassword)
|
||||
|
||||
If DB.ConnectionFailed Then
|
||||
If DBFirebird.ConnectionFailed Then
|
||||
MsgBox("Database connection failed. Please check the log.", vbCritical)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
' Get info about the logged in user
|
||||
CurrentUser = New ClassCurrentUser(DB)
|
||||
CurrentUser = New ClassCurrentUser(DBFirebird)
|
||||
|
||||
Dim dt As DataTable = LoadTables()
|
||||
CreateTableNodesFromDatatable(dt)
|
||||
@@ -65,7 +65,7 @@ Public Class FrmMain
|
||||
|
||||
|
||||
Private Sub FrmMain_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
LogWrapper = New Logger("EDMDesigner", ClassLogger.PathType.CurrentDirectory)
|
||||
LogWrapper = New Logger(ClassLogger.PathType.CurrentDirectory)
|
||||
|
||||
Logger = NLog.LogManager.GetCurrentClassLogger()
|
||||
|
||||
@@ -120,7 +120,7 @@ Public Class FrmMain
|
||||
End Sub
|
||||
|
||||
Private Sub SpaltenBearbeitenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles SpaltenBearbeitenToolStripMenuItem.Click
|
||||
Dim dt As DataTable = DB.ReturnDatatable($"SELECT * FROM VWEDM_TABLE_COLUMN WHERE TABLE_ID = {SelectedTable}")
|
||||
Dim dt As DataTable = DBFirebird.GetDatatable($"SELECT * FROM VWEDM_TABLE_COLUMN WHERE TABLE_ID = {SelectedTable}")
|
||||
gridControlTableProperties.DataSource = dt
|
||||
End Sub
|
||||
|
||||
|
||||
Reference in New Issue
Block a user