jj: Add Logging
This commit is contained in:
parent
d0b277a04c
commit
f8c879e875
@ -216,102 +216,107 @@ Public Class frmFormDesigner
|
|||||||
|
|
||||||
Mouse_IsPressed = False
|
Mouse_IsPressed = False
|
||||||
|
|
||||||
Select Case e.Data.GetData(DataFormats.Text)
|
Try
|
||||||
Case ClassControlCreator.PREFIX_LABEL
|
Select Case e.Data.GetData(DataFormats.Text)
|
||||||
Dim label = ClassControlCreator.CreateNewLabel(cursorPosition)
|
Case ClassControlCreator.PREFIX_LABEL
|
||||||
SetMovementHandlers(label)
|
Dim label = ClassControlCreator.CreateNewLabel(cursorPosition)
|
||||||
|
SetMovementHandlers(label)
|
||||||
|
|
||||||
TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(ProfileId, label.Name, "LBL", label.Text, label.Location.X, label.Location.Y, Environment.UserName, label.Size.Height, label.Size.Width)
|
TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(ProfileId, label.Name, "LBL", label.Text, label.Location.X, label.Location.Y, Environment.UserName, label.Size.Height, label.Size.Width)
|
||||||
|
|
||||||
CurrentControl = label
|
CurrentControl = label
|
||||||
CurrentControl.Tag = GetLastID()
|
CurrentControl.Tag = GetLastID()
|
||||||
|
|
||||||
pnldesigner.Controls.Add(label)
|
pnldesigner.Controls.Add(label)
|
||||||
|
|
||||||
Case ClassControlCreator.PREFIX_TEXTBOX
|
Case ClassControlCreator.PREFIX_TEXTBOX
|
||||||
Dim txt = ClassControlCreator.CreateNewTextBox(cursorPosition)
|
Dim txt = ClassControlCreator.CreateNewTextBox(cursorPosition)
|
||||||
SetMovementHandlers(txt)
|
SetMovementHandlers(txt)
|
||||||
|
|
||||||
TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(ProfileId, txt.Name, "TXT", txt.Name, txt.Location.X, txt.Location.Y, Environment.UserName, txt.Size.Height, txt.Size.Width)
|
TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(ProfileId, txt.Name, "TXT", txt.Name, txt.Location.X, txt.Location.Y, Environment.UserName, txt.Size.Height, txt.Size.Width)
|
||||||
|
|
||||||
CurrentControl = txt
|
CurrentControl = txt
|
||||||
CurrentControl.Tag = GetLastID()
|
CurrentControl.Tag = GetLastID()
|
||||||
|
|
||||||
pnldesigner.Controls.Add(txt)
|
pnldesigner.Controls.Add(txt)
|
||||||
|
|
||||||
Case ClassControlCreator.PREFIX_COMBOBOX
|
Case ClassControlCreator.PREFIX_COMBOBOX
|
||||||
Dim cmb = ClassControlCreator.CreateNewCombobox(cursorPosition)
|
Dim cmb = ClassControlCreator.CreateNewCombobox(cursorPosition)
|
||||||
SetMovementHandlers(cmb)
|
SetMovementHandlers(cmb)
|
||||||
|
|
||||||
TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(ProfileId, cmb.Name, "CMB", cmb.Name, cmb.Location.X, cmb.Location.Y, Environment.UserName, cmb.Size.Height, cmb.Size.Width)
|
TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(ProfileId, cmb.Name, "CMB", cmb.Name, cmb.Location.X, cmb.Location.Y, Environment.UserName, cmb.Size.Height, cmb.Size.Width)
|
||||||
|
|
||||||
CurrentControl = cmb
|
CurrentControl = cmb
|
||||||
CurrentControl.Tag = GetLastID()
|
CurrentControl.Tag = GetLastID()
|
||||||
|
|
||||||
pnldesigner.Controls.Add(cmb)
|
pnldesigner.Controls.Add(cmb)
|
||||||
|
|
||||||
Case ClassControlCreator.PREFIX_DATETIMEPICKER
|
Case ClassControlCreator.PREFIX_DATETIMEPICKER
|
||||||
Dim dtp = ClassControlCreator.CreateNewDatetimepicker(cursorPosition)
|
Dim dtp = ClassControlCreator.CreateNewDatetimepicker(cursorPosition)
|
||||||
SetMovementHandlers(dtp)
|
SetMovementHandlers(dtp)
|
||||||
|
|
||||||
TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(ProfileId, dtp.Name, "DTP", dtp.Name, dtp.Location.X, dtp.Location.Y, Environment.UserName, dtp.Size.Height, dtp.Size.Width)
|
TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(ProfileId, dtp.Name, "DTP", dtp.Name, dtp.Location.X, dtp.Location.Y, Environment.UserName, dtp.Size.Height, dtp.Size.Width)
|
||||||
|
|
||||||
CurrentControl = dtp
|
CurrentControl = dtp
|
||||||
CurrentControl.Tag = GetLastID()
|
CurrentControl.Tag = GetLastID()
|
||||||
|
|
||||||
pnldesigner.Controls.Add(dtp)
|
pnldesigner.Controls.Add(dtp)
|
||||||
|
|
||||||
Case ClassControlCreator.PREFIX_CHECKBOX
|
Case ClassControlCreator.PREFIX_CHECKBOX
|
||||||
Dim chk = ClassControlCreator.CreateNewCheckbox(cursorPosition)
|
Dim chk = ClassControlCreator.CreateNewCheckbox(cursorPosition)
|
||||||
SetMovementHandlers(chk)
|
SetMovementHandlers(chk)
|
||||||
|
|
||||||
TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(ProfileId, chk.Name, "CHK", chk.Text, chk.Location.X, chk.Location.Y, Environment.UserName, chk.Size.Height, chk.Size.Width)
|
TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(ProfileId, chk.Name, "CHK", chk.Text, chk.Location.X, chk.Location.Y, Environment.UserName, chk.Size.Height, chk.Size.Width)
|
||||||
|
|
||||||
CurrentControl = chk
|
CurrentControl = chk
|
||||||
CurrentControl.Tag = GetLastID()
|
CurrentControl.Tag = GetLastID()
|
||||||
|
|
||||||
pnldesigner.Controls.Add(chk)
|
pnldesigner.Controls.Add(chk)
|
||||||
|
|
||||||
Case ClassControlCreator.PREFIX_DATAGRIDVIEW
|
Case ClassControlCreator.PREFIX_DATAGRIDVIEW
|
||||||
Dim dgv = ClassControlCreator.CreateNewDatagridview(cursorPosition)
|
Dim dgv = ClassControlCreator.CreateNewDatagridview(cursorPosition)
|
||||||
SetMovementHandlers(dgv)
|
SetMovementHandlers(dgv)
|
||||||
|
|
||||||
TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(ProfileId, dgv.Name, "DGV", dgv.Name, dgv.Location.X, dgv.Location.Y, Environment.UserName, dgv.Size.Height, dgv.Size.Width)
|
TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(ProfileId, dgv.Name, "DGV", dgv.Name, dgv.Location.X, dgv.Location.Y, Environment.UserName, dgv.Size.Height, dgv.Size.Width)
|
||||||
|
|
||||||
CurrentControl = dgv
|
CurrentControl = dgv
|
||||||
CurrentControl.Tag = GetLastID()
|
CurrentControl.Tag = GetLastID()
|
||||||
|
|
||||||
pnldesigner.Controls.Add(dgv)
|
pnldesigner.Controls.Add(dgv)
|
||||||
|
|
||||||
Case ClassControlCreator.PREFIX_TABLE
|
Case ClassControlCreator.PREFIX_TABLE
|
||||||
Dim tb = ClassControlCreator.CreateNewTable(cursorPosition)
|
Dim tb = ClassControlCreator.CreateNewTable(cursorPosition)
|
||||||
|
|
||||||
SetMovementHandlers(tb)
|
SetMovementHandlers(tb)
|
||||||
AddHandler tb.ColumnHeaderMouseClick, AddressOf table_ColumnHeaderMouseClick
|
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)
|
TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(ProfileId, tb.Name, "TABLE", tb.Name, tb.Location.X, tb.Location.Y, Environment.UserName, tb.Size.Height, tb.Size.Width)
|
||||||
|
|
||||||
CurrentControl = tb
|
CurrentControl = tb
|
||||||
CurrentControl.Tag = GetLastID()
|
CurrentControl.Tag = GetLastID()
|
||||||
|
|
||||||
TBPM_CONTROL_TABLETableAdapter.Insert(CurrentControl.Tag, "column1", "Column1", 95, Environment.UserName)
|
TBPM_CONTROL_TABLETableAdapter.Insert(CurrentControl.Tag, "column1", "Column1", 95, Environment.UserName)
|
||||||
TBPM_CONTROL_TABLETableAdapter.Insert(CurrentControl.Tag, "column2", "Column2", 95, Environment.UserName)
|
TBPM_CONTROL_TABLETableAdapter.Insert(CurrentControl.Tag, "column2", "Column2", 95, Environment.UserName)
|
||||||
|
|
||||||
pnldesigner.Controls.Add(tb)
|
pnldesigner.Controls.Add(tb)
|
||||||
|
|
||||||
Case ClassControlCreator.PREFIX_LINE
|
Case ClassControlCreator.PREFIX_LINE
|
||||||
Dim line = ClassControlCreator.CreateNewLine(cursorPosition)
|
Dim line = ClassControlCreator.CreateNewLine(cursorPosition)
|
||||||
|
|
||||||
SetMovementHandlers(line)
|
SetMovementHandlers(line)
|
||||||
|
|
||||||
TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(ProfileId, line.Name, "LINE", line.Name, line.Location.X, line.Location.Y, Environment.UserName, line.Size.Height, line.Size.Width)
|
TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(ProfileId, line.Name, "LINE", line.Name, line.Location.X, line.Location.Y, Environment.UserName, line.Size.Height, line.Size.Width)
|
||||||
|
|
||||||
CurrentControl = line
|
CurrentControl = line
|
||||||
CurrentControl.Tag = GetLastID()
|
CurrentControl.Tag = GetLastID()
|
||||||
|
|
||||||
|
|
||||||
pnldesigner.Controls.Add(line)
|
pnldesigner.Controls.Add(line)
|
||||||
End Select
|
End Select
|
||||||
|
Catch ex As Exception
|
||||||
|
ClassLogger.Add($"Error while Adding new control {e.Data.GetData(DataFormats.Text)}:")
|
||||||
|
ClassLogger.Add(ex)
|
||||||
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub pnlDesigner_DragEnter(sender As System.Object, e As DragEventArgs) Handles pnldesigner.DragEnter
|
Private Sub pnlDesigner_DragEnter(sender As System.Object, e As DragEventArgs) Handles pnldesigner.DragEnter
|
||||||
@ -601,11 +606,24 @@ Public Class frmFormDesigner
|
|||||||
|
|
||||||
' Beim Laden der Eigenschaften eines Controls muss die ganze Datatable neu geladen werden
|
' Beim Laden der Eigenschaften eines Controls muss die ganze Datatable neu geladen werden
|
||||||
' Nicht wirklich, aber gibt gerade keine bessere Möglichkeit, ohne alle SQL Abfragen selbst auszuführen
|
' Nicht wirklich, aber gibt gerade keine bessere Möglichkeit, ohne alle SQL Abfragen selbst auszuführen
|
||||||
TBPM_PROFILE_CONTROLSTableAdapter.FillByProfil(DD_DMSLiteDataSet.TBPM_PROFILE_CONTROLS, ProfileId)
|
Try
|
||||||
|
TBPM_PROFILE_CONTROLSTableAdapter.FillByProfil(DD_DMSLiteDataSet.TBPM_PROFILE_CONTROLS, ProfileId)
|
||||||
|
Catch ex As Exception
|
||||||
|
ClassLogger.Add("Error while executing TBPM_PROFILE_CONTROLSTableAdapter.FillByProfil in LoadControlProperties:")
|
||||||
|
ClassLogger.Add(ex)
|
||||||
|
End Try
|
||||||
|
|
||||||
row = dt.AsEnumerable().Where(Function(r As DataRow)
|
row = dt.AsEnumerable().Where(Function(r As DataRow)
|
||||||
Return r.Item("GUID") = sender.Tag
|
Return r.Item("GUID") = sender.Tag
|
||||||
End Function).Single()
|
End Function).SingleOrDefault()
|
||||||
|
|
||||||
|
' Control-Id wurde nicht in DataRow gefunden
|
||||||
|
If IsNothing(row) Then
|
||||||
|
ClassLogger.Add($"Error while filtering Controls by Guid '{sender.Tag}' in LoadControlProperties:")
|
||||||
|
MsgBox($"Control mit der Id {sender.Tag} wurde nicht gefunden!", MsgBoxStyle.Critical, "Fehler beim Laden der Control Eigenschaften")
|
||||||
|
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
' Globale Variablen setzen
|
' Globale Variablen setzen
|
||||||
CurrentControl = sender
|
CurrentControl = sender
|
||||||
@ -763,7 +781,7 @@ Public Class frmFormDesigner
|
|||||||
tslblAenderungen.Visible = True
|
tslblAenderungen.Visible = True
|
||||||
tslblAenderungen.Text = "Änderungen gespeichert - " & Now
|
tslblAenderungen.Text = "Änderungen gespeichert - " & Now
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
Dim msg = $"UpdateSingleValue - Fehler beim Speichern von Control (Id: {guid}): {vbCrLf}{ex.Message}"
|
Dim msg = $"UpdateSingleValue - Fehler beim Speichern von Control (Id: {guid}, column: {columnName}): {vbCrLf}{ex.Message}"
|
||||||
MsgBox(msg)
|
MsgBox(msg)
|
||||||
ClassLogger.Add(msg)
|
ClassLogger.Add(msg)
|
||||||
End Try
|
End Try
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user