Revert "MS19042016"
This reverts commit fa5397cd240efd22c865bb0c410ff6794e9f3cce.
This commit is contained in:
parent
fa5397cd24
commit
c9fc63e237
@ -76,6 +76,7 @@ Public Class ClassControlBuilder
|
||||
|
||||
Public Sub MouseHover(sender As Object, e As EventArgs)
|
||||
Dim onMouseHoverHandler As EventHandler = CType(Me.Events(_onMouseHoverName), EventHandler)
|
||||
|
||||
If onMouseHoverHandler IsNot Nothing Then
|
||||
onMouseHoverHandler.Invoke(sender, e)
|
||||
End If
|
||||
|
||||
@ -562,163 +562,135 @@ Public Class ClassControlCommandsUI
|
||||
End Sub
|
||||
|
||||
Function GetControlValue(ctrl As Control) As String
|
||||
Dim CONTROL_ID As Integer
|
||||
Try
|
||||
Dim type = ctrl.GetType().Name
|
||||
CONTROL_ID = DirectCast(ctrl.Tag, ClassControlMetadata).Id ' GetControlID_for_RecordID(ctrl.Name, CURRENT_RECORD_ID)
|
||||
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> GetControlValue CONTROL_ID: " & CONTROL_ID, False)
|
||||
Dim CONTROL_VALUE As String = Nothing
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> type = " & type.ToString, False)
|
||||
Select Case type
|
||||
Case "TextBox"
|
||||
Return DirectCast(ctrl, TextBox).Text
|
||||
Case "ComboBox"
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Return Value: " & DirectCast(ctrl, CustomComboBox).Text, False)
|
||||
Return DirectCast(ctrl, CustomComboBox).Text
|
||||
Case "CheckBox"
|
||||
Return DirectCast(ctrl, CheckBox).Checked.ToString()
|
||||
Case "RadioButton"
|
||||
Return DirectCast(ctrl, RadioButton).Checked.ToString()
|
||||
Case "DateEdit"
|
||||
Dim Value = DirectCast(ctrl, DevExpress.XtraEditors.DateEdit).EditValue
|
||||
Dim type = ctrl.GetType().Name
|
||||
Dim CONTROL_ID As Integer = DirectCast(ctrl.Tag, ClassControlMetadata).Id ' GetControlID_for_RecordID(ctrl.Name, CURRENT_RECORD_ID)
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> GetControlValue CONTROL_ID: " & CONTROL_ID, False)
|
||||
Dim CONTROL_VALUE As String = Nothing
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> type = " & type.ToString, False)
|
||||
Select Case type
|
||||
Case "TextBox"
|
||||
Return DirectCast(ctrl, TextBox).Text
|
||||
Case "ComboBox"
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Return Value: " & DirectCast(ctrl, CustomComboBox).Text, False)
|
||||
Return DirectCast(ctrl, CustomComboBox).Text
|
||||
Case "CheckBox"
|
||||
Return DirectCast(ctrl, CheckBox).Checked.ToString()
|
||||
Case "RadioButton"
|
||||
Return DirectCast(ctrl, RadioButton).Checked.ToString()
|
||||
Case "DateEdit"
|
||||
Dim Value = DirectCast(ctrl, DevExpress.XtraEditors.DateEdit).EditValue
|
||||
|
||||
If IsDBNull(Value) Then
|
||||
Return ""
|
||||
Else
|
||||
Return DirectCast(ctrl, DevExpress.XtraEditors.DateEdit).DateTime.ToString("yyyy-MM-dd")
|
||||
End If
|
||||
Case "PictureBox"
|
||||
'Return "PictureBox" 'Es ist egal was für ein String hier zurückgegeben wird, hauptsache nicht Nothing
|
||||
Case "CheckedListBoxControl"
|
||||
Dim chklbx As DevExpress.XtraEditors.CheckedListBoxControl
|
||||
chklbx = DirectCast(ctrl, DevExpress.XtraEditors.CheckedListBoxControl)
|
||||
If IsDBNull(Value) Then
|
||||
Return ""
|
||||
Else
|
||||
Return DirectCast(ctrl, DevExpress.XtraEditors.DateEdit).DateTime.ToString("yyyy-MM-dd")
|
||||
End If
|
||||
Case "PictureBox"
|
||||
'Return "PictureBox" 'Es ist egal was für ein String hier zurückgegeben wird, hauptsache nicht Nothing
|
||||
Case "CheckedListBoxControl"
|
||||
Dim chklbx As DevExpress.XtraEditors.CheckedListBoxControl
|
||||
chklbx = DirectCast(ctrl, DevExpress.XtraEditors.CheckedListBoxControl)
|
||||
|
||||
'TODO: Wenn keine Datasource vorhanden, angecheckte einträge als string speichern
|
||||
If IsNothing(chklbx.DataSource) Then
|
||||
Dim result As New List(Of String)
|
||||
Dim result_string As String
|
||||
'TODO: Wenn keine Datasource vorhanden, angecheckte einträge als string speichern
|
||||
If IsNothing(chklbx.DataSource) Then
|
||||
Dim result As New List(Of String)
|
||||
Dim result_string As String
|
||||
|
||||
For Each item As DevExpress.XtraEditors.Controls.CheckedListBoxItem In chklbx.CheckedItems
|
||||
result.Add(item.Value.ToString.Trim)
|
||||
Next
|
||||
|
||||
result_string = String.Join(";", result)
|
||||
|
||||
' Hier wird ein String zurückgegeben, der als VALUE gespeichert werden soll
|
||||
' Überspringt den Rest der funktion
|
||||
Return result_string
|
||||
End If
|
||||
|
||||
Dim SQL_Datasource = "SELECT SQL_COMMAND_1 FROM TBPMO_CONTROL WHERE GUID = " & CONTROL_ID
|
||||
SQL_Datasource = ClassDatabase.Execute_Scalar(SQL_Datasource)
|
||||
|
||||
If SQL_Datasource.ToUpper.Contains("SELECT [RECORD-ID],") Then
|
||||
'Alle Recorddatensätze durchlaufen und überprüfen ob nicht angehakt
|
||||
'Wenn nicht angehakt dann Record löschen
|
||||
Dim index As Integer = 0
|
||||
For i As Integer = 0 To chklbx.ItemCount - 1
|
||||
Dim item = chklbx.GetItem(i)
|
||||
Dim row As DataRowView = CType(item, DataRowView)
|
||||
If chklbx.GetItemCheckState(i) = 0 Then
|
||||
If CInt(row(0)) > 0 Then
|
||||
'Überprüfen ob es den Record gibt
|
||||
Dim SQL = "SELECT COUNT(*) FROM TBPMO_RECORD_CONNECT WHERE RECORD1_ID = " & CURRENT_RECORD_ID & " AND RECORD2_ID = " & CInt(row(0))
|
||||
If ClassDatabase.Execute_Scalar(SQL) = 1 Then
|
||||
SQL = "DELETE FROM TBPMO_RECORD_CONNECT WHERE RECORD1_ID = " & CURRENT_RECORD_ID & " AND RECORD2_ID = " & CInt(row(0))
|
||||
If ClassDatabase.Execute_non_Query(SQL) = True Then
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> TBPMO_RECORD_CONNECT-Entry after 'deselect CheckedListBox' deleted", False)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
|
||||
'Für jeden gecheckten Eintrag den Record der Stammentität mit dem selektierten linken
|
||||
Dim checked_result As New List(Of String)
|
||||
Dim checked_result_string As String
|
||||
Dim checked_Count As Integer = 0
|
||||
For Each item As Object In DirectCast(ctrl, DevExpress.XtraEditors.CheckedListBoxControl).CheckedItems
|
||||
checked_Count += 1
|
||||
For Each item As DevExpress.XtraEditors.Controls.CheckedListBoxItem In chklbx.CheckedItems
|
||||
result.Add(item.Value.ToString.Trim)
|
||||
Next
|
||||
|
||||
If SQL_Datasource.ToUpper.Contains("SELECT [RECORD-ID],") Then
|
||||
For Each item As Object In DirectCast(ctrl, DevExpress.XtraEditors.CheckedListBoxControl).CheckedItems
|
||||
Dim row As DataRowView = CType(item, DataRowView)
|
||||
Try
|
||||
If CInt(row(0)) > 0 Then
|
||||
Dim rid = CInt(row(0))
|
||||
Dim checked_value = row(1)
|
||||
checked_result.Add(checked_value)
|
||||
checked_result_string = String.Join(";", checked_result)
|
||||
Dim SQL = "SELECT COUNT(*) FROM TBPMO_RECORD_CONNECT WHERE RECORD1_ID = " & CURRENT_RECORD_ID & " AND RECORD2_ID = " & CInt(row(0))
|
||||
If ClassDatabase.Execute_Scalar(SQL) = 0 Then
|
||||
If CURRENT_RECORD_ID = 0 Then
|
||||
MsgBox("Attention: no current record Selected!", MsgBoxStyle.Exclamation)
|
||||
Else
|
||||
If ConnectRecord(CURRENT_RECORD_ID, CInt(row(0)), "CheckedListBox;" & ctrl.Name) = True Then
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Checked ListBox record '" & rid.ToString & "' was linked successfully.", False)
|
||||
End If
|
||||
End If
|
||||
result_string = String.Join(";", result)
|
||||
|
||||
End If
|
||||
' Hier wird ein String zurückgegeben, der als VALUE gespeichert werden soll
|
||||
' Überspringt den Rest der funktion
|
||||
Return result_string
|
||||
End If
|
||||
|
||||
'Alle Recorddatensätze durchlaufen und überprüfen ob nicht angehakt
|
||||
'Wenn nicht angehakt dann Record löschen
|
||||
Dim index As Integer = 0
|
||||
For i As Integer = 0 To chklbx.ItemCount - 1
|
||||
Dim item = chklbx.GetItem(i)
|
||||
Dim row As DataRowView = CType(item, DataRowView)
|
||||
If chklbx.GetItemCheckState(i) = 0 Then
|
||||
If CInt(row(0)) > 0 Then
|
||||
'Überprüfen ob es den Record gibt
|
||||
Dim SQL = "SELECT COUNT(*) FROM TBPMO_RECORD_CONNECT WHERE RECORD1_ID = " & CURRENT_RECORD_ID & " AND RECORD2_ID = " & CInt(row(0))
|
||||
If ClassDatabase.Execute_Scalar(SQL) = 1 Then
|
||||
SQL = "DELETE FROM TBPMO_RECORD_CONNECT WHERE RECORD1_ID = " & CURRENT_RECORD_ID & " AND RECORD2_ID = " & CInt(row(0))
|
||||
If ClassDatabase.Execute_non_Query(SQL) = True Then
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> TBPMO_RECORD_CONNECT-Entry after 'deselect CheckedListBox' deleted", False)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Error in CheckedListBoxGetControlValue: " & ex.Message, True)
|
||||
End Try
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
Next
|
||||
Else
|
||||
For Each item As Object In DirectCast(ctrl, DevExpress.XtraEditors.CheckedListBoxControl).CheckedItems
|
||||
Dim row As DataRowView = CType(item, DataRowView)
|
||||
'Für jeden gecheckten Eintrag den Record der Stammentität mit dem selektierten linken
|
||||
Dim checked_result As New List(Of String)
|
||||
Dim checked_result_string As String
|
||||
|
||||
For Each item As Object In DirectCast(ctrl, DevExpress.XtraEditors.CheckedListBoxControl).CheckedItems
|
||||
Dim row As DataRowView = CType(item, DataRowView)
|
||||
Try
|
||||
If CInt(row(0)) > 0 Then
|
||||
Dim rid = CInt(row(0))
|
||||
Dim checked_value = row(1)
|
||||
checked_result.Add(checked_value)
|
||||
checked_result_string = String.Join(";", checked_result)
|
||||
Next
|
||||
End If
|
||||
Dim SQL = "SELECT COUNT(*) FROM TBPMO_RECORD_CONNECT WHERE RECORD1_ID = " & CURRENT_RECORD_ID & " AND RECORD2_ID = " & CInt(row(0))
|
||||
If ClassDatabase.Execute_Scalar(SQL) = 0 Then
|
||||
If CURRENT_RECORD_ID = 0 Then
|
||||
MsgBox("Attention: no current record Selected!", MsgBoxStyle.Exclamation)
|
||||
Else
|
||||
If ConnectRecord(CURRENT_RECORD_ID, CInt(row(0)), "CheckedListBox;" & ctrl.Name) = True Then
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Checked ListBox record '" & rid.ToString & "' was linked successfully.", False)
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
' Hier wird ein String zurückgegeben, der als VALUE gespeichert werden soll
|
||||
' Überspringt den Rest der funktion
|
||||
If Not IsNothing(checked_result_string) Then
|
||||
Dim sql = String.Format("select count(*) from TBPMO_CONTROL_VALUE where CONTROL_ID = {0} and RECORD_ID = {1}", CONTROL_ID, CURRENT_RECORD_ID)
|
||||
If ClassDatabase.Execute_Scalar(sql) = 0 And checked_Count > 0 Then
|
||||
InsertControlValue(CONTROL_ID, CURRENT_RECORD_ID, "")
|
||||
End If
|
||||
End If
|
||||
Return checked_result_string
|
||||
Else
|
||||
'In jedem Fall Nothing zurückgeben
|
||||
Return Nothing
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Error in CheckedListBoxGetControlValue: " & ex.Message, True)
|
||||
End Try
|
||||
|
||||
Next
|
||||
' Hier wird ein String zurückgegeben, der als VALUE gespeichert werden soll
|
||||
' Überspringt den Rest der funktion
|
||||
If Not IsNothing(checked_result_string) Then
|
||||
Dim sql = String.Format("select count(*) from TBPMO_CONTROL_VALUE where CONTROL_ID = {0} and RECORD_ID = {1}", CONTROL_ID, CURRENT_RECORD_ID)
|
||||
If ClassDatabase.Execute_Scalar(sql) = 0 Then
|
||||
InsertControlValue(CONTROL_ID, CURRENT_RECORD_ID, "")
|
||||
End If
|
||||
|
||||
|
||||
Case "ListBoxControl"
|
||||
Dim listbox As DevExpress.XtraEditors.ListBoxControl = DirectCast(ctrl, DevExpress.XtraEditors.ListBoxControl)
|
||||
Return listbox.SelectedValue
|
||||
|
||||
Case "DataGridView"
|
||||
Dim list As New List(Of String)
|
||||
Dim dgv As DataGridView = DirectCast(ctrl, DataGridView)
|
||||
|
||||
For Each row As DataGridViewRow In dgv.Rows
|
||||
Dim cell As DataGridViewCell = row.Cells(0)
|
||||
If Not IsNothing(cell.Value) Then
|
||||
list.Add(cell.Value)
|
||||
End If
|
||||
Next
|
||||
|
||||
Return String.Join(";", list)
|
||||
|
||||
Case Else
|
||||
Return checked_result_string
|
||||
Else
|
||||
'In jedem Fall Nothing zurückgeben
|
||||
Return Nothing
|
||||
End Select
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Unexpected error in GetControlValue for Control-ID: " & CONTROL_ID & " - error: " & ex.Message)
|
||||
Return Nothing
|
||||
End Try
|
||||
End If
|
||||
|
||||
|
||||
Case "ListBoxControl"
|
||||
Dim listbox As DevExpress.XtraEditors.ListBoxControl = DirectCast(ctrl, DevExpress.XtraEditors.ListBoxControl)
|
||||
Return listbox.SelectedValue
|
||||
|
||||
Case "DataGridView"
|
||||
Dim list As New List(Of String)
|
||||
Dim dgv As DataGridView = DirectCast(ctrl, DataGridView)
|
||||
|
||||
For Each row As DataGridViewRow In dgv.Rows
|
||||
Dim cell As DataGridViewCell = row.Cells(0)
|
||||
If Not IsNothing(cell.Value) Then
|
||||
list.Add(cell.Value)
|
||||
End If
|
||||
Next
|
||||
|
||||
Return String.Join(";", list)
|
||||
|
||||
Case Else
|
||||
Return Nothing
|
||||
End Select
|
||||
End Function
|
||||
|
||||
Public Shared Function InsertControlValue(ControlID As Integer, RecordID As Integer, Value As String)
|
||||
|
||||
@ -15,13 +15,9 @@
|
||||
'End Function
|
||||
|
||||
Public Shared Function LoadAutoValue(control As Windows.Forms.Control, RecordId As Integer, ParentRecordId As Integer, entity_ID As Integer)
|
||||
Dim ControlId As Integer
|
||||
Try
|
||||
If ControlId = 810 Then
|
||||
Console.WriteLine("Obacht")
|
||||
End If
|
||||
Dim AutoValue As String = String.Empty
|
||||
ControlId = DirectCast(control.Tag, ClassControlMetadata).Id
|
||||
Dim ControlId As Integer = DirectCast(control.Tag, ClassControlMetadata).Id
|
||||
Dim CONNID = ClassDatabase.Execute_Scalar(String.Format("SELECT CONNECTION_ID_1 FROM TBPMO_CONTROL WHERE GUID = {0}", ControlId))
|
||||
Dim SQL As String = ClassDatabase.Execute_Scalar(String.Format("SELECT SQL_COMMAND_1 FROM TBPMO_CONTROL WHERE GUID = {0}", ControlId))
|
||||
SQL = ClassControlValues.ReplaceSqlCommandPlaceholders(SQL, RecordId, ParentRecordId, entity_ID)
|
||||
@ -43,7 +39,7 @@
|
||||
|
||||
Return AutoValue
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Unexpected Error in LoadAutoValue - Control-ID: " & ControlId.ToString & " - ERROR: " & ex.Message, True)
|
||||
ClassLogger.Add("Unexpected Error in LoadAutoValue: " & ex.Message, True)
|
||||
Return Nothing
|
||||
End Try
|
||||
|
||||
@ -56,9 +52,7 @@
|
||||
|
||||
Public Shared Function GetDynamicValue(controlId As Integer, formId As Integer, connID As Object, sqlCommand As String) As DynamicValue
|
||||
Dim returnValue As DynamicValue
|
||||
If controlId = 810 Then
|
||||
Console.WriteLine("Obacht")
|
||||
End If
|
||||
|
||||
returnValue.StaticList = CheckForStaticList(controlId)
|
||||
returnValue.DataTable = GetSqlList(controlId, formId, connID, sqlCommand)
|
||||
|
||||
@ -85,9 +79,6 @@
|
||||
|
||||
Public Shared Function GetSqlList(controlId As Integer, formId As Integer, connection_Id As Object, sqlCommand As String) As DataTable
|
||||
Try
|
||||
If controlId = 810 Then
|
||||
Console.WriteLine("Obacht")
|
||||
End If
|
||||
If sqlCommand Is Nothing Or sqlCommand = String.Empty Then
|
||||
Return Nothing
|
||||
End If
|
||||
@ -117,132 +108,81 @@
|
||||
End Function
|
||||
|
||||
Overloads Shared Sub SetDataSource(control As CustomComboBox, dt As DataTable)
|
||||
Try
|
||||
If control.Name = "cmbverantwortlich" Then
|
||||
Console.WriteLine("Obacht")
|
||||
End If
|
||||
Dim Name1 = dt.Columns(0).ColumnName.ToString
|
||||
Dim Name2
|
||||
Try
|
||||
Name2 = dt.Columns(1).ColumnName.ToString
|
||||
Catch ex As Exception
|
||||
Name2 = dt.Columns(0).ColumnName.ToString
|
||||
End Try
|
||||
Dim columnCount As Integer = dt.Columns.Count
|
||||
control.BeginUpdate()
|
||||
' Damit beim Setzen von DisplayMember und ValueMember kein Fehler auftritt,
|
||||
' muss die Datasource zunächst geleert werden und der selected index auf -1 gesetzt werden.
|
||||
control.DataSource = Nothing
|
||||
control.SelectedIndex = -1
|
||||
ClassControlValues.ClearControlValue(control)
|
||||
Dim sw As Stopwatch = Stopwatch.StartNew()
|
||||
Dim columnCount As Integer = dt.Columns.Count
|
||||
|
||||
' Es ist wichtig, dass DisplayMember und ValueMember VOR der DataSource festgelegt werden,
|
||||
' Dadurch ist das Laden der Datasource um einiges SCHNELLER
|
||||
If columnCount = 1 Then
|
||||
For Each row As DataRow In dt.Rows
|
||||
control.Items.Add(row.Item(0).ToString)
|
||||
Next
|
||||
'control.ValueMember = Name1
|
||||
'control.DisplayMember = Name1
|
||||
ElseIf columnCount = 2 Then
|
||||
'If control.Name = "cmbverantwortlich" Then
|
||||
' control.ValueMember = Name1
|
||||
' control.DisplayMember = Name2
|
||||
'Else
|
||||
For Each row As DataRow In dt.Rows
|
||||
control.Items.Add(row.Item(1).ToString)
|
||||
Next
|
||||
'End If
|
||||
control.BeginUpdate()
|
||||
|
||||
'If control.Name = "cmbverantwortlich" Then
|
||||
' Damit beim Setzen von DisplayMember und ValueMember kein Fehler auftritt,
|
||||
' muss die Datasource zunächst geleert werden und der selected index auf -1 gesetzt werden.
|
||||
control.DataSource = Nothing
|
||||
control.SelectedIndex = -1
|
||||
|
||||
'Else
|
||||
' control.ValueMember = Name1
|
||||
' control.DisplayMember = Name2
|
||||
'End If
|
||||
End If
|
||||
' Als Erstes setzen wir die DataSource
|
||||
'If control.Name = "cmbverantwortlich" Then
|
||||
' control.DataSource = dt
|
||||
'End If
|
||||
' Es ist wichtig, dass DisplayMember und ValueMember VOR der DataSource festgelegt werden,
|
||||
' Dadurch ist das Laden der Datasource um einiges SCHNELLER
|
||||
If columnCount = 1 Then
|
||||
control.DisplayMember = dt.Columns(0).ColumnName
|
||||
control.ValueMember = dt.Columns(0).ColumnName
|
||||
ElseIf columnCount = 2 Then
|
||||
control.DisplayMember = dt.Columns(1).ColumnName
|
||||
control.ValueMember = dt.Columns(0).ColumnName
|
||||
End If
|
||||
|
||||
'control.DataSource = dt
|
||||
control.EndUpdate()
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("unexpected Error in SetDataSource for ControlName: " & control.Name & " - Error: " & ex.Message)
|
||||
End Try
|
||||
' Als letztes setzen wir die DataSource
|
||||
control.DataSource = dt
|
||||
|
||||
control.EndUpdate()
|
||||
|
||||
sw.Stop()
|
||||
Console.WriteLine("SetDataSource for {0} took {1}ms", control.Name, sw.ElapsedMilliseconds)
|
||||
End Sub
|
||||
|
||||
Overloads Shared Sub SetDataSource(control As DevExpress.XtraEditors.CheckedListBoxControl, dt As DataTable)
|
||||
Try
|
||||
If control.Name = "cmbverantwortlich" Then
|
||||
Console.WriteLine("Obacht")
|
||||
End If
|
||||
Dim columnCount As Integer = dt.Columns.Count
|
||||
Dim columnCount As Integer = dt.Columns.Count
|
||||
|
||||
' Damit beim Setzen von DisplayMember und ValueMember kein Fehler auftritt,
|
||||
' muss die Datasource zunächst geleert werden und der selected index auf -1 gesetzt werden.
|
||||
control.DataSource = Nothing
|
||||
control.SelectedIndex = -1
|
||||
|
||||
' Damit beim Setzen von DisplayMember und ValueMember kein Fehler auftritt,
|
||||
' muss die Datasource zunächst geleert werden und der selected index auf -1 gesetzt werden.
|
||||
control.DataSource = Nothing
|
||||
control.SelectedIndex = -1
|
||||
|
||||
' Es ist wichtig, dass DisplayMember und ValueMember VOR der DataSource festgelegt werden,
|
||||
' Dadurch ist das Laden der Datasource um einiges SCHNELLER
|
||||
If columnCount = 1 Then
|
||||
control.DisplayMember = dt.Columns(0).ColumnName
|
||||
control.ValueMember = dt.Columns(0).ColumnName
|
||||
ElseIf columnCount = 2 Then
|
||||
control.DisplayMember = dt.Columns(1).ColumnName
|
||||
control.ValueMember = dt.Columns(0).ColumnName
|
||||
End If
|
||||
' Als letztes setzen wir die DataSource
|
||||
control.DataSource = dt
|
||||
control.EndUpdate()
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("unexpected Error in SetDataSource2 for ControlName: " & control.Name & " - Error: " & ex.Message)
|
||||
End Try
|
||||
' Es ist wichtig, dass DisplayMember und ValueMember VOR der DataSource festgelegt werden,
|
||||
' Dadurch ist das Laden der Datasource um einiges SCHNELLER
|
||||
If columnCount = 1 Then
|
||||
control.DisplayMember = dt.Columns(0).ColumnName
|
||||
control.ValueMember = dt.Columns(0).ColumnName
|
||||
ElseIf columnCount = 2 Then
|
||||
control.DisplayMember = dt.Columns(1).ColumnName
|
||||
control.ValueMember = dt.Columns(0).ColumnName
|
||||
End If
|
||||
|
||||
' Als letztes setzen wir die DataSource
|
||||
control.DataSource = dt
|
||||
End Sub
|
||||
|
||||
Overloads Shared Sub SetDataSource(control As DevExpress.XtraEditors.ListBoxControl, dt As DataTable)
|
||||
Try
|
||||
If control.Name = "cmbverantwortlich" Then
|
||||
Console.WriteLine("Obacht")
|
||||
End If
|
||||
Dim columnCount As Integer = dt.Columns.Count
|
||||
Dim columnCount As Integer = dt.Columns.Count
|
||||
|
||||
' Damit beim Setzen von DisplayMember und ValueMember kein Fehler auftritt,
|
||||
' muss die Datasource zunächst geleert werden und der selected index auf -1 gesetzt werden.
|
||||
control.DataSource = Nothing
|
||||
control.SelectedIndex = -1
|
||||
' Damit beim Setzen von DisplayMember und ValueMember kein Fehler auftritt,
|
||||
' muss die Datasource zunächst geleert werden und der selected index auf -1 gesetzt werden.
|
||||
control.DataSource = Nothing
|
||||
control.SelectedIndex = -1
|
||||
|
||||
' Es ist wichtig, dass DisplayMember und ValueMember VOR der DataSource festgelegt werden,
|
||||
' Dadurch ist das Laden der Datasource um einiges SCHNELLER
|
||||
If columnCount = 1 Then
|
||||
control.DisplayMember = dt.Columns(0).ColumnName
|
||||
'control.ValueMember = dt.Columns(0).ColumnName
|
||||
ElseIf columnCount = 2 Then
|
||||
control.DisplayMember = dt.Columns(1).ColumnName
|
||||
control.ValueMember = dt.Columns(0).ColumnName
|
||||
End If
|
||||
' Es ist wichtig, dass DisplayMember und ValueMember VOR der DataSource festgelegt werden,
|
||||
' Dadurch ist das Laden der Datasource um einiges SCHNELLER
|
||||
If columnCount = 1 Then
|
||||
control.DisplayMember = dt.Columns(0).ColumnName
|
||||
control.ValueMember = dt.Columns(0).ColumnName
|
||||
ElseIf columnCount = 2 Then
|
||||
control.DisplayMember = dt.Columns(1).ColumnName
|
||||
control.ValueMember = dt.Columns(0).ColumnName
|
||||
End If
|
||||
|
||||
' Als letztes setzen wir die DataSource
|
||||
control.DataSource = dt
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("unexpected Error in SetDataSource3 for ControlName: " & control.Name & " - Error: " & ex.Message)
|
||||
End Try
|
||||
' Als letztes setzen wir die DataSource
|
||||
control.DataSource = dt
|
||||
End Sub
|
||||
|
||||
Overloads Shared Sub SetDataSource(control As Windows.Forms.DataGridView, dt As DataTable)
|
||||
Try
|
||||
If control.Name = "cmbverantwortlich" Then
|
||||
Console.WriteLine("Obacht")
|
||||
End If
|
||||
control.DataSource = dt
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("unexpected Error in SetDataSource4 for ControlName: " & control.Name & " - Error: " & ex.Message)
|
||||
End Try
|
||||
control.DataSource = dt
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@ -357,17 +297,11 @@
|
||||
Public Class Combobox : Inherits _ListControl
|
||||
|
||||
Public Shared Sub LoadValue(control As CustomComboBox, recordId As Integer, parentRecordId As Integer, value As String)
|
||||
If control.Name = "cmbverantwortlich" Then
|
||||
Console.WriteLine("Obacht")
|
||||
End If
|
||||
control.Text = value
|
||||
End Sub
|
||||
|
||||
Public Shared Sub LoadList(control As CustomComboBox, formId As Integer, connID As Object, SQLCommand As String)
|
||||
Try
|
||||
If control.Name = "cmbverantwortlich" Then
|
||||
Console.WriteLine("Obacht")
|
||||
End If
|
||||
Dim dynamic As DynamicValue = GetDynamicValue(DirectCast(control.Tag, ClassControlMetadata).Id, formId, connID, SQLCommand)
|
||||
|
||||
If dynamic.StaticList IsNot Nothing Then
|
||||
@ -385,9 +319,6 @@
|
||||
|
||||
Private Shared Sub CalculateDropdownWidth(control As CustomComboBox, dt As DataTable)
|
||||
Try
|
||||
If control.Name = "cmbverantwortlich" Then
|
||||
Console.WriteLine("Obacht")
|
||||
End If
|
||||
Const WIDEST_WIDTH As Integer = 300
|
||||
Dim FinalWidth As Integer = WIDEST_WIDTH
|
||||
Dim index As Integer = 1
|
||||
@ -428,8 +359,6 @@
|
||||
control.SetItemCheckState(pos, CheckState.Checked)
|
||||
End If
|
||||
Next
|
||||
control.Refresh()
|
||||
' control.Invoke(control)
|
||||
End Sub
|
||||
|
||||
Public Shared Sub LoadList(control As DevExpress.XtraEditors.CheckedListBoxControl, formId As Integer, conn_Id As Object, SQLCommand As String)
|
||||
@ -461,9 +390,7 @@
|
||||
If IsNothing(value) Then
|
||||
Exit Sub
|
||||
End If
|
||||
If control.Name = "cmbverantwortlich" Then
|
||||
Console.WriteLine("Obacht")
|
||||
End If
|
||||
|
||||
control.SelectedIndex = control.FindStringExact(value)
|
||||
End Sub
|
||||
|
||||
|
||||
@ -163,9 +163,7 @@ Public Class ClassControlValues
|
||||
|
||||
For Each control As Control In controls
|
||||
Dim ControlId As Integer = DirectCast(control.Tag, ClassControlMetadata).Id
|
||||
If ControlId = 810 Then
|
||||
Console.WriteLine("Obacht")
|
||||
End If
|
||||
|
||||
' Wert per LINQ aus DT_ControlValues suchen der zur aktuellen controlId passt
|
||||
Dim values As List(Of Object) = (From row In DT_ControlValues.AsEnumerable()
|
||||
Where row.Item("CONTROL_ID") = ControlId
|
||||
@ -225,9 +223,7 @@ Public Class ClassControlValues
|
||||
Try
|
||||
' Für die meisten Controls wird nur das erste Element der Liste benötigt
|
||||
Dim value As String = Nothing
|
||||
If controlId = 810 Then
|
||||
Console.WriteLine("Obacht")
|
||||
End If
|
||||
|
||||
If values.Count > 0 Then
|
||||
value = values.Item(0)
|
||||
End If
|
||||
@ -277,7 +273,7 @@ Public Class ClassControlValues
|
||||
ClassLogger.Add(" >> Sub LoadControlValue - Control-Type nicht berücksichtigt: " & GetType(Control).ToString(), False)
|
||||
End Select
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Unexpected Error in LoadControlValue - ControlID: " & controlId.ToString & " - Error: " & ex.Message, True)
|
||||
ClassLogger.Add("Unexpected Error in LoadControlValue: " & ex.Message, True)
|
||||
MsgBox("Error in LoadControlValue:" & vbNewLine & ex.Message)
|
||||
End Try
|
||||
|
||||
@ -458,7 +454,7 @@ Public Class ClassControlValues
|
||||
Case GetType(CustomComboBox)
|
||||
Dim combo As CustomComboBox = DirectCast(control, CustomComboBox)
|
||||
combo.SelectedIndex = -1
|
||||
' combo.Text = String.Empty
|
||||
combo.Text = String.Empty
|
||||
|
||||
Case GetType(CheckBox)
|
||||
DirectCast(control, CheckBox).Checked = False
|
||||
|
||||
@ -22,7 +22,6 @@ Partial Class frmConstructor_Main
|
||||
'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
|
||||
<System.Diagnostics.DebuggerStepThrough()> _
|
||||
Private Sub InitializeComponent()
|
||||
Me.components = New System.ComponentModel.Container()
|
||||
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmConstructor_Main))
|
||||
Dim GridLevelNode1 As DevExpress.XtraGrid.GridLevelNode = New DevExpress.XtraGrid.GridLevelNode()
|
||||
Dim GridLevelNode2 As DevExpress.XtraGrid.GridLevelNode = New DevExpress.XtraGrid.GridLevelNode()
|
||||
@ -30,12 +29,12 @@ Partial Class frmConstructor_Main
|
||||
Me.SplitContainerMain = New DevExpress.XtraEditors.SplitContainerControl()
|
||||
Me.SplitContainerTop = New DevExpress.XtraEditors.SplitContainerControl()
|
||||
Me.TreeViewMain = New System.Windows.Forms.TreeView()
|
||||
Me.CMSEntity = New System.Windows.Forms.ContextMenuStrip(Me.components)
|
||||
Me.CMSEntity = New System.Windows.Forms.ContextMenuStrip()
|
||||
Me.ResetEbenenAuswahlToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.DateiimportEntitätToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.FormDesignerToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.GridControlMain = New DevExpress.XtraGrid.GridControl()
|
||||
Me.ContextMenuGrid = New System.Windows.Forms.ContextMenuStrip(Me.components)
|
||||
Me.ContextMenuGrid = New System.Windows.Forms.ContextMenuStrip()
|
||||
Me.FunktionenDataGridToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.ToolStripSeparator1 = New System.Windows.Forms.ToolStripSeparator()
|
||||
Me.AnsichtUmschaltenToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
@ -82,7 +81,7 @@ Partial Class frmConstructor_Main
|
||||
Me.Panel1 = New System.Windows.Forms.Panel()
|
||||
Me.GridControlPos = New DevExpress.XtraGrid.GridControl()
|
||||
Me.grvwGridPos = New DevExpress.XtraGrid.Views.Grid.GridView()
|
||||
Me.BindingNavigatorPOS = New System.Windows.Forms.BindingNavigator(Me.components)
|
||||
Me.BindingNavigatorPOS = New System.Windows.Forms.BindingNavigator()
|
||||
Me.BindingNavigatorAddNewItem = New System.Windows.Forms.ToolStripButton()
|
||||
Me.BindingNavigatorCountItem = New System.Windows.Forms.ToolStripLabel()
|
||||
Me.BindingNavigatorDeleteItem = New System.Windows.Forms.ToolStripButton()
|
||||
@ -124,20 +123,20 @@ Partial Class frmConstructor_Main
|
||||
Me.tsslblStatus = New System.Windows.Forms.ToolStripStatusLabel()
|
||||
Me.tsslblRecord = New System.Windows.Forms.ToolStripStatusLabel()
|
||||
Me.tsslblWorkflowstate = New System.Windows.Forms.ToolStripStatusLabel()
|
||||
Me.BindingSource_Entity = New System.Windows.Forms.BindingSource(Me.components)
|
||||
Me.BindingSource_Entity = New System.Windows.Forms.BindingSource()
|
||||
Me.DD_ECMAdmin = New DD_Record_Organiser.DD_ECMAdmin()
|
||||
Me.ImageCollection1 = New DevExpress.Utils.ImageCollection(Me.components)
|
||||
Me.ttToolTip = New System.Windows.Forms.ToolTip(Me.components)
|
||||
Me.ContextMenuDetails = New System.Windows.Forms.ContextMenuStrip(Me.components)
|
||||
Me.ImageCollection1 = New DevExpress.Utils.ImageCollection()
|
||||
Me.ttToolTip = New System.Windows.Forms.ToolTip()
|
||||
Me.ContextMenuDetails = New System.Windows.Forms.ContextMenuStrip()
|
||||
Me.DD_DMSDataSet = New DD_Record_Organiser.DD_DMSDataSet()
|
||||
Me.VWPMO_WF_USER_ACTIVEBindingSource = New System.Windows.Forms.BindingSource(Me.components)
|
||||
Me.VWPMO_WF_USER_ACTIVEBindingSource = New System.Windows.Forms.BindingSource()
|
||||
Me.VWPMO_WF_USER_ACTIVETableAdapter = New DD_Record_Organiser.DD_DMSDataSetTableAdapters.VWPMO_WF_ACTIVETableAdapter()
|
||||
Me.TableAdapterManager = New DD_Record_Organiser.DD_DMSDataSetTableAdapters.TableAdapterManager()
|
||||
Me.TBPMO_FILES_USERTableAdapter = New DD_Record_Organiser.DD_DMSDataSetTableAdapters.TBPMO_FILES_USERTableAdapter()
|
||||
Me.VWPMO_WF_ACTIVEBindingSource = New System.Windows.Forms.BindingSource(Me.components)
|
||||
Me.VWPMO_WF_ACTIVEBindingSource = New System.Windows.Forms.BindingSource()
|
||||
Me.VWPMO_WF_ACTIVETableAdapter = New DD_Record_Organiser.DD_DMSDataSetTableAdapters.VWPMO_WF_ACTIVETableAdapter()
|
||||
Me.TBPMO_FILES_USERBindingSource = New System.Windows.Forms.BindingSource(Me.components)
|
||||
Me.ToolTipController = New DevExpress.Utils.ToolTipController(Me.components)
|
||||
Me.TBPMO_FILES_USERBindingSource = New System.Windows.Forms.BindingSource()
|
||||
Me.ToolTipController = New DevExpress.Utils.ToolTipController()
|
||||
CType(Me.SplitContainerMain, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.SplitContainerMain.SuspendLayout()
|
||||
CType(Me.SplitContainerTop, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
|
||||
@ -621,8 +621,6 @@ Public Class frmConstructor_Main
|
||||
Me.Cursor = Cursors.WaitCursor
|
||||
Column_Row_Handler()
|
||||
Me.Cursor = Cursors.Default
|
||||
Me.Refresh()
|
||||
' pnlDetails.Invoke(sender, e)
|
||||
'If dataloaded = True Then
|
||||
' If LogErrorsOnly = False Then ClassLogger.Add(" >> grvwSelection_FocusedRowChanged - EditState: " & EDIT_STATE, False)
|
||||
' Dim selRecID = GetSelected_RecordID()
|
||||
@ -738,9 +736,6 @@ Public Class frmConstructor_Main
|
||||
End Try
|
||||
End If
|
||||
|
||||
If TCDetails.SelectedTabPage Is Nothing Then
|
||||
Exit Sub
|
||||
End If
|
||||
If TabPos.PageVisible = True And TCDetails.SelectedTabPage.Text.StartsWith("Posi") Then
|
||||
Clear_GridPos_View()
|
||||
Dim POS_GRID_RECORD = Get_Focused_Row_Cell_Value_pos("Record-ID")
|
||||
@ -1992,14 +1987,6 @@ Public Class frmConstructor_Main
|
||||
Case GetType(Windows.Forms.TextBox)
|
||||
Dim txt As TextBox = CType(Control, TextBox)
|
||||
txt.ReadOnly = state
|
||||
Case GetType(DevExpress.XtraEditors.CheckedListBoxControl)
|
||||
Dim chlb As DevExpress.XtraEditors.CheckedListBoxControl = CType(Control, DevExpress.XtraEditors.CheckedListBoxControl)
|
||||
If state = True Then
|
||||
chlb.Enabled = False
|
||||
Else
|
||||
chlb.Enabled = True
|
||||
End If
|
||||
|
||||
Case Else
|
||||
Control.Enabled = Not state
|
||||
|
||||
@ -3196,27 +3183,15 @@ Public Class frmConstructor_Main
|
||||
elapsed = sw.Elapsed.TotalSeconds
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> GetSearchDocuments took " & Format(elapsed, "0.000000000") & " seconds", False)
|
||||
If windreamSucheErgebnisse.Count > 0 Then
|
||||
Dim files_deleted As Integer = 0
|
||||
|
||||
For Each dok As WMObject In windreamSucheErgebnisse
|
||||
Dim filename = "W:" & dok.aPath
|
||||
Try
|
||||
File.Delete(filename)
|
||||
files_deleted = +1
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Unexpected Error in Delete windream-file '" & filename & "- Error: " & ex.Message)
|
||||
End Try
|
||||
Dim msg = "Es wurden (" & files_deleted.ToString & ") Dateien gelöscht!"
|
||||
If USER_LANGUAGE <> "de-DE" Then
|
||||
msg = "(" & files_deleted.ToString & ") files were deleted!"
|
||||
End If
|
||||
MsgBox(msg, MsgBoxStyle.Information)
|
||||
Next
|
||||
Else
|
||||
Dim msg = "Es wurden keine Dateien für diesen Datensatz gefunden!"
|
||||
If USER_LANGUAGE <> "de-DE" Then
|
||||
msg = "No files found for record!"
|
||||
End If
|
||||
MsgBox(msg, MsgBoxStyle.Information)
|
||||
End If
|
||||
|
||||
|
||||
|
||||
@ -440,6 +440,23 @@ Public Class frmFormInput
|
||||
System.Windows.Forms.MessageBox.Show(ex.Message)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub BindingNavigatorDeleteItem_Click(sender As Object, e As EventArgs)
|
||||
Dim result As MsgBoxResult
|
||||
result = MessageBox.Show("Möchten Sie den Datensatz wirklich löschen?", "Bestätigung erforderlich:", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
|
||||
If result = MsgBoxResult.Yes Then
|
||||
Dim sql As String = "DELETE FROM TBPMO_CONTROL_VALUE WHERE RECORD_ID = " & SelectedRecordID
|
||||
If ClassDatabase.Execute_non_Query(sql) = True Then ' Delete der Controls erfolgreich ausgeführt, jetzt der Record
|
||||
sql = "DELETE FROM TBPMO_RECORD WHERE GUID = " & SelectedRecordID
|
||||
If ClassDatabase.Execute_non_Query(sql) = True Then
|
||||
LoadOverview_Grid()
|
||||
ToolStrip_Notice("Der Datensatz wurde erfolgreich gelöscht - " & Now)
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub tsbtnrefresh_Click(sender As Object, e As EventArgs) Handles tsbtnrefresh.Click
|
||||
LoadOverview_Grid()
|
||||
End Sub
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user