lots of bugs annihilated/smashed/burned to the ground

This commit is contained in:
Jonathan Jenne
2019-04-26 17:19:49 +02:00
parent 7edb2b6037
commit bc3574dcff
14 changed files with 472 additions and 316 deletions

View File

@@ -27,6 +27,8 @@ Public Class frmFormDesigner
Private Windream_SimpleIndicies As List(Of String)
Private Windream_LookupIndicies As List(Of String)
Private CurrentColumnId As Integer = 0
Private Sub frmFormDesigner_Load(sender As Object, e As EventArgs) Handles Me.Load
Try
@@ -361,7 +363,6 @@ Public Class frmFormDesigner
SetMovementHandlers(tb)
AddHandler tb.MouseClick, AddressOf gridControl_MouseClick
'AddHandler tb.ColumnHeaderMouseClick, AddressOf table_ColumnHeaderMouseClick
TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(ProfileId, tb.Name, "TABLE", tb.Name, tb.Location.X, tb.Location.Y, Environment.UserName, tb.Size.Height, tb.Size.Width)
@@ -441,7 +442,7 @@ Public Class frmFormDesigner
CurrentControl = sender
CURRENT_CONTROL_ID = sender.Tag
If oHitinfo.InColumn Then
If oHitinfo.IsValid And oHitinfo.InColumn Then
Dim oColumn As GridColumn = oHitinfo.Column
If oColumn Is Nothing Then
@@ -452,10 +453,17 @@ Public Class frmFormDesigner
Dim oColumnName As String = oColumn.FieldName
Dim oColumnId = TBPM_CONTROL_TABLETableAdapter.getColumnID(CURRENT_CONTROL_ID, oColumnName)
CurrentColumnId = oColumnId
Dim frmTableColumn = New frmControl_Detail()
frmTableColumn.FillData(oColumnId)
frmTableColumn.FillData(CurrentColumnId)
frmTableColumn.Text = "Konfiguration von Spalte: " & oColumnCaption
frmTableColumn.Show()
Dim oResult = frmTableColumn.ShowDialog()
LoadControls()
ElseIf oHitinfo.IsValid And e.Button = MouseButtons.Right Then
GridControlContextMenu.Show(Cursor.Position.X, Cursor.Position.Y)
End If
Catch ex As Exception
LOGGER.Error(ex)
@@ -463,26 +471,6 @@ Public Class frmFormDesigner
End Try
End Sub
Public Sub table_ColumnHeaderMouseClick(sender As System.Object, e As DataGridViewCellMouseEventArgs)
Try
CurrentControl = sender
Dim dgv As DataGridView = sender
CurrentControl = dgv
CURRENT_CONTROL_ID = dgv.Tag
Dim dgvColumn As DataGridViewColumn = dgv.Columns(e.ColumnIndex)
Dim columnId = TBPM_CONTROL_TABLETableAdapter.getColumnID(CURRENT_CONTROL_ID, dgvColumn.Name)
Dim frmTableColumn = New frmControl_Detail()
frmTableColumn.FillData(columnId)
frmTableColumn.Text = "Konfiguration von Spalte: " & dgvColumn.Name
frmTableColumn.Show()
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Error while loading Column Configuration: " & vbCrLf & ex.Message, MsgBoxStyle.Critical)
End Try
End Sub
Sub DeleteControl(controlName As String)
Try
@@ -491,7 +479,7 @@ Public Class frmFormDesigner
If result = MsgBoxResult.Yes Then
Dim controlId As Integer = TBPM_PROFILE_CONTROLSTableAdapter.cmdGetGUID(ProfileId, controlName)
If controlId > 0 Then
Me.TBPM_CONTROL_TABLETableAdapter.Delete(controlId)
TBPM_CONTROL_TABLETableAdapter.DeleteColumnsByControlId(controlId)
TBPM_PROFILE_CONTROLSTableAdapter.Delete(controlId)
LoadControls()
End If
@@ -934,4 +922,22 @@ Public Class frmFormDesigner
LOGGER.Info(msg)
End Try
End Sub
Private Sub MenuItemAddColumn_Click(sender As Object, e As EventArgs) Handles MenuItemAddColumn.Click
Try
Dim oGuid = clsTools.ShortGuid()
Dim oColumnName As String = "colNew" & oGuid
Dim oColumnCaption As String = "New Column " & oGuid
If ClassDatabase.Execute_non_Query($"INSERT INTO TBPM_CONTROL_TABLE (CONTROL_ID, SPALTENNAME, SPALTEN_HEADER, SPALTENBREITE) VALUES({CURRENT_CONTROL_ID}, '{oColumnName}', '{oColumnCaption}', 95)", True) = True Then
tslblAenderungen.Visible = True
tslblAenderungen.Text = "Änderungen gespeichert - " & Now
LoadControls()
End If
Catch ex As Exception
Dim msg = $"MenuItemAddColumn_Click - Fehler beim Hinzufügen von einer neuen Spalte: {vbCrLf}{ex.Message}"
MsgBox(msg)
LOGGER.Error(ex)
End Try
End Sub
End Class