Monitor: First UI draft
This commit is contained in:
33
GUIs.Monitor/frmStart.vb
Normal file
33
GUIs.Monitor/frmStart.vb
Normal file
@@ -0,0 +1,33 @@
|
||||
Imports DigitalData.Controls.SQLConfig
|
||||
Imports DigitalData.Modules.Config
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Modules.Logging
|
||||
|
||||
Public Class frmStart
|
||||
Public Property LogConfig As LogConfig
|
||||
Public Property ConfigManager As ConfigManager(Of Config)
|
||||
Public Property Database As MSSQLServer
|
||||
|
||||
Private Sub frmStart_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
Try
|
||||
LogConfig = New LogConfig(LogConfig.PathType.AppData, Nothing, Nothing, "Digital Data", "Monitor")
|
||||
ConfigManager = New ConfigManager(Of Config)(LogConfig, Application.UserAppDataPath)
|
||||
|
||||
If ConfigManager.Config.ConnectionString = String.Empty Then
|
||||
Dim oSQLConfig As New frmSQLConfig(LogConfig)
|
||||
If oSQLConfig.ShowDialog() = DialogResult.OK Then
|
||||
ConfigManager.Config.ConnectionString = oSQLConfig.ConnectionString
|
||||
ConfigManager.Save()
|
||||
Else
|
||||
ShowErrorMessage("No Database configured. Application will close!")
|
||||
Application.Exit()
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
Database = New MSSQLServer(LogConfig, ConfigManager.Config.ConnectionString)
|
||||
Catch ex As Exception
|
||||
ShowErrorMessage(ex)
|
||||
End Try
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user