Imports DevExpress.XtraEditors Imports DigitalData.Modules.Language Imports DigitalData.Modules.Logging Public Class frmConfigBasic Private FormLoaded As Boolean = False Private Logger As Logger Dim oFormLoaded As Boolean = False Private Sub frmConfigBasic_Load(sender As Object, e As EventArgs) Handles MyBase.Load LoadScreens() ToggleSwitchDebug.IsOn = My.LogConfig.Debug For Each orow As DataRow In My.Tables.DTIDB_CATALOG_USER.Rows Select Case orow.Item("CAT_TITLE") Case ClassConstants.USER_CATALOG_QUICKSEARCH1_TITLE Quicksearch1TitleTextBox.Text = orow.Item("CAT_STRING") Quicksearch1TitleTextBox.Tag = orow.Item("GUID") Case ClassConstants.USER_CATALOG_QUICKSEARCH1_POS Quicksearch1CB_Pos.EditValue = orow.Item("CAT_STRING") Quicksearch1CB_Pos.Tag = orow.Item("GUID") Case ClassConstants.USER_CATALOG_APPLICATION_THEME Dim oItem = SkinPaletteRibbonGalleryBarItem1.Gallery.GetAllItems(). Where(Function(item) item.Value = orow.ItemEx("CAT_STRING", String.Empty)). FirstOrDefault() If Not IsNothing(oItem) Then SkinPaletteRibbonGalleryBarItem1.Gallery.SetItemCheck(oItem, True) End If End Select Next oFormLoaded = True End Sub Private Sub LoadScreens() 'cmbScreens.Properties.Items.Clear() 'For Each oScreen In Screen.AllScreens ' cmbScreens.Properties.Items.Add(oScreen.DeviceName) 'Next End Sub Private Sub cmbScreens_SelectedValueChanged(sender As Object, e As EventArgs) 'My.UIConfig.SidebarScreen = cmbScreens.EditValue My.UIConfigManager.Save() End Sub Private Sub BarButtonItem2_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem2.ItemClick Process.Start(My.LogConfig.LogDirectory) End Sub Private Sub BarButtonItem1_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem1.ItemClick Process.Start(System.Windows.Forms.Application.LocalUserAppDataPath) End Sub Private Sub BarButtonItem3_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem3.ItemClick Try Dim oUpd = "UPDATE TBIDB_CATALOG_USER SET CHANGED_WHO = '', CAT_STRING = " Catch ex As Exception MsgBox(ex.Message, MsgBoxStyle.Critical) End Try End Sub Private Sub frmConfigBasic_Shown(sender As Object, e As EventArgs) Handles Me.Shown FormLoaded = True End Sub Private Sub Quicksearch1CB_Pos_SelectedIndexChanged(sender As Object, e As EventArgs) Handles Quicksearch1CB_Pos.SelectedIndexChanged If FormLoaded = False Then Exit Sub End If Try Dim oUpd = $"UPDATE TBIDB_CATALOG_USER SET CHANGED_WHO = '{My.Application.User.UserName}', CAT_STRING = '{Quicksearch1CB_Pos.EditValue}' WHERE GUID = {Quicksearch1CB_Pos.Tag}" If My.Database.ExecuteNonQuery(oUpd, DigitalData.Modules.EDMI.API.Constants.DatabaseType.IDB) = True Then bsiInfo.Caption = "Position Quicksearch1 saved!" End If Catch ex As Exception MsgBox(ex.Message, MsgBoxStyle.Critical) End Try End Sub Private Sub Quicksearch1TitleTextBox_Leave(sender As Object, e As EventArgs) Handles Quicksearch1TitleTextBox.Leave If FormLoaded = False Then Exit Sub End If Try Dim oUpd = $"UPDATE TBIDB_CATALOG_USER SET CHANGED_WHO = '{My.Application.User.UserName}', CAT_STRING = '{Quicksearch1TitleTextBox.Text}' WHERE GUID = {Quicksearch1TitleTextBox.Tag}" If My.Database.ExecuteNonQuery(oUpd, DigitalData.Modules.EDMI.API.Constants.DatabaseType.IDB) = True Then bsiInfo.Caption = "Title Quicksearch1 saved!" End If Catch ex As Exception MsgBox(ex.Message, MsgBoxStyle.Critical) End Try End Sub Private Sub SkinPaletteRibbonGalleryBarItem1_GalleryItemClick(sender As Object, e As DevExpress.XtraBars.Ribbon.GalleryItemClickEventArgs) Handles SkinPaletteRibbonGalleryBarItem1.GalleryItemClick UpdateThemeSettings() End Sub Private Sub SkinRibbonGalleryBarItem1_GalleryItemClick(sender As Object, e As DevExpress.XtraBars.Ribbon.GalleryItemClickEventArgs) Handles SkinRibbonGalleryBarItem1.GalleryItemClick Dim oDefaultPalette = SkinPaletteRibbonGalleryBarItem1.Gallery.GetAllItems().FirstOrDefault() If oDefaultPalette IsNot Nothing Then SkinPaletteRibbonGalleryBarItem1.Gallery.FocusedItem = oDefaultPalette End If UpdateThemeSettings() End Sub Private Sub UpdateThemeSettings() Try Dim oPalette = SkinPaletteRibbonGalleryBarItem1.Gallery.GetCheckedItem() Dim oSkin = SkinRibbonGalleryBarItem1.Gallery.GetCheckedItem() Dim oThemeString = "" If oSkin Is Nothing Then Exit Sub End If oThemeString = oSkin.Value If oPalette IsNot Nothing Then oThemeString &= "|" & oPalette.Value End If Dim oUpd = $"UPDATE TBIDB_CATALOG_USER SET CHANGED_WHO = '{My.Application.User.UserName}', CAT_STRING = '{oThemeString}' WHERE CAT_TITLE = '{ClassConstants.USER_CATALOG_APPLICATION_THEME}' AND USR_ID = {My.Application.User.UserId}" If My.Database.ExecuteNonQuery(oUpd, DigitalData.Modules.EDMI.API.Constants.DatabaseType.IDB) = True Then bsiInfo.Caption = "Application Theme saved!" End If Catch ex As Exception MsgBox(ex.Message, MsgBoxStyle.Critical, Text) End Try End Sub Private Sub ToggleSwitchDebug_Toggled(sender As Object, e As EventArgs) Handles ToggleSwitchDebug.Toggled If oFormLoaded = False Then Exit Sub End If Dim oSwitch As ToggleSwitch = sender If oSwitch.IsOn Then My.LogConfig.Debug = True Else My.LogConfig.Debug = False End If My.UIConfigManager.Save() bsiInfo.Caption = "DEBUG saved!" End Sub End Class