FORMEL_SQL release Candidate

This commit is contained in:
Developer01
2026-03-25 15:20:39 +01:00
parent c464f24681
commit cb51396952
16 changed files with 2966 additions and 2130 deletions

View File

@@ -100,6 +100,7 @@ Public Class frmColumn_Detail
LU_CAPTIONTextBox.Text,
CheckEditInheritValue.Checked,
FORMULA_EXPRESSIONTextBox.Text,
FORMULA_SQLTextBox.Text,
GUIDTextBox.Text
)
tslblAenderungen.Visibility = DevExpress.XtraBars.BarItemVisibility.Always
@@ -224,4 +225,52 @@ Public Class frmColumn_Detail
Dim dt As DataTable = DatabaseFallback.GetDatatableECM(oSQL)
Return dt
End Function
Private Sub SimpleButton4_Click(sender As Object, e As EventArgs) Handles SimpleButton4.Click
Dim oldSQL = FORMULA_SQLTextBox.Text
CURRENT_DESIGN_TYPE = "SQL_SOURCE_TABLE_COLUMN"
CURRENT_INDEX_ID = GUIDTextBox.Text
Dim oForm2 As New frmSQLEditor(LOGCONFIG, DatabaseECM) With {
.SQLCommand = FORMULA_SQLTextBox.Text,
.SQLConnection = 0
}
oForm2.ShowDialog()
If oForm2.DialogResult = DialogResult.OK Then
If oldSQL <> oForm2.SQLCommand Then
Dim oUpdate As String = $"Update TBPM_CONTROL_TABLE SET CHANGED_WHO = '{USER_USERNAME}', FORMULA_SQL = '{oForm2.SQLCommand.Replace("'", "''")}'
, CONNECTION_ID = {oForm2.SQLConnection} WHERE GUID = {GUIDTextBox.Text}"
If DatabaseFallback.ExecuteNonQueryECM(oUpdate) = True Then
tslblAenderungen.Visibility = DevExpress.XtraBars.BarItemVisibility.Always
tslblAenderungen.Caption = "Changes saved - " & Now
FORMULA_SQLTextBox.Text = oForm2.SQLCommand
Else
MsgBox("Fehler beim Speichern des SQL Befehls. Bitte überprüfen Sie Ihre Eingabe und versuchen Sie es erneut.", MsgBoxStyle.Critical, "Fehler")
End If
End If
End If
End Sub
Private Sub FORMULA_EXPRESSIONTextBox_TextChanged(sender As Object, e As EventArgs) Handles FORMULA_EXPRESSIONTextBox.TextChanged, FORMULA_SQLTextBox.TextChanged
Dim oHasFormulaExpression As Boolean = FORMULA_EXPRESSIONTextBox.Text.Trim() <> String.Empty
Dim oHasFormulaSql As Boolean = FORMULA_SQLTextBox.Text.Trim() <> String.Empty
' Entweder/Oder-Validierung: Beide gleichzeitig ist nicht erlaubt
If oHasFormulaExpression AndAlso oHasFormulaSql Then
MsgBox("Es darf nur FORMULA_EXPRESSION oder FORMULA_SQL gesetzt sein, nicht beides." & vbCrLf &
"Bitte leeren Sie eines der beiden Felder.",
MsgBoxStyle.Exclamation, "Ungültige Konfiguration")
End If
' Wenn eine Formel gesetzt ist → ReadOnly aktivieren und sperren
If oHasFormulaExpression OrElse oHasFormulaSql Then
READ_ONLYCheckBox.Checked = True
'READ_ONLYCheckBox.Enabled = False
Else
READ_ONLYCheckBox.Checked = False
'READ_ONLYCheckBox.Enabled = True
End If
End Sub
End Class