Monorepo/GUIs.ZooFlow/Globix/frmGlobixAdministration.vb

265 lines
11 KiB
VB.net

Imports DevExpress.XtraLayout
Imports DigitalData.Modules.Logging
Public Class frmGlobixAdministration
Implements IAdminForm
Public Property PrimaryKey As Integer Implements IAdminForm.PrimaryKey
Public Property HasChanges As Boolean Implements IAdminForm.HasChanges
Public Property IsInsert As Boolean Implements IAdminForm.IsInsert
Private Logger As Logger
Private CURRCOntrolGroup As LayoutControlGroup
Public Sub New(PrimaryKey As Integer)
' Dieser Aufruf ist für den Designer erforderlich.
InitializeComponent()
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
Logger = My.LogConfig.GetLogger()
Me.PrimaryKey = PrimaryKey
Me.IsInsert = IsInsert
End Sub
Public Shared _Namenkonvention As String
Public Shared _aktDokart_Id As Integer
Private SourceAttributes As List(Of String)
Private SourceObjectTypes As List(Of String)
Private Current_ObjectType As String = ""
Private GroupToDelete As Integer = Nothing
Dim frmloaded As Boolean = False
Public Class FileConflictOption
Public Name As String
Public Value As String
Public Overrides Function ToString() As String
Return Name
End Function
End Class
Private Sub frmGlobixAdministration_Load(sender As Object, e As EventArgs) Handles Me.Load
Try
Me.TBDD_DOKUMENTARTTableAdapter.Connection.ConnectionString = My.DatabaseECM.CurrentSQLConnectionString
'Me.TBDD_EINGANGSARTENTableAdapter.Connection.ConnectionString = MyConnectionString
'Me.TBDD_MODULESTableAdapter.Connection.ConnectionString = MyConnectionString
'Me.TBDD_DOKART_MODULETableAdapter.Connection.ConnectionString = MyConnectionString
'TBDD_INDEX_MANTableAdapter.Connection.ConnectionString = MyConnectionString
'TBDD_INDEX_AUTOMTableAdapter.Connection.ConnectionString = MyConnectionString
'Me.TBDD_USERTableAdapter.Connection.ConnectionString = MyConnectionString
'Me.TBGI_CONFIGURATIONTableAdapter.Connection.ConnectionString = MyConnectionString
'Me.TBDD_INDEX_MAN_POSTPROCESSINGTableAdapter.Connection.ConnectionString = MyConnectionString
'Me.TBWHDD_INDEX_MANTableAdapter.Connection.ConnectionString = MyConnectionString
'Me.VWGI_USER_GROUPS_RELATIONTableAdapter.Connection.ConnectionString = MyConnectionString
'Me.TBGI_REGEX_DOCTYPETableAdapter.Connection.ConnectionString = MyConnectionString
Catch ex As Exception
MsgBox("Error in load Connection-Strings - Check Database Connection - Form will be closed: " & vbNewLine & ex.Message, MsgBoxStyle.Exclamation)
Me.Close()
End Try
Dim oDragDropManager As New ClassDragDrop()
'oDragDropManager.AddGridView(viewAssignedGroups)
'oDragDropManager.AddGridView(viewAvailableGroups)
'oDragDropManager.AddGridView(viewAssignedUsers)
'oDragDropManager.AddGridView(viewAvailableUsers)
ComboBoxEdit1.Properties.Items.AddRange({
New FileConflictOption With {.Name = "Datei Überschreiben", .Value = "Default"},
New FileConflictOption With {.Name = "Neue Version erstellen", .Value = "New version"},
New FileConflictOption With {.Name = "Nachfragen", .Value = "Question"}
})
Try
Load_Dokart()
Logger.Debug("...Done Load_Dokart")
'Me.TBDD_EINGANGSARTENTableAdapter.Fill(Me.MyDataset.TBDD_EINGANGSARTEN)
Logger.Debug("...Done TBDD_EINGANGSARTEN")
' Me.TBDD_MODULESTableAdapter.Fill(Me.MyDataset.TBDD_MODULES)
Logger.Debug("...Done TBDD_MODULES")
Catch ex As Exception
Logger.Error(ex)
MsgBox("Error in frmAdministration_Load: " & vbNewLine & ex.Message, MsgBoxStyle.Exclamation)
End Try
'If GI_withWindream = True Then
' If ClassWindream.Init() = True Then
' End If
'End If
End Sub
Sub Load_Dokart()
Try
If PrimaryKey > 0 Then
Me.TBDD_DOKUMENTARTTableAdapter.Fill(Me.GlobixDataset.TBDD_DOKUMENTART, PrimaryKey)
GridControl1.Visible = False
Else
Me.TBDD_DOKUMENTARTTableAdapter.FillAllDoctypes(Me.GlobixDataset.TBDD_DOKUMENTART)
GridControl1.Visible = True
End If
If GlobixDataset.TBDD_DOKUMENTART.Rows.Count > 0 Then
GridViewProfiles.SelectRow(1)
'EnableControls(XtraTabPageProfiles)
End If
'If Me.DOKART_GUIDTextBox.Text <> "" Then
'Load_TabData()
' End If
IDB_FILESTORE_IDComboBox.DataSource = My.Tables.DTIDB_FILESTORE
IDB_FILESTORE_IDComboBox.DisplayMember = My.Tables.DTIDB_FILESTORE.Columns("TITLE").ColumnName
IDB_FILESTORE_IDComboBox.ValueMember = My.Tables.DTIDB_FILESTORE.Columns("GUID").ColumnName
Catch ex As Exception
MsgBox("Error in Load_Dokart: " & vbNewLine & ex.Message, MsgBoxStyle.Exclamation)
End Try
End Sub
Public Function SaveData() As Boolean
Throw New NotImplementedException()
End Function
Private Sub Load_INDEXMAN(ProfileId As Integer)
Try
Me.TBDD_INDEX_MANTableAdapter.Fill(Me.GlobixDataset.TBDD_INDEX_MAN, CType(ProfileGUID.Text, Integer))
If GlobixDataset.TBDD_INDEX_MAN.Rows.Count > 0 Then
EnableControls(XtraTabPageManIndexe)
End If
ClearStatus()
Catch ex As System.Exception
MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Error in Load IndexeManuell: ")
End Try
End Sub
Private Sub ClearStatus()
bsiState.Caption = String.Empty
End Sub
Private Sub XtraTabControl2_SelectedPageChanged(sender As Object, e As DevExpress.XtraTab.TabPageChangedEventArgs) Handles XtraTabControl2.SelectedPageChanged
Load_TabData()
End Sub
Sub Load_TabData()
If frmloaded = False Then
Exit Sub
End If
RibbonPageGroupProfileRegex.Enabled = False
RibbonPageGroupManualIndex.Enabled = False
RibbonPageGroupManualIndexFunctions.Enabled = False
RibbonPageGroupAutoIndex.Enabled = False
Select Case XtraTabControl2.SelectedTabPage.Name
Case XtraTabPageManIndexe.Name
RibbonPageGroupManualIndex.Enabled = True
If ProfileGUID.Text <> "" Then
' Load_INDEXMAN(Me.DokartGUIDTextBox.Text)
End If
Case XtraTabPageRework.Name
RibbonPageGroupManualIndexFunctions.Enabled = True
'Load_PostProcessing(Me.DOKART_GUIDTextBox.Text)
Case XtraTabPageAutoIndexe.Name
Load_INDEXE_AUTO(CType(ProfileGUID.Text, Integer))
RibbonPageGroupAutoIndex.Enabled = True
'Case XtraTabPageFolderPath.Name
' Try
' Dim Dt As DataTable = ClassDatabase.Return_Datatable("select NAME from VWDDINDICES_MAN_AUTO_ACTIVE where DOCTYPE_ID = " & DokartGUIDTextBox.Text & " order by NAME")
' cmbCrFolderIndex.DataSource = Dt
' cmbCrFolderIndex.DisplayMember = Dt.Columns(0).ColumnName
' Catch ex As Exception
' MsgBox("Error in Load Data TabData 4: " & vbNewLine & ex.Message, MsgBoxStyle.Exclamation)
' End Try
'Case XtraTabPageProfileRegex.Name
' TBGI_REGEX_DOCTYPETableAdapter.Fill(MyDataset.TBGI_REGEX_DOCTYPE, DOKART_GUIDTextBox.Text)
' RibbonPageGroupProfileRegex.Enabled = True
End Select
End Sub
Private Sub Load_INDEXE_AUTO(ProfileId As Integer)
Try
Me.TBDD_INDEX_AUTOMTableAdapter.Fill(Me.GlobixDataset.TBDD_INDEX_AUTOM, CType(ProfileGUID.Text, Integer))
If GlobixDataset.TBDD_INDEX_AUTOM.Rows.Count > 0 Then
EnableControls(XtraTabPageAutoIndexe)
End If
Catch ex As System.Exception
MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Error in Load Indexe Auto: ")
End Try
End Sub
Sub EnableControls(Control As Control, Optional Value As Boolean = True)
For Each oSubControl As Control In Control.Controls
If oSubControl.Enabled <> Value Then
oSubControl.Enabled = Value
End If
Next
End Sub
Private Sub Root_Click(sender As Object, e As EventArgs) Handles ControlGroupIndexeMan.MouseDown, ControlGroupIndexeMan.Click, ControlGroupIndexeAuto.Click
CURRCOntrolGroup = sender
Select Case CURRCOntrolGroup.Name
Case ControlGroupProfile.Name
RibbonPage1.Text = "Profile"
Case ControlGroupIndexeMan.Name
RibbonPage1.Text = "Manual Values"
Case ControlGroupIndexeAuto.Name
RibbonPage1.Text = "Auto Values"
End Select
End Sub
Public Function DeleteData() As Boolean Implements IAdminForm.DeleteData
Throw New NotImplementedException()
End Function
Private Sub BtnDateinamenKonvention_Click(sender As Object, e As EventArgs)
End Sub
Private Sub BarButtonItem6_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem6.ItemClick
End Sub
Private Sub BbtnitmRecordSave_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BbtnitmRecordSave.ItemClick
Select Case CURRCOntrolGroup.Name
Case ControlGroupProfile.Name
Case ControlGroupIndexeMan.Name
Case ControlGroupIndexeAuto.Name
End Select
End Sub
Private Sub ControlGroupProfile_MouseDown(sender As Object, e As MouseEventArgs) Handles ControlGroupProfile.MouseDown, ControlGroupIndexeMan.MouseDown, ControlGroupIndexeAuto.MouseDown
CURRCOntrolGroup = sender
Select Case CURRCOntrolGroup.Name
Case ControlGroupProfile.Name
RibbonPage1.Text = "Profile"
Case ControlGroupIndexeMan.Name
RibbonPage1.Text = "Manual Values"
Case ControlGroupIndexeAuto.Name
RibbonPage1.Text = "Auto Values"
End Select
End Sub
Private Sub XtraTabControl1_MouseEnter(sender As Object, e As EventArgs) Handles XtraTabControl1.MouseEnter
End Sub
Private Sub XtraTabPageRework_MouseEnter(sender As Object, e As EventArgs) Handles XtraTabPageRework.MouseEnter
RibbonPage1.Text = "Manual Values"
End Sub
Private Sub XtraTabPageManIndexe_MouseEnter(sender As Object, e As EventArgs) Handles XtraTabPageManIndexe.MouseEnter
RibbonPage1.Text = "Rework"
End Sub
Private Sub XtraTabPageAutoIndexe_MouseEnter(sender As Object, e As EventArgs) Handles XtraTabPageAutoIndexe.MouseEnter
RibbonPage1.Text = "Auto Values"
End Sub
End Class