Fix Language Module deprecation, Fix updated Tables, Fix missing null check for Config form
This commit is contained in:
@@ -4,10 +4,11 @@ Imports DevExpress.XtraGrid.Views.Grid
|
||||
Imports DigitalData.Modules.Config
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports DigitalData.Modules.Language
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports DigitalData.GUIs.Common
|
||||
|
||||
Public Class frmConfig
|
||||
|
||||
Private ReadOnly TBMT_CONFIG_GENERAL As New DS_DD_ECM.TBMT_CONFIGDataTable
|
||||
Private ReadOnly ConfigManager As ConfigManager(Of MultiTool.Common.Config)
|
||||
Private ReadOnly FormHelper As FormHelper
|
||||
@@ -15,6 +16,7 @@ Public Class frmConfig
|
||||
|
||||
Private BindingSource As BindingSource = TBEDIXMLITEMSBindingSource
|
||||
Private View As GridView = GridViewItems
|
||||
Private Logger As Logger
|
||||
|
||||
|
||||
Private ReadOnly Property Config As Common.Config
|
||||
@@ -31,6 +33,7 @@ Public Class frmConfig
|
||||
FormHelper = New FormHelper(pLogConfig, Me)
|
||||
ConfigManager = pConfigManager
|
||||
GridBuilder = New GridBuilder(GridViewTables, GridViewItems)
|
||||
Logger = pLogConfig.GetLogger()
|
||||
End Sub
|
||||
|
||||
Private Sub frmConfig_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
@@ -42,27 +45,34 @@ Public Class frmConfig
|
||||
Dim oBuilder As New SqlConnectionStringBuilder(oConnectionString) With {
|
||||
.InitialCatalog = "DD_ECM"
|
||||
}
|
||||
oConnectionString = oBuilder.ToString()
|
||||
Logger.Debug("Connection String: [{0}]", oConnectionString)
|
||||
|
||||
Logger.Debug("Setting default values")
|
||||
' Default Values
|
||||
DS_DD_ECM.TBMT_CONFIG.ADDED_WHOColumn.DefaultValue = Environment.UserName
|
||||
DS_DD_ECM.TBMT_CONFIG.CHANGED_WHOColumn.DefaultValue = Environment.UserName
|
||||
DS_DD_ECM.TBMT_TEMPLATE_ITEMS.ADDED_WHOColumn.DefaultValue = Environment.UserName
|
||||
DS_DD_ECM.TBMT_TEMPLATE_ITEMS.CHANGED_WHOColumn.DefaultValue = Environment.UserName
|
||||
|
||||
TBMT_TABLESTableAdapter.Connection.ConnectionString = oBuilder.ToString()
|
||||
TBMT_TABLESTableAdapter.Fill(Me.DS_DD_ECM.TBMT_TABLES)
|
||||
Logger.Debug("Initializing Tables Adapter")
|
||||
TBMT_TABLESTableAdapter.Connection.ConnectionString = oConnectionString
|
||||
TBMT_TABLESTableAdapter.Fill(DS_DD_ECM.TBMT_TABLES)
|
||||
|
||||
TBMT_TEMPLATE_ITEMSTableAdapter.Connection.ConnectionString = oBuilder.ToString()
|
||||
Logger.Debug("Initializing Templates Adapter")
|
||||
TBMT_TEMPLATE_ITEMSTableAdapter.Connection.ConnectionString = oConnectionString
|
||||
|
||||
|
||||
TBMT_CONFIGTableAdapter.Connection.ConnectionString = oBuilder.ToString()
|
||||
Logger.Debug("Initializing Config Adapter")
|
||||
TBMT_CONFIGTableAdapter.Connection.ConnectionString = oConnectionString
|
||||
TBMT_CONFIGTableAdapter.Fill(DS_DD_ECM.TBMT_CONFIG)
|
||||
TBMT_CONFIGTableAdapter.FillGeneral(TBMT_CONFIG_GENERAL)
|
||||
|
||||
Logger.Debug("Loading general config")
|
||||
LoadGeneralConfig(TBMT_CONFIG_GENERAL)
|
||||
|
||||
BindingSource = TBEDIXMLITEMSBindingSource
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
FormHelper.ShowError(ex, "Laden des Formulars")
|
||||
End Try
|
||||
End Sub
|
||||
@@ -181,7 +191,16 @@ Public Class frmConfig
|
||||
|
||||
Private Sub GridViewTables_FocusedRowChanged(sender As Object, e As Views.Base.FocusedRowChangedEventArgs) Handles GridViewTables.FocusedRowChanged
|
||||
Try
|
||||
If GridViewTables.FocusedRowHandle < 0 Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim oRow As DataRow = GridViewTables.GetDataRow(GridViewTables.FocusedRowHandle)
|
||||
|
||||
If oRow Is Nothing Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim oTableId = oRow.Item("GUID")
|
||||
TBMT_TEMPLATE_ITEMSTableAdapter.Fill(DS_DD_ECM.TBMT_TEMPLATE_ITEMS, oTableId)
|
||||
Catch ex As Exception
|
||||
|
||||
Reference in New Issue
Block a user