add lookupgrid2, try to fuck around with that dataset of DOOM

This commit is contained in:
Jonathan Jenne
2019-04-24 16:21:21 +02:00
parent 2fcec8d2b6
commit 041916262f
9 changed files with 213 additions and 167 deletions

View File

@@ -493,7 +493,7 @@ LOGGER.Error(ex)
control.Text = value
oValue = value
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Error(ex)
clsLogger.Add("Error in LoadSimpleData for TextBox: " & ex.Message)
End Try
ElseIf TypeOf control Is ComboBox Then
@@ -507,30 +507,30 @@ LOGGER.Error(ex)
comboxBox.DataSource = list
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Error(ex)
clsLogger.Add("Error in LoadSimpleData for Combobox: " & ex.Message)
End Try
ElseIf TypeOf control Is LookupControl Then
ElseIf TypeOf control Is LookupControl2 Then
Try
Dim lookup As LookupControl = control
Dim lookup As LookupControl2 = control
lookup.DataSource = dt
Catch ex As Exception
LOGGER.Error(ex)
clsLogger.Add("Error in LoadSimpleData for Lookupcontrol: " & ex.Message)
LOGGER.Error(ex)
clsLogger.Add("Error in LoadSimpleData for LookupControl2: " & ex.Message)
End Try
ElseIf TypeOf control Is DataGridView Then
Try
Dim dataGridView As DataGridView = control
dataGridView.DataSource = dt
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Error(ex)
clsLogger.Add("Error in LoadSimpleData for DataGridView: " & ex.Message)
End Try
End If
Next
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Error(ex)
MsgBox("Error in LoadSimpleData: " & ex.Message, MsgBoxStyle.Critical)
clsLogger.Add("Error in LoadSimpleData: " & ex.Message)
End Try
@@ -650,7 +650,7 @@ LOGGER.Error(ex)
sqlCnn.Close()
End If
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Error(ex)
LOGGER.Info(" - Unvorhergesehener Fehler bei GetValues SQL - Fehler: " & vbNewLine & ex.Message)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei GetValues SQL:")
End Try
@@ -713,7 +713,7 @@ LOGGER.Error(ex)
Case "LOOKUP"
LOGGER.Debug(" >> Versuch LOOKUP zu laden", False)
Dim lookup As LookupControl = ClassControlCreator.CreateExistingLookupControl(oControlRow, False)
Dim lookup As LookupControl2 = ClassControlCreator.CreateExistingLookupControl(oControlRow, False)
lookup.PreventDuplicates = oControlRow.Item("VKT_PREVENT_MULTIPLE_VALUES")
lookup.AllowAddNewValues = oControlRow.Item("VKT_ADD_ITEM")
@@ -761,7 +761,7 @@ LOGGER.Error(ex)
LOGGER.Info("", False)
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Error(ex)
If LOG_ERRORS_ONLY = False Then MsgBox("Error Load_Controls: " & ex.Message, MsgBoxStyle.Critical, "Attention error:")
allgFunk.Insert_LogEntry(CURRENT_ProfilGUID, "Error Load_Controls: " & ex.Message, Environment.UserName)
LOGGER.Info("Unvorhergesehener Fehler bei Load_Controls:" & ex.Message)
@@ -915,7 +915,7 @@ LOGGER.Error(ex)
End If
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Error(ex)
LOGGER.Info("Unexpected Error in Display SQL result for control: " & ROW.Item(0).ToString & " - ERROR: " & ex.Message)
End Try
@@ -924,7 +924,7 @@ LOGGER.Error(ex)
End If
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Error(ex)
LOGGER.Info("Unexpected Error in Eventhandler Variable SQL Result - ERROR: " & ex.Message)
End Try
@@ -993,13 +993,13 @@ LOGGER.Error(ex)
End If
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Error(ex)
LOGGER.Info("Unexpected Error in Display SQL result (Combobox) for control: (" & _Step.ToString & ")" & ROW.Item(0).ToString & " - ERROR: " & ex.Message)
End Try
Next
End If
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Error(ex)
LOGGER.Info("Unexpected Error in Eventhandler Variable SQL Result ComboBox - ERROR: " & ex.Message)
End Try
@@ -1045,7 +1045,7 @@ LOGGER.Error(ex)
End If
End If
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Error(ex)
LOGGER.Info("Unexpected Error in Depending_Control_Set_Result - ERROR: " & ex.Message)
MsgBox("Unexpected error: " & ex.Message, MsgBoxStyle.Critical)
End Try
@@ -1086,7 +1086,7 @@ LOGGER.Error(ex)
End If
Next
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Error(ex)
LOGGER.Info("Unvorhergesehener Fehler bei CheckValueExists:" & ex.Message)
Return False
End Try
@@ -1101,7 +1101,7 @@ LOGGER.Error(ex)
Proc.StartInfo = psi
Proc.Start()
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Error(ex)
MsgBox("Fehler in ShowFile_UniversalViewer:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
@@ -1134,7 +1134,7 @@ LOGGER.Error(ex)
Thread.Sleep(500)
Loop
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler in Open_PDFXCHANGE:")
LOGGER.Info("Fehler in Open_PDFXCHANGE")
LOGGER.Info(ex.Message)
@@ -1150,7 +1150,7 @@ LOGGER.Error(ex)
Proc.StartInfo = psi
Proc.Start()
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler in Open_Sumatra:")
LOGGER.Info("Fehler in Open_Sumatra")
LOGGER.Info(ex.Message)
@@ -1246,7 +1246,7 @@ LOGGER.Error(ex)
Return newGUID
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Error(ex)
errmessage = "Unvorhergesehener Fehler in Get_Next_GUID: " & ex.Message
LOGGER.Info(">> Unvorhergesehener Fehler in Get_Next_GUID:: " & ex.Message, True)
Return 0
@@ -1367,7 +1367,7 @@ LOGGER.Error(ex)
Try
aktivesDokument = WINDREAM.oSession.GetWMObjectByPath(WMEntity.WMEntityDocument, WINDREAM.NormalizePath(Windream_Document_Path))
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Error(ex)
allgFunk.Insert_LogEntry(CURRENT_ProfilGUID, "Fehler bei Erzeugen windream-Objekt - DocGUID: " & CURRENT_DOC_GUID & " - ERROR: " & ex.Message, Environment.UserName)
LOGGER.Info("Fehler bei Erzeugen windream-Objekt in (LoadNextDokument): " & ex.Message)
LOGGER.Info("Error Number: " & Err.Number.ToString)
@@ -1464,7 +1464,7 @@ LOGGER.Error(ex)
End If
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Error(ex)
allgFunk.Insert_LogEntry(CURRENT_ProfilGUID, "Unvorhergesehener Fehler bei Load_Next_Document - DocGUID: " & CURRENT_DOC_GUID & " - ERROR: " & ex.Message, Environment.UserName)
errormessage = "Unvorhergesehener Fehler bei Load_Next_Document:" & ex.Message
My.Settings.Save()
@@ -1583,7 +1583,7 @@ LOGGER.Error(ex)
Me.grpbxMailBody.Visible = True
Me.grpBetreff.Visible = True
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Error(ex)
errormessage = "Unvorhergesehener Fehler bei Show_Email:" & ex.Message
LOGGER.Info("Unvorhergesehener Fehler in Show_Email: " & ex.Message)
My.Settings.Save()
@@ -1609,7 +1609,7 @@ LOGGER.Error(ex)
Try
CURRENT_DOC_CREATION_DATE = aktivesDokument.GetVariableValue(INDEX_DMS_ERSTELLT)
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Error(ex)
If ex.Message.Contains("Variable: " & INDEX_DMS_ERSTELLT & " not found!") Then
LOGGER.Info("1. Ausnahme in Windream_get_Doc_info: Variable: " & INDEX_DMS_ERSTELLT & " not found", True)
LOGGER.Info("1. Ausnahme-Fehler: " & ex.Message, False)
@@ -1644,7 +1644,7 @@ LOGGER.Error(ex)
Try
CURRENT_DOC_CREATION_TIME = aktivesDokument.GetVariableValue(INDEX_DMS_ERSTELLT_ZEIT)
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Error(ex)
If ex.Message.Contains("Variable: " & INDEX_DMS_ERSTELLT_ZEIT & " not found!") Then
LOGGER.Info("1. Ausnahme in Windream_get_Doc_info: Variable: " & INDEX_DMS_ERSTELLT_ZEIT & " not found", True)
If INDEX_DMS_ERSTELLT = "DMS Created" Then
@@ -1686,7 +1686,7 @@ LOGGER.Error(ex)
Return ""
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Error(ex)
LOGGER.Info("Fehler in Windream_get_Doc_info (GENERELL): " & ex.Message)
Return "Fehler in Windream_get_Doc_info (GENERELL): " & ex.Message
End Try
@@ -1864,7 +1864,7 @@ LOGGER.Error(ex)
If value Is Nothing Then value = ""
Return value
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Error(ex)
MsgBox("Fehler in ReturnVektor_IndexValue: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
LOGGER.Info("Fehler in ReturnVektor_IndexValue: " & ex.Message)
Return ""
@@ -1942,7 +1942,7 @@ LOGGER.Error(ex)
End If
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Error(ex)
errormessage = "Unvorhergesehener Fehler bei FillIndexValues TextBox:" & vbNewLine & ex.Message & vbNewLine & "Check Logfile"
My.Settings.Save()
frmError.ShowDialog()
@@ -2007,7 +2007,7 @@ LOGGER.Error(ex)
End If
End If
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Error(ex)
LOGGER.Info(">> Unvorhergesehener Fehler bei FillIndexValues(Combobox: " & cmb.Name & "): " & ex.Message, True)
LOGGER.Info(">> Controltype: " & oControlType, False)
LOGGER.Info(">> Indexname windream: " & oIndexName, False)
@@ -2260,7 +2260,7 @@ LOGGER.Error(ex)
chk.Checked = False
End Select
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Error(ex)
LOGGER.Info(">> Unvorhergesehener Fehler bei CBool(wertWD) - CheckBox: " & ex.Message & vbNewLine & "Wert WD: " & wertWD.ToString, True)
chk.Checked = False
End Try
@@ -2268,9 +2268,9 @@ LOGGER.Error(ex)
End If
End If
Case "DigitalData.Controls.LookupGrid.LookupControl"
Case "DigitalData.Controls.LookupGrid.LookupControl2"
Try
Dim oLookup As LookupControl = oControl
Dim oLookup As LookupControl2 = oControl
Dim oWindreamValue = aktivesDokument.GetVariableValue(oWMIndexName)
If IsNothing(oWindreamValue) Then
@@ -2287,9 +2287,9 @@ LOGGER.Error(ex)
End If
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Error(ex)
LOGGER.Info(" - Unvorhergesehener Unexpected error in AddVorschlag_ComboBox - Indexname: " & oIndexName & " - Fehler: " & vbNewLine & ex.Message)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Unvorhergesehener Unexpected error in Add LookupControl:")
MsgBox(ex.Message, MsgBoxStyle.Critical, "Unvorhergesehener Unexpected error in Add LookupControl2:")
End Try
Case "System.Windows.Forms.DateTimePicker"
@@ -2317,7 +2317,7 @@ LOGGER.Error(ex)
tempdate = CDate(wertWD)
LOGGER.Debug(" >> DATE konnte umgewandelt werden", False)
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Error(ex)
ValueDTP = tempdate
LOGGER.Debug(" >> DATE wurde auf heute gesetzt", False)
End Try
@@ -2331,7 +2331,7 @@ LOGGER.Error(ex)
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Error(ex)
errormessage = "Unvorhergesehener Fehler bei DTP: " & vbNewLine & ex.Message
LOGGER.Info(">> Unvorhergesehener Fehler bei FillIndex DTP: " & ex.Message & vbNewLine & "Wert WD: " & wertWD.ToString & vbNewLine & "Indexname: " & oWMIndexName, True)
@@ -2358,7 +2358,7 @@ LOGGER.Error(ex)
End If
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Error(ex)
errormessage = "Unvorhergesehener Fehler bei FillIndexValues:" & vbNewLine & ex.Message & vbNewLine & "Check Logfile"
My.Settings.Save()
frmError.ShowDialog()
@@ -2395,7 +2395,7 @@ LOGGER.Error(ex)
End If
End If
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Error(ex)
LOGGER.Info(" ### FEHLER in CloseDocView")
LOGGER.Info("### " & ex.Message & " ###")
End Try
@@ -2458,7 +2458,7 @@ LOGGER.Error(ex)
'If dr.Item("INDEXNAME").ToString.StartsWith("[%VKT") Then
' Dim PM_String = Return_PM_VEKTOR(value, dr.Item("INDEXNAME"))
'Hier muss nun separat als Vektorfeld indexiert werden
If Indexiere_VektorfeldPM(value, dr.Item("INDEXNAME")) = False Then
If Indexiere_VektorfeldPM(value, dr.Item("INDEXNAME"), dr.Item("PREVENT_DUPLICATES"), dr.Item("ALLOW_NEW_VALUES")) = False Then
LOGGER.Debug(" >> FINALER INDEX '" & dr.Item("INDEXNAME").ToString & "' WURDE ERFOLGREICH GESETZT", False)
Else
errormessage = "Fehler beim finalen Indexieren:" & vbNewLine & idxerr_message
@@ -2507,7 +2507,7 @@ LOGGER.Error(ex)
WORK_HISTORY_ENTRY = Nothing
End If
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Error(ex)
WORK_HISTORY_ENTRY = Nothing
End Try
@@ -2539,7 +2539,7 @@ LOGGER.Error(ex)
Try
value_from_control = inctrl.Text
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Error(ex)
value_from_control = String.Empty
End Try
@@ -2548,7 +2548,7 @@ LOGGER.Error(ex)
Try
value_from_control = cmb.Text
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Error(ex)
value_from_control = String.Empty
End Try
Case "System.Windows.Forms.DateTimePicker"
@@ -2556,7 +2556,7 @@ LOGGER.Error(ex)
Try
value_from_control = dtp.Value.ToString
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Error(ex)
value_from_control = String.Empty
End Try
@@ -2565,7 +2565,7 @@ LOGGER.Error(ex)
Try
value_from_control = chk.Checked
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Error(ex)
value_from_control = String.Empty
End Try
End Select
@@ -2576,7 +2576,7 @@ LOGGER.Error(ex)
WORK_HISTORY_ENTRY = WORK_HISTORY_ENTRY.ToString.Replace(element.Value, value_from_control)
End If
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Error(ex)
LOGGER.Info("Unexpected Error in Checking control values for WORK_HISTORY_ENTRY - ERROR: " & ex.Message)
End Try
Next
@@ -2655,7 +2655,7 @@ LOGGER.Error(ex)
End If
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Error(ex)
errormessage = "Unvorhergesehener Fehler bei Abschluss:" & ex.Message
My.Settings.Save()
frmError.ShowDialog()
@@ -2684,7 +2684,7 @@ LOGGER.Error(ex)
Dim Bezeichner As String = VKTBezeichner.Replace("[%VKT", "")
PM_String = "DD-PM" & Delimiter & Bezeichner & Delimiter & input & Delimiter & Environment.UserName & Delimiter & Now.ToString
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Error(ex)
LOGGER.Info(">> Fehler in Return_PM_VEKTOR: " & ex.Message, True)
PM_String = "DD-PM ERROR: " & ex.Message
End Try
@@ -2701,54 +2701,49 @@ LOGGER.Error(ex)
End If
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Error(ex)
LOGGER.Info(">> Fehler in Return_LOGString: " & ex.Message, True)
PM_String = "DD-PM ERROR: " & ex.Message
End Try
Return PM_String
End Function
Private Function Indexiere_VektorfeldPM(input As String, NameVKTIndex As String)
Private Function Indexiere_VektorfeldPM(input As String, NameVKTIndex As String, Optional PreventDuplicates As Boolean = False, Optional AllowAddNewValues As Boolean = True)
Dim oOldValue As Object = aktivesDokument.GetVariableValue(NameVKTIndex)
Dim oValueList As New List(Of Object)
Dim oNewValue As Object()
Dim oMissing As Boolean = False
Dim missing As Boolean = False
Dim Anzahl As Integer = 0
Dim myInputArr As String()
'Jeden Wert des Vektorfeldes durchlaufen
Dim wertWD = aktivesDokument.GetVariableValue(NameVKTIndex)
If wertWD Is Nothing = False Then
'Es wird gegen ein Vektorfeld nachindexiert
If wertWD.GetType.ToString.Contains("System.Object") Then
'es handelt sich um ein Vektorfeld - Zuweisen der Indexwerte des Vektorfeldes zu Array
For Each obj As Object In wertWD
If obj Is Nothing = False Then
'Das Array anpassen
ReDim Preserve myInputArr(Anzahl)
'Den Wert im Array speichern
myInputArr(Anzahl) = obj.ToString
Anzahl += 1
End If
Next
If oOldValue IsNot Nothing AndAlso TypeOf oOldValue Is Object Then
' If new values are allowed, add the old values first
If AllowAddNewValues Then
oValueList = DirectCast(oOldValue, Object()).ToList()
End If
'Das Array anpassen
ReDim Preserve myInputArr(Anzahl)
'und den letzten Wert übergeben
myInputArr(Anzahl) = input
' Add the new value
oValueList.Add(input)
Else
'Das Array anpassen
ReDim Preserve myInputArr(Anzahl)
'und den letzten Wert übergeben
myInputArr(Anzahl) = input
' Just add input as the only value
oValueList.Add(input)
End If
If myInputArr.Length > 0 Then
If PreventDuplicates Then
oValueList = oValueList.
Distinct().
ToList()
End If
oNewValue = oValueList.ToArray()
If oNewValue.Length > 0 Then
'Jetzt die Datei indexieren
If Indexiere_File(aktivesDokument, NameVKTIndex, myInputArr) = False Then
missing = True
If Indexiere_File(aktivesDokument, NameVKTIndex, oNewValue) = False Then
oMissing = True
errmessage = "Fehler beim Indexieren Vektorfeld '" & NameVKTIndex & "' - ERROR: " & idxerr_message
End If
End If
Return missing
Return oMissing
End Function
Function Check_UpdateIndexe()
Try
@@ -2780,9 +2775,9 @@ LOGGER.Error(ex)
End If
Dim Type As String = inctrl.GetType.ToString
Select Case Type
Case "DigitalData.Controls.LookupGrid.LookupControl"
Case "DigitalData.Controls.LookupGrid.LookupControl2"
Try
Dim lookup As LookupControl = inctrl
Dim lookup As LookupControl2 = inctrl
If lookup.SelectedValues.Count = 0 And _MUSSEINGABE = True Then
missing = True