jj: Add Logging
This commit is contained in:
parent
d0b277a04c
commit
f8c879e875
@ -216,102 +216,107 @@ Public Class frmFormDesigner
|
||||
|
||||
Mouse_IsPressed = False
|
||||
|
||||
Select Case e.Data.GetData(DataFormats.Text)
|
||||
Case ClassControlCreator.PREFIX_LABEL
|
||||
Dim label = ClassControlCreator.CreateNewLabel(cursorPosition)
|
||||
SetMovementHandlers(label)
|
||||
Try
|
||||
Select Case e.Data.GetData(DataFormats.Text)
|
||||
Case ClassControlCreator.PREFIX_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.Tag = GetLastID()
|
||||
CurrentControl = label
|
||||
CurrentControl.Tag = GetLastID()
|
||||
|
||||
pnldesigner.Controls.Add(label)
|
||||
pnldesigner.Controls.Add(label)
|
||||
|
||||
Case ClassControlCreator.PREFIX_TEXTBOX
|
||||
Dim txt = ClassControlCreator.CreateNewTextBox(cursorPosition)
|
||||
SetMovementHandlers(txt)
|
||||
Case ClassControlCreator.PREFIX_TEXTBOX
|
||||
Dim txt = ClassControlCreator.CreateNewTextBox(cursorPosition)
|
||||
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.Tag = GetLastID()
|
||||
CurrentControl = txt
|
||||
CurrentControl.Tag = GetLastID()
|
||||
|
||||
pnldesigner.Controls.Add(txt)
|
||||
pnldesigner.Controls.Add(txt)
|
||||
|
||||
Case ClassControlCreator.PREFIX_COMBOBOX
|
||||
Dim cmb = ClassControlCreator.CreateNewCombobox(cursorPosition)
|
||||
SetMovementHandlers(cmb)
|
||||
Case ClassControlCreator.PREFIX_COMBOBOX
|
||||
Dim cmb = ClassControlCreator.CreateNewCombobox(cursorPosition)
|
||||
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.Tag = GetLastID()
|
||||
CurrentControl = cmb
|
||||
CurrentControl.Tag = GetLastID()
|
||||
|
||||
pnldesigner.Controls.Add(cmb)
|
||||
pnldesigner.Controls.Add(cmb)
|
||||
|
||||
Case ClassControlCreator.PREFIX_DATETIMEPICKER
|
||||
Dim dtp = ClassControlCreator.CreateNewDatetimepicker(cursorPosition)
|
||||
SetMovementHandlers(dtp)
|
||||
Case ClassControlCreator.PREFIX_DATETIMEPICKER
|
||||
Dim dtp = ClassControlCreator.CreateNewDatetimepicker(cursorPosition)
|
||||
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.Tag = GetLastID()
|
||||
CurrentControl = dtp
|
||||
CurrentControl.Tag = GetLastID()
|
||||
|
||||
pnldesigner.Controls.Add(dtp)
|
||||
pnldesigner.Controls.Add(dtp)
|
||||
|
||||
Case ClassControlCreator.PREFIX_CHECKBOX
|
||||
Dim chk = ClassControlCreator.CreateNewCheckbox(cursorPosition)
|
||||
SetMovementHandlers(chk)
|
||||
Case ClassControlCreator.PREFIX_CHECKBOX
|
||||
Dim chk = ClassControlCreator.CreateNewCheckbox(cursorPosition)
|
||||
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.Tag = GetLastID()
|
||||
CurrentControl = chk
|
||||
CurrentControl.Tag = GetLastID()
|
||||
|
||||
pnldesigner.Controls.Add(chk)
|
||||
pnldesigner.Controls.Add(chk)
|
||||
|
||||
Case ClassControlCreator.PREFIX_DATAGRIDVIEW
|
||||
Dim dgv = ClassControlCreator.CreateNewDatagridview(cursorPosition)
|
||||
SetMovementHandlers(dgv)
|
||||
Case ClassControlCreator.PREFIX_DATAGRIDVIEW
|
||||
Dim dgv = ClassControlCreator.CreateNewDatagridview(cursorPosition)
|
||||
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.Tag = GetLastID()
|
||||
CurrentControl = dgv
|
||||
CurrentControl.Tag = GetLastID()
|
||||
|
||||
pnldesigner.Controls.Add(dgv)
|
||||
pnldesigner.Controls.Add(dgv)
|
||||
|
||||
Case ClassControlCreator.PREFIX_TABLE
|
||||
Dim tb = ClassControlCreator.CreateNewTable(cursorPosition)
|
||||
Case ClassControlCreator.PREFIX_TABLE
|
||||
Dim tb = ClassControlCreator.CreateNewTable(cursorPosition)
|
||||
|
||||
SetMovementHandlers(tb)
|
||||
AddHandler tb.ColumnHeaderMouseClick, AddressOf table_ColumnHeaderMouseClick
|
||||
SetMovementHandlers(tb)
|
||||
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.Tag = GetLastID()
|
||||
CurrentControl = tb
|
||||
CurrentControl.Tag = GetLastID()
|
||||
|
||||
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, "column1", "Column1", 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
|
||||
Dim line = ClassControlCreator.CreateNewLine(cursorPosition)
|
||||
Case ClassControlCreator.PREFIX_LINE
|
||||
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.Tag = GetLastID()
|
||||
CurrentControl = line
|
||||
CurrentControl.Tag = GetLastID()
|
||||
|
||||
|
||||
pnldesigner.Controls.Add(line)
|
||||
End Select
|
||||
pnldesigner.Controls.Add(line)
|
||||
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
|
||||
|
||||
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
|
||||
' 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)
|
||||
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
|
||||
CurrentControl = sender
|
||||
@ -763,7 +781,7 @@ Public Class frmFormDesigner
|
||||
tslblAenderungen.Visible = True
|
||||
tslblAenderungen.Text = "Änderungen gespeichert - " & Now
|
||||
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)
|
||||
ClassLogger.Add(msg)
|
||||
End Try
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user