diff --git a/app/DD_PM_WINDREAM/ClassInit.vb b/app/DD_PM_WINDREAM/ClassInit.vb index 401c075..66e9342 100644 --- a/app/DD_PM_WINDREAM/ClassInit.vb +++ b/app/DD_PM_WINDREAM/ClassInit.vb @@ -194,8 +194,8 @@ Public Class ClassInit 'sql = String.Format("SELECT COUNT(*) AS Expr1 FROM TBDD_USER_MODULE_LOG_IN WHERE UPPER(MODULE) = UPPER('Process-Manager') AND CLIENT_ID = {0}", 1) ' USERCOUNT_LOGGED_IN = ClassDatabase.Execute_Scalar(sql, MyConnectionString, True) - sql = "DELETE FROM TBDD_USER_MODULE_LOG_IN WHERE USER_ID = " & USER_ID & " AND MODULE = 'Process-Manager'" - ClassDatabase.Execute_non_Query(sql, True) + 'sql = "DELETE FROM TBDD_USER_MODULE_LOG_IN WHERE USER_ID = " & USER_ID & " AND MODULE = 'Process-Manager'" + 'ClassDatabase.Execute_non_Query(sql, True) LOGGER.Debug("Count Users logged in: " & USERCOUNT_LOGGED_IN.ToString) If LICENSE_COUNT < USERCOUNT_LOGGED_IN And LICENSE_EXPIRED = False Then MsgBox("Die Anzahl der aktuell angemeldeten User (" & USERCOUNT_LOGGED_IN.ToString & ") überschreitet die Anzahl der aktuellen Lizenzen!" & vbNewLine & "Anzahl der Lizenzen: " & LICENSE_COUNT.ToString & vbNewLine & "Bitte setzen Sie sich mit dem Systembetreuer in Verbindung!", MsgBoxStyle.Critical, "Achtung:") diff --git a/app/DD_PM_WINDREAM/ModuleControlProperties.vb b/app/DD_PM_WINDREAM/ModuleControlProperties.vb index 9052f54..231d535 100644 --- a/app/DD_PM_WINDREAM/ModuleControlProperties.vb +++ b/app/DD_PM_WINDREAM/ModuleControlProperties.vb @@ -161,6 +161,8 @@ Public Module ModuleControlProperties Public Property ChoiceList() As String + + Public Property DisplayAsLookUpControl As Boolean Public Class ChoiceListConverter Inherits TypeConverter @@ -209,6 +211,9 @@ Public Module ModuleControlProperties Public Property AllowAddNewValues As Boolean Public Property PreventDuplicates As Boolean + Public Property ChoiceList() As String + + Public Property DisplayAsComboBox As Boolean End Class Public Class LineLabelProperties diff --git a/app/DD_PM_WINDREAM/frmFormDesigner.vb b/app/DD_PM_WINDREAM/frmFormDesigner.vb index 03b79ed..4ff528f 100644 --- a/app/DD_PM_WINDREAM/frmFormDesigner.vb +++ b/app/DD_PM_WINDREAM/frmFormDesigner.vb @@ -769,6 +769,7 @@ Public Class frmFormDesigner cmbProps.ChoiceList = NotNull(row.Item("CHOICE_LIST"), String.Empty) props = cmbProps + cmbProps.DisplayAsLookUpControl = False ElseIf TypeOf sender Is DateTimePicker Then Dim dtp As DateTimePicker = sender @@ -788,7 +789,7 @@ Public Class frmFormDesigner lookupProps.MultiSelect = StrToBool(row.Item("MULTISELECT")) lookupProps.PreventDuplicates = StrToBool(row.Item("VKT_PREVENT_MULTIPLE_VALUES")) lookupProps.AllowAddNewValues = StrToBool(row.Item("VKT_ADD_ITEM")) - + lookupProps.DisplayAsComboBox = False props = lookupProps ElseIf TypeOf sender Is GridControl Then @@ -812,6 +813,16 @@ Public Class frmFormDesigner Dim prop As String = e.ChangedItem.Label Select Case prop + Case "DisplayAsLookUpControl" + If UpdateSingleValue("CTRL_TYPE", "LOOKUP") = True Then + MsgBox("Type has been changed. Controls will be reloaded!", MsgBoxStyle.Information, "") + LoadControls() + End If + Case "DisplayAsComboBox" + If UpdateSingleValue("CTRL_TYPE", "CMB") = True Then + MsgBox("Type has been changed. Controls will be reloaded!", MsgBoxStyle.Information, "") + LoadControls() + End If Case "Location" UpdateSingleValue("X_LOC", DirectCast(newValue, Point).X) UpdateSingleValue("Y_LOC", DirectCast(newValue, Point).Y) @@ -904,7 +915,7 @@ Public Class frmFormDesigner End Select End Sub - Private Sub UpdateSingleValue(columnName As String, value As Object) + Private Function UpdateSingleValue(columnName As String, value As Object) Dim guid As Integer = CURRENT_CONTROL_ID Dim escapedValue = value @@ -920,6 +931,7 @@ Public Class frmFormDesigner If ClassDatabase.Execute_non_Query($"UPDATE TBPM_PROFILE_CONTROLS SET {columnName} = {escapedValue}, CHANGED_WHO = '{Environment.UserName}' WHERE GUID = {guid}", True) = True Then tslblAenderungen.Visible = True tslblAenderungen.Text = "Änderungen gespeichert - " & Now + Return True End If @@ -928,8 +940,9 @@ Public Class frmFormDesigner Dim msg = $"UpdateSingleValue - Fehler beim Speichern von Control (Id: {guid}, column: {columnName}): {vbCrLf}{ex.Message}" MsgBox(msg) LOGGER.Info(msg) + Return False End Try - End Sub + End Function Private Sub MenuItemAddColumn_Click(sender As Object, e As EventArgs) Handles MenuItemAddColumn.Click Try diff --git a/app/DD_PM_WINDREAM/frmMassValidator.vb b/app/DD_PM_WINDREAM/frmMassValidator.vb index 63fd648..23de30f 100644 --- a/app/DD_PM_WINDREAM/frmMassValidator.vb +++ b/app/DD_PM_WINDREAM/frmMassValidator.vb @@ -396,7 +396,7 @@ Public Class frmMassValidator Catch ex As Exception - LOGGER.Warn($"Could not get the lookupconbtrol for name {oDEPENDING_CtrlName}") + LOGGER.Warn($"Could not get the lookupconbtrol for name {oDEPENDING_CtrlName}: " & ex.Message) _dependingControl_in_action = False End Try SendKeys.Send("{TAB}") diff --git a/app/DD_PM_WINDREAM/frmValidator.vb b/app/DD_PM_WINDREAM/frmValidator.vb index de65039..2cbf812 100644 --- a/app/DD_PM_WINDREAM/frmValidator.vb +++ b/app/DD_PM_WINDREAM/frmValidator.vb @@ -1050,8 +1050,12 @@ Public Class frmValidator For Each oControl As Control In pnldesigner.Controls If oControl.Tag = oDEPENDING_GUID Then - Dim oDependingLookup As LookupControl2 = oControl - oDependingLookup.DataSource = oDTDEPENDING_RESULT + If oControl.GetType.ToString = "System.Windows.Forms.TextBox" Then + oControl.Text = oDTDEPENDING_RESULT.Rows(0).Item(0) + Else + Dim oDependingLookup As LookupControl2 = oControl + oDependingLookup.DataSource = oDTDEPENDING_RESULT + End If _dependingControl_in_action = False Exit For End If @@ -1060,7 +1064,7 @@ Public Class frmValidator Catch ex As Exception - LOGGER.Warn($"Could not get the lookupconbtrol for name {oDEPENDING_CtrlName}") + LOGGER.Warn($"Error while setting depending control-value for [{oDEPENDING_CtrlName}]: " & ex.Message) _dependingControl_in_action = False End Try SendKeys.Send("{TAB}")