1952 lines
84 KiB
VB.net

Imports DevExpress.LookAndFeel
Imports System.Globalization
Imports DevExpress.Utils
Imports DevExpress.XtraGrid.Views.Grid.ViewInfo
Imports DevExpress.XtraGrid.Views.Grid
Imports DevExpress.XtraGrid
Imports DevExpress.XtraNavBar
Imports DevExpress.XtraGrid.Columns
Imports DevExpress.XtraCharts
Imports DevExpress.XtraGrid.Views.Base
Imports DevExpress.XtraEditors.Controls
Imports System.Threading
Imports System.ComponentModel
Imports System.IO
Imports System.Drawing.Imaging
Public Class frmMain
Private UserLoggedin As Integer = 0
Private CURR_DT_VWPM_PROFILE_ACTIVE As DataTable
Private CURR_DT_OVERVIEW As DataTable
Private RedDocuments As Integer = 0
Private YellowDocuments As Integer = 0
Private GreenDocuments As Integer = 0
Private GridViewItem_Clicked = Nothing
Private GridCursorLocation As Point
Private GRID_LOAD_TYPE As String = "OVERVIEW"
Private GRID_INV_COL_REMOVED As Boolean = False
Private NO_WORKFLOWITEMS As Boolean = False
Private InResetlayout As Boolean = False
Private RefreshHelper As RefreshHelper
Private formopenClose As Boolean = False
Private formShown As Boolean = False
Private allgFunk As New ClassAllgemeineFunktionen
Private CurrNavBarGroup As NavBarGroup
Private DT_CHECKUSER_MODULE As DataTable
Private IsFilterMode As Boolean
Private Sub frmMain_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
Try
formopenClose = True
' Position und Größe speichern
My.Settings.frmMainSize = Me.Size
My.Settings.frmMainPosition = Me.Location
My.Settings.Save()
SaveGridLayout()
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Info("Error in Save FormLayout: " & ex.Message)
End Try
If IDB_ACTIVE = False Then
Try
If WINDREAM?.oSession?.aLoggedin = True Then
WINDREAM.Stop_WMCC_andCo()
End If
Catch ex As Exception
End Try
End If
Try
ClassAllgemeineFunktionen.LoginOut("LOGOUT")
LOGGER.Info("ProcessManager closed - " & Now, False)
Catch ex As Exception
LOGGER.Error(ex)
End Try
End Sub
Private Sub frmMain_KeyUp(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyUp
Select Case e.KeyCode
Case Keys.F12
frmLicense.ShowDialog()
End Select
End Sub
Private Sub frmMain_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Environment.UserName.ToLower = "schreiberm" Or Environment.UserName.ToLower = "jennej" Or Environment.UserName.ToLower = "marschreiber" Then
bbtniMetadataFile.Visibility = DevExpress.XtraBars.BarItemVisibility.Always
Else
bbtniMetadataFile.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
End If
formopenClose = True
LOGGER.Debug("Initializing MainForm....")
' Create helper to save/load expanded GroupColumns at runtime
RefreshHelper = New RefreshHelper(GridView_Docs, "GUID")
bsiVersion.Caption = String.Format("Version {0}", My.Application.Info.Version.ToString)
If ERROR_STATE = "NO DB-CONNECTION" Or ERROR_STATE = "FAILED DBCONNECTION" Then
MsgBox("Please add a database-Connection in AppConfig!", MsgBoxStyle.Critical, "Fehlende Konfiguration:")
frmKonfig.ShowDialog()
End If
Try
If CultureInfo.CurrentUICulture.ThreeLetterISOLanguageName = "eng" Then
LOGGER.Info("## CurrentUICulture.Name: " & CultureInfo.CurrentUICulture.Name, False)
INDEX_DMS_ERSTELLT = "DMS Created"
INDEX_DMS_ERSTELLT_ZEIT = "DMS Created Time"
My.Settings.Save()
End If
Catch ex As Exception
LOGGER.Error(ex)
MessageBox.Show("Error loading CurrentUICulture-Info!", "Attention:", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
End Try
If Refresh_ConnectionString() = True Then
Try
bsiLicenses.Caption = "Anzahl Lizenzen: " & LICENSE_COUNT
LOGGER.Debug("Initializing MainForm....")
If ERROR_STATE = "NO USER" Then
Dim oDT As DataTable = ClassAllgemeineFunktionen.GUI_LANGUAGE_INFO("No Userconfig")
MsgBox(oDT.Rows(0).Item("STRING1") & vbNewLine & oDT.Rows(0).Item("STRING2"), MsgBoxStyle.Critical, "Exception")
Me.Close()
ElseIf USER_IN_MODULE = False Then
If USER_IS_ADMIN = False Then
Dim oDT As DataTable = ClassAllgemeineFunktionen.GUI_LANGUAGE_INFO("No Module Configuration")
MsgBox(oDT.Rows(0).Item("STRING1") & vbNewLine & oDT.Rows(0).Item("STRING2"), MsgBoxStyle.Critical, "Exception")
Me.Close()
End If
Else
LOGGER.Info("Username: " & USER_USERNAME, False)
'Wenn license abgelaufen und der User nicht admin ist!
If LICENSE_EXPIRED = True Then
If USER_IS_ADMIN = False Then
MsgBox("License expired or invalid!" & vbNewLine & "Please contact the AdminTeam!", MsgBoxStyle.Critical, "Attention:")
Me.Close()
End If
End If
If USER_IS_ADMIN = True Then
RibbonPageGroup3.Visible = True
'Anzahl der eingeloggten User
bsiUserLoggedIn.Visibility = DevExpress.XtraBars.BarItemVisibility.Always
If USER_LANGUAGE <> "de-DE" Then
bsiUserLoggedIn.Caption = "License Count: " & USERCOUNT_LOGGED_IN
Else
bsiUserLoggedIn.Caption = "Lizenz-Zähler: " & USERCOUNT_LOGGED_IN
End If
Else
RibbonPageGroup3.Visible = False
bsiUserLoggedIn.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
End If
If MONITORING_ACTIVE = False Then
RibbonPageGroup2.Visible = False
Else
RibbonPageGroup2.Visible = True
End If
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Error in User Check:")
End Try
bsiUser.Caption = USER_USERNAME
GetBaseData("Load")
Try
If TimerRefresh.Enabled = False Then
TimerRefresh.Start()
End If
Timer5Mins.Start()
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Unexpected Error in LoadForm - Step 4: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Attention:")
End Try
LoadNavBar()
Try
If SHOW_CHARTS = True Then
If BASEDATA_DT_CHARTS.Rows.Count = 0 Then
bbtnitDashboardInv.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
Else
bbtnitDashboardInv.Visibility = DevExpress.XtraBars.BarItemVisibility.Always
End If
Else
bbtnitDashboardInv.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
End If
Catch ex As Exception
LOGGER.Warn($"Could not load Charts: {ex.Message}")
End Try
Check_Timer_Notification()
formShown = True
Restore_Form_Position()
If IDB_ACTIVE = False And ERROR_STATE = "" Then
Try
If Init_windream() = True Then
WINDREAM.Start_WMCC_andCo()
If Not IsNothing(WINDREAM.oSession) Then
If WINDREAM.oSession.aLoggedin = False Then
MsgBox("You could not be logged in to windream. Please check the log.", MsgBoxStyle.Critical)
End If
Else
MsgBox("Login on windream was not possible. Please check the log.", MsgBoxStyle.Critical)
End If
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Unexpected Error in windream-login - Step 5: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Attention:")
End Try
Else
SOURCE_INIT = Init_IDB()
If SOURCE_INIT = True Then
Dim oSQL = $"SELECT SQL_COMMAND FROM TBDD_SQL_COMMANDS WHERE TITLE = 'PM_IDB_DOC_DATA'"
IDB_DOC_DATA_SQL = ClassDatabase.Execute_Scalar(oSQL, CONNECTION_STRING)
LOGGER.Debug($"Got the IDB_DOC_DATA_SQL..{IDB_DOC_DATA_SQL}")
End If
bsiGeneralInfo.Caption = "IDB active"
End If
LOGGER.Debug("MainForm initialized!")
End If
formopenClose = False
End Sub
Sub Check_Timer_Notification()
Try
If CONFIG.Config.ReminderTimer <> 0 Then
TimerReminder.Stop()
TimerReminder.Interval = CONFIG.Config.ReminderTimer * 60000
TimerReminder.Start()
Else
TimerReminder.Enabled = False
TimerReminder.Stop()
End If
Catch ex As Exception
LOGGER.Error(ex)
End Try
End Sub
Sub Restore_Form_Position()
Try
'Sind Werte hinterlegt?
If My.Settings.frmMainPosition.IsEmpty = False Then
If My.Settings.frmMainPosition.X > 0 And My.Settings.frmMainPosition.Y > 0 Then
If Not My.Settings.frmMainSize.IsEmpty Then
If My.Settings.frmMainWindowState = "Normal" Then
Dim oisonscreen = IsOnScreen(My.Settings.frmMainPosition, My.Settings.frmMainSize)
If oisonscreen = False Then
Me.StartPosition = FormStartPosition.CenterScreen
Exit Sub
Else
' Gespeicherte Werte verwenden
Me.Location = Screen.AllScreens(UBound(Screen.AllScreens)).Bounds.Location + My.Settings.frmMainPosition
End If
Else
Me.WindowState = FormWindowState.Maximized
End If
End If
Else
LOGGER.Info("FormPosition is out of range!..Standard will be loaded!")
If My.Settings.frmMainWindowState = "Normal" Then
Me.StartPosition = FormStartPosition.CenterScreen
Else
Me.WindowState = FormWindowState.Maximized
End If
End If
End If
'Sind Werte hinterlegt?
'If Not My.Settings.frmMainSize.IsEmpty Then
' If My.Settings.frmMainWindowState = "Normal" Then
' Dim oisonscreen = IsOnScreen(My.Settings.frmMainPosition, My.Settings.frmMainSize)
' If oisonscreen = False Then
' Me.StartPosition = FormStartPosition.CenterScreen
' Exit Sub
' End If
' ' Gespeicherte Werte verwenden
' Try
' Me.Size = My.Settings.frmMainSize
' Catch ex As Exception
' End Try
' Else
' Me.WindowState = FormWindowState.Maximized
' End If
'End If
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Info("Error in Load FormLayout: " & ex.Message)
End Try
End Sub
Function IsOnScreen(ByVal RecLocation As System.Drawing.Point, ByVal RecSize As System.Drawing.Size, Optional MinPercentOnScreen As Double = 0.2)
Try
Dim PixelsVisible As Double = 0
Dim Rec As System.Drawing.Rectangle = New System.Drawing.Rectangle(RecLocation, RecSize)
For Each Scrn As Screen In Screen.AllScreens
Dim r As System.Drawing.Rectangle = System.Drawing.Rectangle.Intersect(Rec, Scrn.WorkingArea)
'intersect rectangle with screen
If (r.Width <> 0 And r.Height <> 0) Then
PixelsVisible += (r.Width * r.Height)
'tally visible pixels
End If
Next
Return PixelsVisible >= (Rec.Width * Rec.Height) * MinPercentOnScreen
Catch ex As Exception
Return False
End Try
End Function
Function Refresh_ConnectionString()
Try
TBPM_KONFIGURATIONTableAdapter.Connection.ConnectionString = CONNECTION_STRING
TBPM_PROFILETableAdapter.Connection.ConnectionString = CONNECTION_STRING
TBPM_USERTableAdapter.Connection.ConnectionString = CONNECTION_STRING
TBPM_PROFILE_FILESTableAdapter.Connection.ConnectionString = CONNECTION_STRING
Return True
Catch ex As Exception
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Error in Refresh_ConnectionString:")
Return False
End Try
End Function
Private Function GetXML_OverviewLayoutName()
Dim Filename As String = String.Format("DevExpressGridViewOverview_UserLayout_{0}.xml", GRID_LOAD_TYPE)
Return System.IO.Path.Combine(Application.UserAppDataPath(), Filename)
End Function
Private Sub SaveGridLayout()
If NO_WORKFLOWITEMS = True Then
Exit Sub
End If
Try
Dim xml As String = GetXML_OverviewLayoutName()
GridView_Docs.SaveLayoutToXml(xml, OptionsLayoutBase.FullLayout)
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Info("Error while saving GridLayout: " & ex.Message)
End Try
End Sub
Private Sub RestoreLayout()
If NO_WORKFLOWITEMS = True Then
Exit Sub
End If
Try
Dim oXml As String = GetXML_OverviewLayoutName()
GridView_Docs.RestoreLayoutFromXml(oXml, OptionsLayoutBase.FullLayout)
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Info("Error while restoring layout: " & ex.Message)
End Try
End Sub
Private Sub ResetLayout()
Try
Dim xml As String = GetXML_OverviewLayoutName()
IO.File.Delete(xml)
Try
GridView_Docs.Columns.Clear()
Catch ex As Exception
If IsNothing(GridView_Docs) Then
LOGGER.Warn("Somehow GridView_Docs is nothing....")
Else
If IsNothing(GridView_Docs.Columns) Then
LOGGER.Warn("Somehow GridView_Docs.Columns is nothing....")
End If
End If
Exit Sub
End Try
GridView_Docs.PopulateColumns()
If GridView_Docs.Columns.Count > 0 Then
GridView_Docs.Columns.Item("PROFILE_ID").Visible = False
GridView_Docs.Columns.Item("GUID").Visible = False
GridView_Docs.Columns.Item("FULL_FILE_PATH").Visible = False
'GridView_Docs.Columns.Item("DocID").Visible = False
GridView_Docs.Columns.Item("TL_STATE").Visible = False
GridView_Docs.Columns.Item("ICON").MaxWidth = 24
GridView_Docs.Columns.Item("ICON").MinWidth = 24
GridView_Docs.Columns.Item("ICON").AppearanceCell.BackColor = Color.White
GridView_Docs.Columns.Item("ICON").Fixed = FixedStyle.Left
Try
GridView_Docs.Columns("Last edited").DisplayFormat.FormatType = FormatType.DateTime
GridView_Docs.Columns("Last edited").DisplayFormat.FormatString = "dd.MM.yyyy HH:MM:ss"
Catch ex As Exception
Try
GridView_Docs.Columns("Zuletzt bearbeitet").DisplayFormat.FormatType = FormatType.DateTime
GridView_Docs.Columns("Zuletzt bearbeitet").DisplayFormat.FormatString = "dd.MM.yyyy HH:MM:ss"
Catch ex1 As Exception
LOGGER.Warn("(ResetLayout)Column [Last edited] or [Zuletzt bearbeitet] not part of OverviewSQL")
End Try
End Try
Try
GridView_Docs.Columns.Item("GROUP_TEXT").Visible = False
GridView_Docs.Columns.Item("GROUP_COLOR").Visible = False
Catch ex As Exception
End Try
End If
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Info("Error while resetting layout: " & ex.Message)
End Try
End Sub
Sub LoadNavBar()
Dim oStopWatch As New RefreshHelper.SW("LoadNavBar")
Dim profileGroupOpen As Boolean = False
If Not IsNothing(CurrNavBarGroup) Then
Try
profileGroupOpen = CurrNavBarGroup.Expanded
Try
CurrNavBarGroup.ItemLinks.Clear()
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Info("CurrGroupClear - Error: " & ex.Message)
End Try
Catch ex As Exception
End Try
End If
Try
If Load_Profiles_for_User() = False Then
Throw New Exception("Could not load Profiles. Datatable is empty")
Exit Sub
End If
Dim oCountItems As Integer = 0
For Each oProfileRow As DataRow In CURR_DT_VWPM_PROFILE_ACTIVE.Rows
If CInt(oProfileRow.Item("FILE_COUNT")) > 0 And (oProfileRow.Item("DISPLAY_MODE") = "Overview and Detail" Or oProfileRow.Item("DISPLAY_MODE") = "Detail") Then
oCountItems += 1
Dim item1 As NavBarItem = NavBarControl1.Items.Add()
item1.Caption = oProfileRow.Item("TITLE")
item1.Hint = oProfileRow.Item("TITLE")
item1.Appearance.TextOptions.WordWrap = WordWrap.Wrap
item1.Tag = "itmProfile#" & oProfileRow.Item("GUID").ToString
Dim _image As Image = Nothing
_image = DevExpress.Images.ImageResourceCache.Default.GetImage("images/business%20objects/bofileattachment_16x16.png")
item1.LargeImage = _image
item1.SmallImage = _image
NavBarControl1.Groups(1).ItemLinks.Add(item1)
AddHandler NavBarControl1.LinkClicked, AddressOf navBar_LinkClicked
End If
Next
If oCountItems > 0 Then
If NavBarControl1.Groups(1).Visible = False Then
NavBarControl1.Groups(1).Visible = True
End If
Else
If NavBarControl1.Groups(1).Visible = True Then
NavBarControl1.Groups(1).Visible = False
End If
End If
If Not IsNothing(CurrNavBarGroup) Then
CurrNavBarGroup.Expanded = profileGroupOpen
Else
NavBarControl1.Groups(1).Expanded = True
End If
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Info("Load_Profile_items - Error: " & ex.Message)
'MsgBox("Unexpected Error in Load_Profile_items - Error: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
oStopWatch.Done()
End Sub
Private Sub navBar_LinkClicked(ByVal sender As Object, ByVal e As NavBarLinkEventArgs)
' Das aktuelle Layout speichern, bevor das neue geladen wird
' und GRID_LOAD_TYPE gesetzt wird.
SaveGridLayout()
Dim _tag = e.Link.Item.Tag
If Not IsNothing(_tag) Then
If _tag.ToString.Contains("itmProfile#") Then
_tag = _tag.ToString.Replace("itmProfile#", "")
If IsNumeric(_tag) Then
If CURRENT_CLICKED_PROFILE_ID <> _tag Then
CURRENT_CLICKED_PROFILE_ID = _tag
CURRENT_CLICKED_PROFILE_TITLE = e.Link.Item.Caption
GRID_LOAD_TYPE = "PROFILE#" & CURRENT_CLICKED_PROFILE_ID.ToString
Load_single_Profile()
End If
End If
End If
End If
End Sub
Function Load_Profiles_for_User() As Boolean
Try
If IsNothing(CURR_DT_VWPM_PROFILE_ACTIVE) Then
Return False
End If
Return True
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Info("Load_Profiles_for_User - Error: " & ex.Message)
Return False
End Try
End Function
Sub Layout_Single_Profile()
If GridControl_Docs.Visible = False Then
BindingNavigator1.Visible = True
BindingNavigator1.Dock = DockStyle.Top
GridControl_Docs.Visible = True
End If
End Sub
Sub Load_single_Profile()
Try
Load_Profiles_for_User()
Layout_Single_Profile()
Dim expression As String
expression = "GUID = " & CURRENT_CLICKED_PROFILE_ID
Dim TEMP_TABLE = CURR_DT_VWPM_PROFILE_ACTIVE
Dim foundRows() As DataRow
foundRows = TEMP_TABLE.Select(expression)
Dim result = 0
For i = 0 To foundRows.GetUpperBound(0)
result += 1
Next
If result = 1 Then
ToolStripLabelViewTape.Text = "Detailansicht Profil: " & CURRENT_CLICKED_PROFILE_TITLE
Dim sql = foundRows(0)("SQL_VIEW")
sql = clsPatterns.ReplaceInternalValues(sql)
sql = clsPatterns.ReplaceUserValues(sql, USER_PRENAME, USER_SURNAME, USER_SHORTNAME, USER_LANGUAGE, USER_EMAIL, USER_ID, CURRENT_CLICKED_PROFILE_ID)
sql = sql.Replace("@USER_ID", USER_ID)
sql = sql.Replace("@USERNAME", USER_USERNAME)
sql = sql.Replace("@MACHINE_NAME", Environment.MachineName)
sql = sql.Replace("@DATE", Now.ToShortDateString)
sql = sql.Replace("@PROFILE_ID", CURRENT_CLICKED_PROFILE_ID)
CURR_DT_OVERVIEW = ClassDatabase.Return_Datatable(sql, True)
If CURR_DT_OVERVIEW.Rows.Count = 0 Then
NO_WORKFLOWITEMS = True
Else
NO_WORKFLOWITEMS = False
End If
Create_Basic_View()
RestoreLayout()
ToolStripLabelViewTape.Text = "Detailansicht Profil: " & CURRENT_CLICKED_PROFILE_TITLE
End If
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Info("Load_single_Profile - Error: " & ex.Message)
End Try
End Sub
Sub Create_Basic_View()
Try
GridControl_Docs.DataSource = Nothing
Try
GridView_Docs.Columns.Clear()
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Warn("Could not clear GridView_Docs.Columns")
End Try
' Spalte für Status Icon erstellen
Dim columnStateIcon As New DataColumn()
columnStateIcon.DataType = GetType(Image)
columnStateIcon.ColumnName = "ICON"
columnStateIcon.Caption = ""
CURR_DT_OVERVIEW.Columns.Add(columnStateIcon)
RedDocuments = 0
YellowDocuments = 0
GreenDocuments = 0
For Each row As DataRow In CURR_DT_OVERVIEW.Rows
Dim State As Integer = row.Item("TL_STATE")
Select Case State
Case 1
RedDocuments += 1
row.Item("ICON") = My.Resources.ampel_rot
Case 2
YellowDocuments += 1
row.Item("ICON") = My.Resources.ampel_gelb
Case 3
GreenDocuments += 1
row.Item("ICON") = My.Resources.ampel_gruen
End Select
Next
bindsourcegrid.DataSource = CURR_DT_OVERVIEW
GridControl_Docs.DataSource = bindsourcegrid
'GridControlDocRow.ForceInitialize()
RestoreLayout()
GridView_Docs.Columns.Item("PROFILE_ID").Visible = False
GridView_Docs.Columns.Item("GUID").Visible = False
GridView_Docs.Columns.Item("FULL_FILE_PATH").Visible = False
'GridView_Docs.Columns.Item("DocID").Visible = False
GridView_Docs.Columns.Item("TL_STATE").Visible = False
GridView_Docs.Columns.Item("ICON").MaxWidth = 24
GridView_Docs.Columns.Item("ICON").MinWidth = 24
GridView_Docs.Columns.Item("ICON").AppearanceCell.BackColor = Color.White
GridView_Docs.Columns.Item("ICON").Fixed = FixedStyle.Left
Try
GridView_Docs.Columns("Last edited").DisplayFormat.FormatType = FormatType.DateTime
GridView_Docs.Columns("Last edited").DisplayFormat.FormatString = "dd.MM.yyyy HH:MM:ss"
Catch ex As Exception
Try
GridView_Docs.Columns("Zuletzt bearbeitet").DisplayFormat.FormatType = FormatType.DateTime
GridView_Docs.Columns("Zuletzt bearbeitet").DisplayFormat.FormatString = "dd.MM.yyyy HH:MM:ss"
Catch ex1 As Exception
LOGGER.Warn("(CreateBasicView)Column [Last edited] or [Zuletzt bearbeitet] not part of OverviewSQL")
End Try
End Try
LOGGER.Debug("All columns in CreateBasicView created")
Try
GridView_Docs.Columns.Item("GROUP_TEXT").Visible = False
GridView_Docs.Columns.Item("GROUP_COLOR").Visible = False
Catch ex As Exception
End Try
LOGGER.Debug("All columns in CreateBasicView created")
Catch ex As Exception
LOGGER.Error(ex)
End Try
End Sub
Private Function GridLayoutChanged() As Boolean
Try
For Each oViewColumn As DataColumn In CURR_DT_OVERVIEW.Columns
If oViewColumn.Caption = "" Then
Continue For
End If
Dim oViewColumn_exists As Boolean = False
For Each oActGridColumn As GridColumn In GridView_Docs.Columns
Dim oGridDXFieldName = oActGridColumn.FieldName
Dim GridDXColumnEditName = oActGridColumn.ColumnEditName
Dim GridDXFieldName = oActGridColumn.FieldName
If oViewColumn.Caption = oGridDXFieldName Then
If oActGridColumn.Visible = False Then
If oViewColumn.Caption <> "GUID" And oViewColumn.Caption <> "TL_STATE" And oViewColumn.Caption <> "PROFILE_ID" And oViewColumn.Caption <> "DocID" And
oViewColumn.Caption <> "FULL_FILE_PATH" And oViewColumn.Caption <> "GROUP_COLOR" And oViewColumn.Caption <> "GROUP_TEXT" Then
Console.WriteLine($"ViewColumn [{oViewColumn.Caption}] is invisible")
Else
oViewColumn_exists = True
End If
Else
oViewColumn_exists = True
End If
End If
Next
If oViewColumn_exists = False Then
LOGGER.Info($"Following ViewColumn no longer exists in the view: [{oViewColumn.Caption}]")
Return True
End If
Next
For Each oActGridColumn As GridColumn In GridView_Docs.Columns
If oActGridColumn.Caption = "" Then
Continue For
End If
Dim oGridColumn_exists As Boolean = False
Dim oGridDXFieldName = oActGridColumn.FieldName
For Each oViewColumn As DataColumn In CURR_DT_OVERVIEW.Columns
If oViewColumn.Caption = oGridDXFieldName Then
oGridColumn_exists = True
End If
Next
If oGridColumn_exists = False Then
LOGGER.Info($"Following GridColumn no longer exists in the View: [{oGridDXFieldName}]")
Return True
End If
Next
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Info("Unexpected Error in GridLayoutChanged: " & ex.Message)
Return False
End Try
End Function
Private Sub NotifyIcon1_MouseDoubleClick(sender As System.Object, e As MouseEventArgs) Handles NotifyIcon1.MouseDoubleClick
BringMonitor2Front()
End Sub
Sub BringMonitor2Front()
Me.BringToFront()
Visible = True
End Sub
Private Sub Timer_Tick(sender As System.Object, e As EventArgs) Handles TimerRefresh.Tick
If TimerRefresh.Enabled = False Then
Exit Sub
End If
If bwBasicData.IsBusy Then
LOGGER.Info("bwBasicData is busy - no Refreshing")
Exit Sub
End If
If Application.OpenForms().OfType(Of frmValidator).Any Then
Exit Sub
End If
If Application.OpenForms().OfType(Of frmAdministration).Any Then
Exit Sub
End If
If Application.OpenForms().OfType(Of frmAdmin2).Any Then
Exit Sub
End If
If GridControl_Docs.Visible = True And formopenClose = False Then RefreshHelper.SaveViewInfo()
'If Not Application.OpenForms().OfType(Of frmValidator).Any Then
' Dim oUpdate = "Not Defined"
' Try
' oUpdate = $"UPDATE TBPM_PROFILE_FILES SET IN_WORK = 0, WORK_USER = NULL, IN_WORK_WHEN = NULL where UPPER(WORK_USER) = UPPER('{USER_USERNAME}')"
' ClassDatabase.Execute_non_Query(oUpdate)
' Catch ex As Exception
' LOGGER.Warn($"Unexpected Error in freefileforUser [{oUpdate}] - {ex.Message}")
' End Try
'End If
If bwSync.IsBusy Then
Exit Sub
End If
Try
SaveGridLayout()
'bwSync.ReportProgress(10)
LoadNavBar()
'bwSync.ReportProgress(60)
Dim oStopWatch As New RefreshHelper.SW("Decide_Load")
Decide_Load()
oStopWatch.Done()
'bwSync.ReportProgress(95)
If USER_LANGUAGE <> "de-DE" Then
bsilastsync.Caption = "Last Client-Sync: " & Now.ToLongTimeString
Else
bsilastsync.Caption = "Letzte Synchronisation: " & Now.ToLongTimeString
End If
If GridControl_Docs.Visible = True And formopenClose = False Then RefreshHelper.LoadViewInfo()
Handling_DEBUG_USER()
Catch ex As Exception
LOGGER.Error(ex)
End Try
'BarEditItem1.Visibility = DevExpress.XtraBars.BarItemVisibility.Always
'' call this method to start your asynchronous Task.
'bwSync.RunWorkerAsync()
End Sub
Private Sub NotifyIcon1_Click(sender As System.Object, e As EventArgs) Handles NotifyIcon1.Click
BringMonitor2Front()
End Sub
Private Sub Decide_Load()
Try
If USER_EXISTS = False Then
Exit Sub
End If
If TimerRefresh.Enabled = True Then
TimerRefresh.Enabled = False
End If
If GRID_LOAD_TYPE = "OVERVIEW" Then
Load_Grid_Overview()
ElseIf GRID_LOAD_TYPE.StartsWith("PROFILE#") Then
Load_single_Profile()
End If
If SHOW_MASS_VALIDATOR = False Then
GridView_Docs.OptionsSelection.MultiSelect = False
tsmiMarkedFilesFinish.Visible = False
ToolStripSeparator4.Visible = False
Else
tsmiMarkedFilesFinish.Visible = True
ToolStripSeparator4.Visible = True
GridView_Docs.OptionsSelection.MultiSelect = True
End If
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Info("Unexpected error in Decide_load: " & ex.Message)
End Try
If TimerRefresh.Enabled = False Then
TimerRefresh.Enabled = True
End If
End Sub
Private Sub ToolStripButton2_Click_2(sender As Object, e As EventArgs)
frmAdminPasswort.ShowDialog()
End Sub
Public Sub New()
Dim splash As New frmSplash()
Try
splash.ShowDialog()
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Info($"Error in Splash: {ex.Message}")
End Try
Try
If USER_LANGUAGE <> "" Then
Dim cultureInfo As System.Globalization.CultureInfo
cultureInfo = New System.Globalization.CultureInfo(USER_LANGUAGE)
cultureInfo.DateTimeFormat.ShortDatePattern = USER_DATE_FORMAT
Thread.CurrentThread.CurrentCulture = cultureInfo
Thread.CurrentThread.CurrentUICulture = cultureInfo
CultureInfo.DefaultThreadCurrentCulture = cultureInfo
CultureInfo.DefaultThreadCurrentUICulture = cultureInfo
End If
Catch ex As Exception
End Try
Try
InitializeComponent()
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Info($"Error in InitializeComponent: {ex.Message}")
End Try
End Sub
Private Sub TimerReminder_Tick(sender As Object, e As EventArgs) Handles TimerReminder.Tick
If Application.OpenForms().OfType(Of frmValidator).Any Then
Exit Sub
End If
If CURR_DT_OVERVIEW.Rows.Count > 0 Then
Dim oMessage As String = ClassAllgemeineFunktionen.GUI_LANGUAGE_INFO("App.ReminderPipeline")
NotifyIcon1.ShowBalloonTip(30000, $"Reminder {ADDITIONAL_TITLE}", oMessage, ToolTipIcon.Info)
End If
End Sub
Sub Load_Profil_from_Grid(pProfilID As Integer)
Try
'Me.Visible = False
CURRENT_ProfilGUID = pProfilID
' CURRENT_ProfilName = ClassDatabase.Execute_Scalar("SELECT NAME FROM TBPM_PROFILE WHERE GUID = " & CURRENT_ProfilGUID, CONNECTION_STRING)
'My.Settings.Save()
Dim omsg = "Es ist bereits ein Workflow geöffnet!"
Dim omsgTitle = "Achtung:"
If USER_LANGUAGE <> "de-DE" Then
omsg = "There is already a workflow active!"
omsgTitle = "Attention:"
End If
' Dim th As System.Threading.Thread
If Not Application.OpenForms().OfType(Of frmValidator).Any Then
If TimerRefresh.Enabled Then
TimerRefresh.Enabled = False
End If
If CHANGES_FORM_DESIGN = True Then
LoadCURRENT_DT_PROFILES()
LoadVWPM_CONTROL_INDEX()
CHANGES_FORM_DESIGN = False
End If
Dim oExpression = $"GUID = {CURRENT_ProfilGUID}"
CURRENT_DT_PROFILE.Clear()
CURRENT_DT_PROFILES.Select(oExpression).CopyToDataTable(CURRENT_DT_PROFILE, LoadOption.PreserveChanges)
If CURRENT_DT_PROFILE.Rows.Count = 1 Then
CURRENT_ProfilName = CURRENT_DT_PROFILE.Rows(0).Item("NAME")
Else
Exit Sub
End If
BASEDATA_DT_PROFILE_SEARCHES_DOC.Clear()
oExpression = $"PROFILE_ID = {CURRENT_ProfilGUID}"
BASEDATA_DT_PROFILES_SEARCHES_DOC.Select(oExpression, "TAB_INDEX").CopyToDataTable(BASEDATA_DT_PROFILE_SEARCHES_DOC, LoadOption.PreserveChanges)
'CURRENT_DT_PROFILE_SEARCHES_DOC = ClassDatabase.Return_Datatable(String.Format("select * from TBPM_PROFILE_SEARCH where PROFILE_ID = {0} AND TYPE = 'DOC' AND ACTIVE = 1 ORDER BY TAB_INDEX", CURRENT_ProfilGUID))
BASEDATA_DT_PROFILE_SEARCHES_SQL.Clear()
BASEDATA_DT_PROFILES_SEARCHES_SQL.Select(oExpression, "TAB_INDEX").CopyToDataTable(BASEDATA_DT_PROFILE_SEARCHES_SQL, LoadOption.PreserveChanges)
'CURRENT_DT_PROFILE_SEARCHES_SQL = ClassDatabase.Return_Datatable(String.Format("select * from TBPM_PROFILE_SEARCH where PROFILE_ID = {0} AND TYPE = 'SQL' AND ACTIVE = 1 ORDER BY TAB_INDEX", CURRENT_ProfilGUID))
frmValidator.Show()
'Decide_Load()
TimerRefresh.Enabled = True
Dim iterateIndex As Integer = 0
Dim oNewDataTable As DataTable = CURR_DT_OVERVIEW.Copy
For Each row As DataRow In oNewDataTable.Rows
If row("GUID") = CURRENT_DOC_GUID Then
CURR_DT_OVERVIEW.Rows.RemoveAt(iterateIndex)
Exit For
Else
iterateIndex += 1
End If
Next
' th = New Threading.Thread(AddressOf Task_A)
' th.SetApartmentState(ApartmentState.STA)
' th.Start()
Else
LOGGER.Debug("Validator is already open...")
MsgBox(omsg, MsgBoxStyle.Exclamation, omsgTitle)
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Unexpected error in Load_Profil_from_Grid: ")
End Try
'Me.Visible = True
'Decide_Load()
End Sub
'Public Sub Task_A()
' Dim frmA = New frmValidator() ' Must be created on this thread!
' Application.Run(frmA)
'End Sub
Private Sub ContextMenuGrid_Opening(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles ContextMenuGrid.Opening
CMFileStart.Enabled = False
CMGroupStart.Enabled = False
tsmiMarkedFilesFinish.Enabled = False
Dim selectedRows As Integer() = GridView_Docs.GetSelectedRows()
If selectedRows.Count > 0 Then
tsmiMarkedFilesFinish.Enabled = True
End If
Select Case GridViewItem_Clicked
Case "GROUP"
CMGroupStart.Enabled = True
Case "ROW"
If selectedRows.Count > 1 Then
CMFileStart.Enabled = False
Else
CMFileStart.Enabled = True
End If
If CURRENT_CLICKED_PROFILE_ID > 0 Then
CMGroupStart.Enabled = True
End If
End Select
End Sub
Private Sub CMFileStart_Click(sender As Object, e As EventArgs) Handles CMFileStart.Click
Item_Scope("CMROW")
End Sub
Private Sub Item_Scope(startedFrom As String)
Try
If Application.OpenForms().OfType(Of frmValidator).Any Then
bsiMessage.Caption = "There is already an active workflow!"
LOGGER.Info("Item Scope - Workflow open! - Exit")
bsiMessage.ItemAppearance.Normal.BackColor = Color.Red
Exit Sub
End If
bsiMessage.Caption = ""
bsiMessage.ItemAppearance.Normal.BackColor = Color.Transparent
Dim OItemScopeInfo = "No Item so far"
'GridView_Docs.EndSelection()
CURRENT_JUMP_DOC_GUID = 0
Dim hitInfo As GridHitInfo = GridView_Docs.CalcHitInfo(GridCursorLocation)
Dim groupRowText
Dim oHitProfilID
If hitInfo.InGroupRow Then
GridViewItem_Clicked = "GROUP"
LOGGER.Debug($"Item_Scope: InGroupRow")
OItemScopeInfo = "InGroupRow"
groupRowText = GridView_Docs.GetGroupRowDisplayText(hitInfo.RowHandle)
OItemScopeInfo = $"groupRowText {groupRowText}"
LOGGER.Debug($"Item_Scope: groupRowText {groupRowText}")
oHitProfilID = GridView_Docs.GetRowCellValue(GridView_Docs.GetDataRowHandleByGroupRowHandle(hitInfo.RowHandle), GridView_Docs.Columns("PROFILE_ID"))
ElseIf hitInfo.InDataRow Then
GridViewItem_Clicked = "ROW"
OItemScopeInfo = "InDataRow"
LOGGER.Debug($"Item_Scope: InDataRow")
If GRID_LOAD_TYPE = "OVERVIEW" Then
OItemScopeInfo = $"GRID_LOAD_TYPE = OVERVIEW"
LOGGER.Debug($"Item_Scope: GRID_LOAD_TYPE = OVERVIEW")
groupRowText = GridView_Docs.GetGroupRowDisplayText(GridView_Docs.GetParentRowHandle(hitInfo.RowHandle))
OItemScopeInfo = $"OVERVIEWgroupRowText {groupRowText}"
LOGGER.Debug($"Item_Scope: OVERVIEWgroupRowText {groupRowText}")
oHitProfilID = GridView_Docs.GetRowCellValue(GridView_Docs.GetDataRowHandleByGroupRowHandle(GridView_Docs.GetParentRowHandle(hitInfo.RowHandle)), GridView_Docs.Columns("PROFILE_ID"))
Else
OItemScopeInfo = $"NOT GRID_LOAD_TYPE = OVERVIEW"
LOGGER.Debug($"Item_Scope: NOT GRID_LOAD_TYPE = OVERVIEW")
If IsNothing(CURRENT_CLICKED_PROFILE_ID) = False Then
LOGGER.Debug($"Item_Scope: CURRENT_CLICKED_PROFILE_ID [{CURRENT_CLICKED_PROFILE_ID}]")
oHitProfilID = CURRENT_CLICKED_PROFILE_ID
Else
LOGGER.Warn("In ItemScope: CURRENT_CLICKED_PROFILE_ID is nothing!!!")
Exit Sub
End If
End If
Else
Exit Sub
End If
Dim PROFIL_TITLE
If GRID_LOAD_TYPE = "OVERVIEW" Then
Try
groupRowText = LTrim(RTrim(groupRowText.ToString.Replace("GROUP_TEXT: ", "")))
Catch ex As Exception
End Try
Dim _SPLIT As String()
_SPLIT = groupRowText.Split("|")
PROFIL_TITLE = LTrim(RTrim(_SPLIT(0).ToString))
Else
End If
If Not IsNothing(oHitProfilID) And IsNumeric(oHitProfilID) Then
LOGGER.Debug($"Item_Scope: Not IsNothing(PROFIL_ID) And IsNumeric(PROFIL_ID)")
Dim expression As String
expression = "PROFILE_ID = " & oHitProfilID
If hitInfo.InGroupRow Or (startedFrom = "CMGROUP" And hitInfo.InDataRow) Then
CURRENT_JUMP_DOC_GUID = 0
CURRENT_DOC_GUID = 0
CURRENT_ProfilGUID = oHitProfilID
Load_Profil_from_Grid(oHitProfilID)
ElseIf hitInfo.InDataRow Then
LOGGER.Debug($"Item_Scope: hitInfo.InDataRow...")
Dim oFocusedDocGUID = GridView_Docs.GetFocusedRowCellValue(GridView_Docs.Columns("GUID"))
Dim oFocusedDocID = GridView_Docs.GetFocusedRowCellValue(GridView_Docs.Columns("DocID"))
If IsNothing(oFocusedDocID) Then
LOGGER.Warn("In hitInfo.InDataRow: DocID is nothing!!!")
bsiMessage.Caption = "Error getting DocID!"
bsiMessage.ItemAppearance.Normal.BackColor = Color.Red
Exit Sub
End If
If IsNothing(oFocusedDocGUID) Then
LOGGER.Warn("In hitInfo.InDataRow: oFocusedDocGUID is nothing!!!")
bsiMessage.Caption = "Error getting DocGUID!"
bsiMessage.ItemAppearance.Normal.BackColor = Color.Red
Exit Sub
End If
LOGGER.Debug($"Item_Scope: GotDocID {oFocusedDocID} and DocGUID {oFocusedDocGUID}")
Dim DOC_PATH = GridView_Docs.GetFocusedRowCellValue(GridView_Docs.Columns("FULL_FILE_PATH"))
If IsNothing(DOC_PATH) Then
LOGGER.Warn("In hitInfo.InDataRow: DOC_PATH is nothing!!!")
Exit Sub
End If
DOC_PATH = DOC_PATH.Replace("W:\", "\\windream\objects\")
DOC_PATH = DOC_PATH.Replace("K:\", "\\windream\objects\")
'Checking if table really contains one record with profile-id and docid
expression = expression & " AND DocID = " & oFocusedDocID
Dim TEMP_TABLE = CURR_DT_OVERVIEW
Dim foundRows() As DataRow
foundRows = TEMP_TABLE.Select(expression)
Dim result = 0
For i = 0 To foundRows.GetUpperBound(0)
result += 1
Next
If result = 1 Then
CURRENT_DOC_ID = oFocusedDocID
CURRENT_JUMP_DOC_GUID = oFocusedDocGUID
CURRENT_DOC_GUID = CURRENT_JUMP_DOC_GUID
CURRENT_DOC_PATH = DOC_PATH
Dim oSQL = $"SELECT [dbo].[FNPM_CHECK_DocGUID_Valid] ({CURRENT_DOC_GUID})"
Dim oResult = ClassDatabase.Execute_Scalar(oSQL, CONNECTION_STRING)
Try
If CBool(oResult) = True Then
Load_Profil_from_Grid(oHitProfilID)
Else
Dim omsg As String = "Achtung: der gewählte Beleg ist durch einen anderen Benutzer bereits in Bearbeitung oder anderweitig gesperrt"
Dim otitle = "Achtung:"
If USER_LANGUAGE <> "de-DE" Then
omsg = "Attention: the item You chose is rather in work or locked from another user!"
otitle = "Attention:"
End If
MsgBox(omsg, MsgBoxStyle.Exclamation, otitle)
End If
Catch ex As Exception
LOGGER.Warn($"Uenxpected error in Checking freefile - sql so far: {oSQL} - ")
End Try
Else
Exit Sub
End If
End If
Else
MsgBox("Could not get the ProfileID of file! - Check Your configuration of MainView!", MsgBoxStyle.Critical, ADDITIONAL_TITLE)
End If
Catch ex As Exception
LOGGER.Error(ex)
allgFunk.Insert_LogEntry($"{ex.Message} - Stack: [{ex.StackTrace}]")
MsgBox("Unexpected error in Item_Scope: " & ex.Message & vbNewLine & "Choose file again!", MsgBoxStyle.Information, ADDITIONAL_TITLE)
End Try
End Sub
Private Function Init_IDB()
Try
IDBData = New ClassIDBData()
Return True
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Error Init_IDB:" & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Attention:")
LOGGER.Info("Unexpected error in Init_IDB: " & ex.Message, True)
Return False
End Try
End Function
Private Function Init_windream()
Try
'_windream = New ClassWindream_allgemein
'_windream.Create_Session()
'_windreamPM = New ClassPMWindream()
'_windreamPM.Create_Session()
WINDREAM = New ClassPMWindream()
WINDREAM.Create_Session()
WINDREAM_ALLG = New ClassWindream_allgemein
Return WINDREAM.IsLoggedIn
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Error Init_windream:" & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Attention:")
LOGGER.Info("Unexpected error in Init_windream: " & ex.Message, True)
Return False
End Try
End Function
Private Sub tsmiMarkedFilesFinish_Click(sender As Object, e As EventArgs) Handles tsmiMarkedFilesFinish.Click
Try
Dim oSelectedRows As Integer() = GridView_Docs.GetSelectedRows()
Dim oHitInfo As GridHitInfo = GridView_Docs.CalcHitInfo(GridCursorLocation)
Dim oSelectedRowHandle As Integer = oHitInfo.RowHandle
Dim oWorkedFiles As Integer = 0
Dim oProfileId = 0
If oSelectedRows.Count = 0 Then
If USER_LANGUAGE = "de-DE" Then
MsgBox("Bitte selektieren Sie einige 1 oder mehr Dokumente", MsgBoxStyle.Exclamation, "Massenabschluss")
Else
MsgBox("Please select some documents!", MsgBoxStyle.Exclamation, "Mass Validation")
End If
Exit Sub
End If
oProfileId = GridView_Docs.GetRowCellValue(oSelectedRows.Last(), GridView_Docs.Columns("PROFILE_ID"))
If oProfileId = 0 Then
MsgBox("Could not select a profile!", MsgBoxStyle.Exclamation, "Mass Validation")
Exit Sub
End If
If SOURCE_INIT = True Then
CURRENT_ProfilGUID = oProfileId
CURRENT_DT_FINAL_INDEXING = ClassDatabase.Return_Datatable(String.Format("select * from TBPM_PROFILE_FINAL_INDEXING where PROFIL_ID = {0}", CURRENT_ProfilGUID))
CURRENT_DT_PROFILE.Clear()
Dim oExpression = $"GUID = {CURRENT_ProfilGUID}"
CURRENT_DT_PROFILES.Select(oExpression).CopyToDataTable(CURRENT_DT_PROFILE, LoadOption.PreserveChanges)
If CURRENT_DT_PROFILE.Rows.Count = 1 Then
CURRENT_ProfilName = CURRENT_DT_PROFILE.Rows(0).Item("NAME")
Else
Exit Sub
End If
CURRENT_PROFILE_LOG_INDEX = CURRENT_DT_PROFILE.Rows(0).Item("PM_VEKTOR_INDEX")
If CURRENT_PROFILE_LOG_INDEX = "" Then
CURRENT_PROFILE_LOG_INDEX = CURRENT_DT_PROFILE.Rows(0).Item("LOG_INDEX")
End If
Dim NewDatatable As New DataTable
NewDatatable.Columns.Add("DocID")
NewDatatable.Columns.Add("DOC_GUID")
NewDatatable.Columns.Add("FULL_PATH")
For Each oRowHandle As Integer In oSelectedRows
Dim oDocID = GridView_Docs.GetRowCellValue(oRowHandle, "DocID")
If IsNothing(oDocID) Then
Continue For
End If
Dim R As DataRow = NewDatatable.NewRow
CURRENT_DOC_ID = oDocID
Dim DOC_PATH = GridView_Docs.GetRowCellValue(oRowHandle, "FULL_FILE_PATH")
CURRENT_DOC_PATH = DOC_PATH
CURRENT_DOC_GUID = GridView_Docs.GetRowCellValue(oRowHandle, "GUID")
R("DocID") = CURRENT_DOC_ID
R("FULL_PATH") = CURRENT_DOC_PATH
R("DOC_GUID") = GridView_Docs.GetRowCellValue(oRowHandle, "GUID")
NewDatatable.Rows.Add(R)
Next
CURRENT_DT_MASS_CHANGE_DOCS = Nothing
CURRENT_DT_MASS_CHANGE_DOCS = NewDatatable
TimerRefresh.Enabled = False
frmMassValidator.ShowDialog()
LoadNavBar()
Decide_Load()
Else
If USER_LANGUAGE = "de-DE" Then
MsgBox("Massenabschluss konnte nicht ausgeführt werden, weil windream nicht initialisiert werden konnte!", MsgBoxStyle.Critical, "Massenabschluss")
Else
MsgBox("Massvalidation could not be completed because of an error in windream", MsgBoxStyle.Critical, "Massvalidation")
End If
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Unhandled Error in tsmiMarkedFilesFinish_Click: " & ex.Message)
End Try
End Sub
Private Sub CMGroupStart_Click(sender As Object, e As EventArgs) Handles CMGroupStart.Click
Item_Scope("CMGROUP")
End Sub
Private Sub NavBarItemOverview_LinkClicked(sender As Object, e As NavBarLinkEventArgs) Handles NavBarItemOverview.LinkClicked
' Das aktuelle Layout speichern, bevor das neue geladen wird
' und GRID_LOAD_TYPE gesetzt wird.
SaveGridLayout()
Load_Grid_Overview()
RefreshHelper.LoadViewInfo()
End Sub
Sub Load_Grid_Overview()
Dim oStopWatch As New RefreshHelper.SW("Load_Grid_Overview(LGO)")
Layout_Single_Profile()
GRID_LOAD_TYPE = "OVERVIEW"
CURRENT_CLICKED_PROFILE_ID = 0
If USER_LANGUAGE = "de-DE" Then
ToolStripLabelViewTape.Text = "Gesamtübersicht"
Else
ToolStripLabelViewTape.Text = "Overview"
End If
Try
bsiMessage.Caption = ""
If BASEDATA_DT_VW_PROFILE_USER.Rows.Count = 0 Then
LOGGER.Info("no profiles for user: '" & USER_USERNAME & "' configured!", False)
NO_WORKFLOWITEMS = True
bsiMessage.Caption = "Keine Profile für Ihren User hinterlegt"
oStopWatch.Done()
Exit Sub
End If
Dim oStopWatch1 As New RefreshHelper.SW("LGO#Load_Profiles_for_User")
Load_Profiles_for_User()
oStopWatch1.Done()
'ClassInit.InitBasics()
Dim oStopWatch2 As New RefreshHelper.SW("LGO#build CURR_DT_OVERVIEW")
Dim oSQLOverview = BASEDATA_DT_CONFIG.Rows(0).Item("SQL_PROFILE_MAIN_VIEW")
If IsDBNull(oSQLOverview) Then
bsiMessage.Caption = "No GROUP-CONFIG (SQL_PROFILE_MAIN_VIEW) in Baseconfig"
oStopWatch.Done()
oStopWatch2.Done()
Exit Sub
End If
oSQLOverview = clsPatterns.ReplaceInternalValues(oSQLOverview)
oSQLOverview = clsPatterns.ReplaceUserValues(oSQLOverview, USER_PRENAME, USER_SURNAME, USER_SHORTNAME, USER_LANGUAGE, USER_EMAIL, USER_ID, CURRENT_CLICKED_PROFILE_ID)
oSQLOverview = oSQLOverview.Replace("@USER_ID", USER_ID)
oSQLOverview = oSQLOverview.Replace("@USERNAME", USER_USERNAME)
oSQLOverview = oSQLOverview.Replace("@MACHINE_NAME", Environment.MachineName)
oSQLOverview = oSQLOverview.Replace("@DATE", Now.ToShortDateString)
oSQLOverview = oSQLOverview.Replace("@PROFILE_ID", CURRENT_CLICKED_PROFILE_ID)
'String.Format("SELECT '1' TL_STATE,T.PROFIL_ID,T1.TITLE, T.DocID, T.FILE_PATH, T.DMS_ERSTELLT_DATE,[dbo].[FNPM_LAST_WORKUSER_DOC] (T.PROFIL_ID,T.DocID) AS 'Last User',[dbo].[FNPM_LAST_EDITED_DOC] (T.PROFIL_ID,T.DocID) as 'Last edited' FROM TBPM_PROFILE_FILES T, VWPM_PROFILE_USER T1 " &
' "WHERE T.PROFIL_ID = T1.PROFIL_ID " &
' "AND T1.ACTIVE = 1 And (UPPER(T1.USERNAME) = UPPER('{0}')) Order By T1.PRIORITY", USER_USERNAME)
CURR_DT_OVERVIEW = ClassDatabase.Return_Datatable(oSQLOverview)
oStopWatch2.Done()
If Not IsNothing(CURR_DT_OVERVIEW) Then
LOGGER.Debug($"Datatable CURR_DT_OVERVIEW loaded: {CURR_DT_OVERVIEW.Rows.Count} rows")
NO_WORKFLOWITEMS = False
If CURR_DT_OVERVIEW.Rows.Count = 0 Then
If USER_LANGUAGE = "de-DE" Then
ToolStripLabelViewTape.Text = "Aktuell keine Workflowdaten vorhanden!"
Else
ToolStripLabelViewTape.Text = "No workflowdata!"
End If
NO_WORKFLOWITEMS = True
'MsgBox("Aktuell keine Workflowdaten vorhanden!", MsgBoxStyle.Information)
GridControl_Docs.Visible = False
bindsourcegrid.DataSource = Nothing
GridControl_Docs.DataSource = Nothing
Try
GridView_Docs.Columns.Clear()
Catch ex As Exception
LOGGER.Error(ex)
End Try
Exit Sub
End If
BindingNavigator1.Visible = True
BindingNavigator1.Dock = DockStyle.Top
GridControl_Docs.Visible = True
' Spalte für Status Icon erstellen
Dim columnStateIcon As New DataColumn()
columnStateIcon.DataType = GetType(Image)
columnStateIcon.ColumnName = "ICON"
columnStateIcon.Caption = ""
CURR_DT_OVERVIEW.Columns.Add(columnStateIcon)
RedDocuments = 0
YellowDocuments = 0
GreenDocuments = 0
For Each row As DataRow In CURR_DT_OVERVIEW.Rows
Dim State As Integer = row.Item("TL_STATE")
Select Case State
Case 1
RedDocuments += 1
row.Item("ICON") = My.Resources.ampel_rot
Case 2
YellowDocuments += 1
row.Item("ICON") = My.Resources.ampel_gelb
Case 3
GreenDocuments += 1
row.Item("ICON") = My.Resources.ampel_gruen
End Select
Next
bindsourcegrid.DataSource = CURR_DT_OVERVIEW
GridControl_Docs.DataSource = bindsourcegrid
If USER_LANGUAGE = "de-DE" Then
ToolStripLabelViewTape.Text = "Gesamtübersicht"
Else
ToolStripLabelViewTape.Text = "Overview"
End If
'GridControlDocRow.ForceInitialize()
' GridControl1.DataSource = CURR_DT_PROFILEGRID
If FORCE_LAYOUT_OVERVIEW = True And GridLayoutChanged() = True Then
ResetLayout()
SaveGridLayout()
Else
RestoreLayout()
End If
Try
LOGGER.Debug("Now Working on Groups..")
'GridView_Docs.OptionsBehavior.AutoExpandAllGroups = False
'GridView_Docs.OptionsView.ShowGroupedColumns = False
GridView_Docs.OptionsView.ShowGroupPanel = False
Dim oindex As Integer = 0
If Not IsNothing(BASEDATA_DTGRID_GROUPS) Then
For Each oGridGroup As DataRow In BASEDATA_DTGRID_GROUPS.Rows
LOGGER.Debug($"Addig group [{oGridGroup.Item("GROUPNAME")}] for Grid...")
GridView_Docs.Columns.Item(oGridGroup.Item("GROUPNAME")).GroupIndex = oindex
oindex += 1
Next
End If
Try
GridView_Docs.Columns.Item("GROUP_TEXT").Visible = False
GridView_Docs.Columns.Item("GROUP_COLOR").Visible = False
Catch ex As Exception
End Try
For index = 0 To GridView_Docs.GroupCount - 1
Dim v = GridView_Docs.GroupedColumns(index).ToString
LOGGER.Debug($"Addig tag [{GridView_Docs.Columns.Item("PROFILE_ID")}] for group...")
Dim sd = GridView_Docs.GroupedColumns(index).GetTextCaption
GridView_Docs.GroupedColumns(index).Tag = GridView_Docs.Columns.Item("PROFILE_ID")
Next
LOGGER.Debug("finished Grouping!")
GridView_Docs.Columns.Item("PROFILE_ID").Visible = False
GridView_Docs.Columns.Item("GUID").Visible = False
GridView_Docs.Columns.Item("FULL_FILE_PATH").Visible = False
'GridView_Docs.Columns.Item("DocID").Visible = False
GridView_Docs.Columns.Item("TL_STATE").Visible = False
GridView_Docs.Columns.Item("ICON").MaxWidth = 24
GridView_Docs.Columns.Item("ICON").MinWidth = 24
GridView_Docs.Columns.Item("ICON").AppearanceCell.BackColor = Color.White
GridView_Docs.Columns.Item("ICON").Fixed = DevExpress.XtraGrid.Columns.FixedStyle.Left
LOGGER.Debug(" GridView_Docs.Columns loaded...")
Try
GridView_Docs.Columns("Last edited").DisplayFormat.FormatType = FormatType.DateTime
GridView_Docs.Columns("Last edited").DisplayFormat.FormatString = "dd.MM.yyyy HH:MM:ss"
Catch ex As Exception
Try
GridView_Docs.Columns("Zuletzt bearbeitet").DisplayFormat.FormatType = FormatType.DateTime
GridView_Docs.Columns("Zuletzt bearbeitet").DisplayFormat.FormatString = "dd.MM.yyyy HH:MM:ss"
Catch ex1 As Exception
LOGGER.Warn("(LoadGridOverview)Column [Last edited] or [Zuletzt bearbeitet] not part of OverviewSQL")
End Try
End Try
LOGGER.Debug("finished Formatting Grid!")
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Info("Unexpected Error in Formatting Grid: " & ex.Message)
End Try
SaveGridLayout()
If GridView_Docs.Columns.Count <= 2 Then
LOGGER.Info("GridView_Docs.Columns.Count <= 2 - Reset_Gridlayout will be forced...", False)
Reset_GridLayout()
End If
Else
NO_WORKFLOWITEMS = True
GridControl_Docs.Visible = False
BindingNavigator1.Visible = False
BindingNavigator1.Dock = DockStyle.None
GridControl_Docs.DataSource = Nothing
Try
GridView_Docs.Columns.Clear()
Catch ex As Exception
LOGGER.Error(ex)
End Try
End If
oStopWatch.Done()
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Info("Load_Grid_Overview - Fehler: " & ex.Message)
End Try
End Sub
Private Sub tsmiValidationProfil_Click(sender As Object, e As EventArgs) Handles tsmiValidationProfil.Click
If CURRENT_CLICKED_PROFILE_ID <> 0 Then
Load_Profil_from_Grid(CURRENT_CLICKED_PROFILE_ID)
Else
MsgBox("Please choose a profile!", MsgBoxResult.Ok, ADDITIONAL_TITLE)
End If
End Sub
Private Sub TabellenlayoutZurücksetzenToolStripMenuItem_Click_1(sender As Object, e As EventArgs) Handles TabellenlayoutZurücksetzenToolStripMenuItem.Click
Reset_GridLayout()
End Sub
Sub Reset_GridLayout()
If GridControl_Docs.Visible = True And formopenClose = False Then RefreshHelper.SaveViewInfo()
InResetlayout = True
' Layout zurücksetzen
ResetLayout()
SaveGridLayout()
' Ansicht neu laden
LoadNavBar()
Decide_Load()
InResetlayout = False
RefreshHelper.LoadViewInfo()
End Sub
Private Sub GridView_Docs_DoubleClick(sender As Object, e As EventArgs) Handles GridView_Docs.DoubleClick
Item_Scope("DOUBLECLICK")
End Sub
Private Sub GridView_Docs_CustomDrawGroupRow(sender As Object, e As Views.Base.RowObjectCustomDrawEventArgs) Handles GridView_Docs.CustomDrawGroupRow
Try
If formShown = False Then
Exit Sub
End If
Dim info As GridGroupRowInfo = TryCast(e.Info, GridGroupRowInfo)
Dim view As GridView = sender
Dim item As GridGroupSummaryItem = CType(view.GroupSummary(Tag), GridGroupSummaryItem)
' Dim value As Object = view.GetGroupSummaryValue(e.RowHandle, item)
If info.Column.FieldName = "GROUP_TEXT" Then
info.GroupText = info.GroupValueText
Dim _color As String = "LightGray"
Dim _FontColor As String = "Black"
Dim oFoundConfig As Boolean = False
For Each row As DataRow In CURR_DT_VWPM_PROFILE_ACTIVE.Rows
LOGGER.Debug($"CustomDrawGroupRow: Working on ProfileID [{row.Item("GUID")}]...")
If row.Item("GROUP_TEXT") = info.GroupValueText Then
oFoundConfig = True
_color = row.Item("GROUP_COLOR")
_FontColor = row.Item("GROUP_FONT_COLOR")
End If
Next
If oFoundConfig = False Then
LOGGER.Info($"CustomDrawGroupRow: Could not find a ColorConfig for ProfileGroupValueText [{info.GroupValueText}]...")
End If
Dim oColor As Color
Dim oFontColor As Color
Try
If _color.Contains(";") Or _color.Contains(".") Then
Dim oColorSplit As String()
If _color.Contains(";") Then
oColorSplit = _color.Split(";")
ElseIf _color.Contains(".") Then
oColorSplit = _color.Split(".")
End If
Try
oColor = Color.FromArgb(oColorSplit(0), oColorSplit(1), oColorSplit(2))
Catch ex As Exception
LOGGER.Info($"CustomDrawGroupRow: Could not get Color.FromArgb [{_color}]")
oColor = Color.LightGray
End Try
Else
Try
oColor = Color.FromName(_color)
Catch ex As Exception
LOGGER.Info($"CustomDrawGroupRow: Could not get Color.FromName [{_color}]")
oColor = Color.LightGray
End Try
End If
If _FontColor.Contains(";") Then
Try
oFontColor = Color.FromArgb(_FontColor)
Catch ex As Exception
LOGGER.Info($"CustomDrawGroupRow: Could not get Color.FromArgb [{_FontColor}]")
oFontColor = Color.Black
End Try
Else
Try
oFontColor = Color.FromName(_FontColor)
Catch ex As Exception
LOGGER.Info($"CustomDrawGroupRow(FC): Could not get Color.FromName [{_FontColor}]")
oFontColor = Color.Black
End Try
End If
Catch ex As Exception
LOGGER.Info($"CustomDrawGroupRow(FC): Error getting Color [{_FontColor}]")
oColor = Color.LightGray
End Try
info.Appearance.BackColor = oColor
info.Appearance.ForeColor = oFontColor
End If
Catch ex As Exception
LOGGER.Error(ex)
End Try
End Sub
Private Sub GridView_Docs_MouseDown(sender As Object, e As MouseEventArgs) Handles GridView_Docs.MouseDown
Dim view As GridView = sender
Dim hi As GridHitInfo = view.CalcHitInfo(e.Location)
Dim groupRowButtonClicked = (hi.HitTest = GridHitTest.RowGroupButton)
GridCursorLocation = e.Location
'If e.Button = MouseButtons.Left Then
' wenn in eine Group Row Doppelt geklickt wurde..
If hi.InGroupRow And Not groupRowButtonClicked Then
' Ein/Ausklappen verhindern
DXMouseEventArgs.GetMouseArgs(e).Handled = True
GridViewItem_Clicked = "GROUP"
CURRENT_CLICKED_PROFILE_ID = GridView_Docs.GetRowCellValue(GridView_Docs.GetDataRowHandleByGroupRowHandle(hi.RowHandle), GridView_Docs.Columns("PROFILE_ID"))
ElseIf hi.InDataRow Then
GridViewItem_Clicked = "ROW"
CURRENT_CLICKED_PROFILE_ID = GridView_Docs.GetRowCellValue(GridView_Docs.GetDataRowHandleByGroupRowHandle(hi.RowHandle), GridView_Docs.Columns("PROFILE_ID"))
Else
GridViewItem_Clicked = Nothing
End If
End Sub
Private Sub GridView_Docs_ColumnWidthChanged(sender As Object, e As Views.Base.ColumnEventArgs) Handles GridView_Docs.ColumnWidthChanged
SaveGridLayout()
End Sub
Private Sub LayoutSpeichernToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles LayoutSpeichernToolStripMenuItem.Click
SaveGridLayout()
End Sub
Private Sub GridView_Docs_LostFocus(sender As Object, e As EventArgs) Handles GridView_Docs.LostFocus
' Save expanded GroupRows
If GridControl_Docs.Visible = True And formopenClose = False Then RefreshHelper.SaveViewInfo()
End Sub
Sub LoadCURRENT_DT_PROFILES()
CURRENT_DT_PROFILES = ClassDatabase.Return_Datatable("select * from TBPM_PROFILE where ACTIVE = 1")
End Sub
Sub LoadVWPM_CONTROL_INDEX()
Dim oSQL = $"SELECT * FROM VWPM_CONTROL_INDEX ORDER BY PROFIL_ID,Y_LOC, X_LOC"
DTVWCONTROLS_INDEX = ClassDatabase.Return_Datatable(oSQL)
End Sub
Sub GetBaseData(pMode As String)
Dim oStopWatch As New RefreshHelper.SW("GetBaseData")
Try
Dim oSQL = String.Format("SELECT * FROM [dbo].[FNDD_CHECK_USER_MODULE] ('{0}','PM',{1})", USER_USERNAME, CLIENT_SELECTED)
DT_CHECKUSER_MODULE = ClassDatabase.Return_Datatable(oSQL)
If pMode = "bwBasicData" Then bwBasicData.ReportProgress(10)
ClassParamRefresh.Refresh_Params(DT_CHECKUSER_MODULE)
If pMode = "bwBasicData" Then bwBasicData.ReportProgress(20)
oSQL = String.Format("SELECT T.* FROM VWPM_PROFILE_ACTIVE T WHERE T.FILE_COUNT > 0 AND T.GUID IN (SELECT PROFILE_ID FROM [dbo].[FNPM_GET_ACTIVE_PROFILES_USER] ({0}))", USER_ID)
CURR_DT_VWPM_PROFILE_ACTIVE = ClassDatabase.Return_Datatable(oSQL)
If pMode = "bwBasicData" Then bwBasicData.ReportProgress(30)
LoadCURRENT_DT_PROFILES()
If pMode = "Load" Then
CURRENT_DT_PROFILE = CURRENT_DT_PROFILES.Clone()
End If
If pMode = "bwBasicData" Then bwBasicData.ReportProgress(40)
BASEDATA_DT_PROFILES_SEARCHES_DOC = ClassDatabase.Return_Datatable("select * from TBPM_PROFILE_SEARCH where TYPE = 'DOC' AND ACTIVE = 1 ORDER BY PROFILE_ID,TAB_INDEX")
If pMode = "Load" Then
BASEDATA_DT_PROFILE_SEARCHES_DOC = BASEDATA_DT_PROFILES_SEARCHES_DOC.Clone()
End If
If pMode = "bwBasicData" Then bwBasicData.ReportProgress(50)
BASEDATA_DT_PROFILES_SEARCHES_SQL = ClassDatabase.Return_Datatable("select * from TBPM_PROFILE_SEARCH where TYPE = 'SQL' AND ACTIVE = 1 ORDER BY PROFILE_ID,TAB_INDEX")
If pMode = "Load" Then
BASEDATA_DT_PROFILE_SEARCHES_SQL = BASEDATA_DT_PROFILES_SEARCHES_SQL.Clone()
End If
If pMode = "bwBasicData" Then bwBasicData.ReportProgress(60)
LoadVWPM_CONTROL_INDEX()
If pMode = "bwBasicData" Then bwBasicData.ReportProgress(80)
If pMode = "Load" Then
DTVWCONTROL_INDEX = DTVWCONTROLS_INDEX.Clone()
End If
oSQL = $"SELECT * FROM TBPM_PROFILE_CONTROLS WHERE LEN(ISNULL(SQL_UEBERPRUEFUNG,'')) > 0 AND CTRL_TYPE <> 'BUTTON'"
DTCONTROLS_WITH_SQL = ClassDatabase.Return_Datatable(oSQL)
If pMode = "bwBasicData" Then bwBasicData.ReportProgress(85)
If pMode = "bwBasicData" Then bwBasicData.ReportProgress(100)
Catch ex As Exception
LOGGER.Warn($"Error in GetBaseData - Error: [{ex.Message}]")
End Try
oStopWatch.Done()
End Sub
Private Sub frmMain_Shown(sender As Object, e As EventArgs) Handles Me.Shown
Decide_Load()
Handling_DEBUG_USER()
If RIBBON_COLOR_SCHEME = "BLUE" Then
RibbonControl1.ColorScheme = DevExpress.XtraBars.Ribbon.RibbonControlColorScheme.Blue
ElseIf RIBBON_COLOR_SCHEME = "DarkBlue".ToUpper Then
RibbonControl1.ColorScheme = DevExpress.XtraBars.Ribbon.RibbonControlColorScheme.DarkBlue
ElseIf RIBBON_COLOR_SCHEME = "Green".ToUpper Then
RibbonControl1.ColorScheme = DevExpress.XtraBars.Ribbon.RibbonControlColorScheme.Green
ElseIf RIBBON_COLOR_SCHEME = "Orange".ToUpper Then
RibbonControl1.ColorScheme = DevExpress.XtraBars.Ribbon.RibbonControlColorScheme.Orange
ElseIf RIBBON_COLOR_SCHEME = "Purple".ToUpper Then
RibbonControl1.ColorScheme = DevExpress.XtraBars.Ribbon.RibbonControlColorScheme.Purple
ElseIf RIBBON_COLOR_SCHEME = "Red".ToUpper Then
RibbonControl1.ColorScheme = DevExpress.XtraBars.Ribbon.RibbonControlColorScheme.Red
ElseIf RIBBON_COLOR_SCHEME = "Teal".ToUpper Then
RibbonControl1.ColorScheme = DevExpress.XtraBars.Ribbon.RibbonControlColorScheme.Teal
Else
RibbonControl1.ColorScheme = DevExpress.XtraBars.Ribbon.RibbonControlColorScheme.Default
End If
LOGGER.Debug($" RibbonControl1.ColorScheme [{RIBBON_COLOR_SCHEME}]")
Me.Text = ADDITIONAL_TITLE
CurrNavBarGroup = NavBarControl1.Groups(1)
End Sub
Sub Handling_DEBUG_USER()
If USER_DEBUG_LOG = True Then
If USER_LANGUAGE = "de-DE" Then
bsiDebug.Caption = "HINWEIS: UserDebugMode ist eingeschaltet!"
Else
bsiDebug.Caption = "INFORMATION: UserDebugMode activated!"
End If
bsiDebug.Visibility = DevExpress.XtraBars.BarItemVisibility.Always
Else
bsiDebug.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
End If
End Sub
Sub DebuglogBackgroundthread()
Dim oSQL As String = "None"
Try
For Each oSLogstring As String In LOGCONFIG.Logs
Dim oLogSplit As String()
oLogSplit = oSLogstring.Split("|")
'Console.WriteLine(oLogSplit(2))
Dim omsg = oLogSplit(2).Replace("'", "''")
omsg = omsg.Replace("\\n", "")
omsg = omsg.Replace(Chr(10), "")
omsg = omsg.Replace(Chr(13), "")
Dim odatetime As Date = CDate(oLogSplit(0))
oSQL = $"INSERT INTO [dbo].[TBPM_LOG_DEBUG] ([USERID] , [LOGMSG], [ADDED_WHEN],DATE_STR) VALUES({USER_ID},'{omsg}',GetDate(),'{odatetime}')"
ClassDatabase.Execute_non_Query(oSQL)
Next
LOGCONFIG.ClearLogs()
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Warn($"oSQL so far [{oSQL}]")
End Try
End Sub
Private Sub tsslblDEBUG_LOG_MouseHover(sender As Object, e As EventArgs)
MsgBox("UserDebugMode is activated remotely. Debugdata will be transferred to database and will be deleted after 10 days!!", MsgBoxStyle.Information, ADDITIONAL_TITLE)
End Sub
Private Sub frmMain_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing
If Application.OpenForms().OfType(Of frmValidator).Any Then
frmValidator.Close()
End If
End Sub
Private Sub LöscheAlleFilterToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles LöscheAlleFilterToolStripMenuItem.Click
Try
GridView_Docs.ClearFindFilter()
GridView_Docs.ClearColumnsFilter()
SaveGridLayout()
Catch ex As Exception
End Try
End Sub
Private Sub ContextMenuNotifyIcon_Opening(sender As Object, e As CancelEventArgs) Handles ContextMenuNotifyIcon.Opening
If CONFIG.Config.ReminderTimer <> 0 Then
PopupErinnerungInaktivierenToolStripMenuItem.Text = "Popup Erinnerung inaktivieren"
Else
PopupErinnerungInaktivierenToolStripMenuItem.Text = $"Popup Erinnerung aktivieren ({CONFIG.Config.ReminderTimer} min)"
End If
End Sub
Private Sub PopupErinnerungInaktivierenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles PopupErinnerungInaktivierenToolStripMenuItem.Click
If CONFIG.Config.ReminderTimer <> 0 Then
CONFIG.Config.ReminderTimer = 0
CONFIG.Save()
Check_Timer_Notification()
Else
CONFIG.Config.ReminderTimer = 5
CONFIG.Save()
Check_Timer_Notification()
End If
End Sub
Private Sub AnzeigenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles AnzeigenToolStripMenuItem.Click
BringMonitor2Front()
End Sub
Private Sub frmMain_Resize(sender As Object, e As EventArgs) Handles Me.Resize
If formShown = False Then
Exit Sub
End If
If WindowState = FormWindowState.Maximized Then
My.Settings.frmMainWindowState = "Maximized"
ElseIf WindowState = FormWindowState.Normal Then
My.Settings.frmMainWindowState = "Normal"
End If
My.Settings.Save()
End Sub
Private Sub BarButtonItem3_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles bbtniGrundeinstellung.ItemClick
Try
frmKonfig.ShowDialog()
Refresh_ConnectionString()
' Load_Profil()
Check_Timer_Notification()
Catch ex As Exception
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler beim Laden Grundeinstellungen:")
End Try
End Sub
Private Sub bbtniRefresh_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles bbtniRefresh.ItemClick
If GridControl_Docs.Visible = True And formopenClose = False Then
RefreshHelper.SaveViewInfo()
SaveGridLayout()
End If
LoadNavBar()
Decide_Load()
If GridControl_Docs.Visible = True And formopenClose = False Then RefreshHelper.LoadViewInfo()
End Sub
Private Sub bbtniMonitor_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles bbtniMonitor.ItemClick
If Not Application.OpenForms().OfType(Of frmMonitor).Any Then
frmMonitor.Show()
End If
End Sub
Private Sub bbiProfilverwaltung_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles bbiProfilverwaltung.ItemClick
Dim AdminSecurity As Boolean = False
AdminSecurity = TBPM_KONFIGURATIONTableAdapter.cmdGetAdminSecurity()
If AdminSecurity = True Then
frmLoginAdmin.ShowDialog()
Else
frmAdministration.Show()
End If
End Sub
Private Sub bbiKonfiguration_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles bbiKonfiguration.ItemClick
frmAdmin2.ShowDialog()
End Sub
Private Sub bbtniMetadataFile_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles bbtniMetadataFile.ItemClick
frmDesignerLayout.Show()
End Sub
Private Sub bwSync_DoWork(sender As Object, e As DoWorkEventArgs) Handles bwSync.DoWork
End Sub
Private Sub bwSync_ProgressChanged(sender As Object, e As ProgressChangedEventArgs) Handles bwSync.ProgressChanged
BarEditItem1.EditValue = e.ProgressPercentage
End Sub
Private Sub Timer5Mins_Tick(sender As Object, e As EventArgs) Handles Timer5Mins.Tick
If Not bwBasicData.IsBusy Then
BarEditItem1.Caption = "Get BasicData"
BarEditItem1.Visibility = DevExpress.XtraBars.BarItemVisibility.Always
bwBasicData.RunWorkerAsync()
End If
If USER_DEBUG_LOG = True Then
' 'Jetzt de rinsert der Inhalte
If Not IsNothing(LOGCONFIG.Logs) Then
If LOGCONFIG.Logs.Count > 0 Then
' Dim odel = $"delete from TBPM_LOG_DEBUG where userid = {USER_ID}"
' ClassDatabase.Execute_non_Query(odel)
Dim thread As New Thread(AddressOf DebuglogBackgroundthread)
thread.Start()
End If
End If
End If
End Sub
Private Sub bwBasicData_DoWork(sender As Object, e As DoWorkEventArgs) Handles bwBasicData.DoWork
GetBaseData("bwBasicData")
End Sub
Private Sub bwBasicData_RunWorkerCompleted(sender As Object, e As RunWorkerCompletedEventArgs) Handles bwBasicData.RunWorkerCompleted
If USER_IS_ADMIN Then
If USER_LANGUAGE = "de-DE" Then
bsiUserLoggedIn.Caption = "License Count: " & USERCOUNT_LOGGED_IN
Else
bsiUserLoggedIn.Caption = "Lizenz-Zähler: " & USERCOUNT_LOGGED_IN
End If
End If
BarEditItem1.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
End Sub
Private Sub bwBasicData_ProgressChanged(sender As Object, e As ProgressChangedEventArgs) Handles bwBasicData.ProgressChanged
BarEditItem1.EditValue = e.ProgressPercentage
End Sub
Private Sub BarButtonItem2_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles bbtnitDashboardInv.ItemClick
If Application.OpenForms().OfType(Of frmInvDashboard).Any Then
Exit Sub
End If
frmInvDashboard.Show()
End Sub
Private Sub OutOfRangePMFixierenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles OutOfRangePMFixierenToolStripMenuItem.Click
Dim myPoint As Point = New Point(50, 50)
Me.Location = Screen.AllScreens(UBound(Screen.AllScreens)).Bounds.Location + myPoint
BringMonitor2Front()
End Sub
Private Sub GridView_Docs_RowStyle(sender As Object, e As RowStyleEventArgs) Handles GridView_Docs.RowStyle
If formShown = False Then
Exit Sub
End If
If e.RowHandle = -1 Then
IsFilterMode = True
Exit Sub
End If
If e.RowHandle = DevExpress.XtraGrid.GridControl.AutoFilterRowHandle Then
IsFilterMode = True
' e.Appearance.BackColor = Color.Yellow
Else
IsFilterMode = False
Try
Dim oRowColorCellValue = GridView_Docs.GetRowCellValue(e.RowHandle, "ROW_COLOR")
If Not IsNothing(oRowColorCellValue) Then
Dim oColor As Color
Try
If oRowColorCellValue.ToString.Contains(";") Or oRowColorCellValue.ToString.Contains(".") Then
Dim oColorSplit As String()
If oRowColorCellValue.Contains(";") Then
oColorSplit = oRowColorCellValue.Split(";")
ElseIf oRowColorCellValue.Contains(".") Then
oColorSplit = oRowColorCellValue.Split(".")
End If
Try
oColor = Color.FromArgb(oColorSplit(0), oColorSplit(1), oColorSplit(2))
Catch ex As Exception
LOGGER.Info($"RowColorHandler: Could not get Color.FromArgb [{oRowColorCellValue}]")
oColor = Color.LightGray
End Try
Else
Try
oColor = Color.FromName(oRowColorCellValue)
Catch ex As Exception
LOGGER.Info($"RowColorHandler: Could not get Color.FromName [{oRowColorCellValue}]")
End Try
End If
Catch ex As Exception
LOGGER.Info("RowBackColor: " & ex.Message, False)
Exit Sub
End Try
e.Appearance.BackColor = oColor
e.HighPriority = True
End If
Catch ex As Exception
LOGGER.Info("Unexpected Error in RowStyle: " & ex.Message, False)
End Try
End If
End Sub
End Class