MS
This commit is contained in:
commit
a5da67bb14
@ -103,6 +103,7 @@ Public Class frmForm_Constructor_Main_2
|
|||||||
' Check_Record_Changed()
|
' Check_Record_Changed()
|
||||||
CloseWDDocview()
|
CloseWDDocview()
|
||||||
Save_Grid_Layout()
|
Save_Grid_Layout()
|
||||||
|
Save_Splitter_Layout()
|
||||||
ClassWindowLocation.SaveFormLocationSize(Me, CONSTRUCTORID, CURRENT_SCREEN_ID, "CONSTRUCTOR_MAIN")
|
ClassWindowLocation.SaveFormLocationSize(Me, CONSTRUCTORID, CURRENT_SCREEN_ID, "CONSTRUCTOR_MAIN")
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@ -149,13 +150,18 @@ Public Class frmForm_Constructor_Main_2
|
|||||||
|
|
||||||
#Region "Layout"
|
#Region "Layout"
|
||||||
Sub Save_POSGrid_Layout()
|
Sub Save_POSGrid_Layout()
|
||||||
|
Try
|
||||||
Dim EntityRegex As New RegularExpressions.Regex("\s+\(\d+\)")
|
Dim EntityRegex As New RegularExpressions.Regex("\s+\(\d+\)")
|
||||||
Dim EntityName As String = EntityRegex.Replace(ACT_EBENE_STRING & "_POS", "")
|
Dim EntityName As String = EntityRegex.Replace(ACT_EBENE_STRING & "_POS", "")
|
||||||
Dim Filename As String = String.Format("{0}-{1}-{2}-UserLayout.xml", grvwGridPos.Name, EntityName, CONSTRUCTORID)
|
Dim Filename As String = String.Format("{0}-{1}-{2}-UserLayout.xml", grvwGridPos.Name, EntityName, CONSTRUCTORID)
|
||||||
Dim XMLPath = System.IO.Path.Combine(Application.UserAppDataPath(), Filename)
|
Dim XMLPath = System.IO.Path.Combine(Application.UserAppDataPath(), Filename)
|
||||||
grvwGridPos.SaveLayoutToXml(XMLPath)
|
grvwGridPos.SaveLayoutToXml(XMLPath)
|
||||||
|
Catch ex As Exception
|
||||||
|
MsgBox("Error in Save_POSGrid_Layout:" & vbNewLine & ex.Message)
|
||||||
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
Sub Load_POSGrid_Layout()
|
Sub Load_POSGrid_Layout()
|
||||||
|
Try
|
||||||
Dim EntityRegex As New RegularExpressions.Regex("\s+\(\d+\)")
|
Dim EntityRegex As New RegularExpressions.Regex("\s+\(\d+\)")
|
||||||
Dim EntityName As String = EntityRegex.Replace(ACT_EBENE_STRING & "_POS", "")
|
Dim EntityName As String = EntityRegex.Replace(ACT_EBENE_STRING & "_POS", "")
|
||||||
Dim Filename As String = String.Format("{0}-{1}-{2}-UserLayout.xml", grvwGridPos.Name, EntityName, CONSTRUCTORID)
|
Dim Filename As String = String.Format("{0}-{1}-{2}-UserLayout.xml", grvwGridPos.Name, EntityName, CONSTRUCTORID)
|
||||||
@ -167,8 +173,12 @@ Public Class frmForm_Constructor_Main_2
|
|||||||
grvwGridPos.ClearSelection()
|
grvwGridPos.ClearSelection()
|
||||||
grvwGridPos.OptionsView.ShowPreview = False
|
grvwGridPos.OptionsView.ShowPreview = False
|
||||||
End If
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
MsgBox("Error in Load_POSGrid_Layout:" & vbNewLine & ex.Message)
|
||||||
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
Sub Save_Grid_Layout()
|
Sub Save_Grid_Layout()
|
||||||
|
Try
|
||||||
If ACT_EBENE_STRING Is Nothing Then
|
If ACT_EBENE_STRING Is Nothing Then
|
||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
@ -176,9 +186,13 @@ Public Class frmForm_Constructor_Main_2
|
|||||||
Dim XMLPath = Get_Grid_Layout_Filename()
|
Dim XMLPath = Get_Grid_Layout_Filename()
|
||||||
grvwGrid.SaveLayoutToXml(XMLPath)
|
grvwGrid.SaveLayoutToXml(XMLPath)
|
||||||
' Update_Status_Label(True, "Grid Layout Loaded")
|
' Update_Status_Label(True, "Grid Layout Loaded")
|
||||||
|
Catch ex As Exception
|
||||||
|
MsgBox("Error in Save_Grid_Layout:" & vbNewLine & ex.Message)
|
||||||
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Sub Load_Grid_Layout()
|
Sub Load_Grid_Layout()
|
||||||
|
Try
|
||||||
Dim XMLPath = Get_Grid_Layout_Filename()
|
Dim XMLPath = Get_Grid_Layout_Filename()
|
||||||
If File.Exists(XMLPath) And GRID_TYPE = GridType.Grid Then
|
If File.Exists(XMLPath) And GRID_TYPE = GridType.Grid Then
|
||||||
grvwGrid.RestoreLayoutFromXml(XMLPath)
|
grvwGrid.RestoreLayoutFromXml(XMLPath)
|
||||||
@ -189,17 +203,69 @@ Public Class frmForm_Constructor_Main_2
|
|||||||
|
|
||||||
'Update_Status_Label(True, "Grid Layout Loaded")
|
'Update_Status_Label(True, "Grid Layout Loaded")
|
||||||
End If
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
MsgBox("Error in Load_Grid_Layout: " & vbNewLine & ex.Message)
|
||||||
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Sub Load_Splitter_Layout()
|
||||||
|
Try
|
||||||
|
Dim XMLPath As String = Get_Splitter_Layout_Filename()
|
||||||
|
Dim layout As New ClassLayout(XMLPath)
|
||||||
|
Dim settings As System.Collections.Generic.List(Of ClassSetting)
|
||||||
|
settings = layout.Load()
|
||||||
|
|
||||||
|
If settings.Count = 0 Then
|
||||||
|
settings.Add(New ClassSetting("SplitViewTopSplitterPosition", SplitContainerTop.SplitterPosition))
|
||||||
|
settings.Add(New ClassSetting("SplitViewMainSplitterPosition", SplitContainerMain.SplitterPosition))
|
||||||
|
layout.Save(settings)
|
||||||
|
End If
|
||||||
|
|
||||||
|
For Each setting As ClassSetting In settings
|
||||||
|
Select Case setting._name
|
||||||
|
Case "SplitViewTopSplitterPosition"
|
||||||
|
SplitContainerTop.SplitterPosition = Integer.Parse(setting._value)
|
||||||
|
Case "SplitViewMainSplitterPosition"
|
||||||
|
SplitContainerMain.SplitterPosition = Integer.Parse(setting._value)
|
||||||
|
End Select
|
||||||
|
Next
|
||||||
|
Catch ex As Exception
|
||||||
|
MsgBox("Fehler in Load_Splitter_Layout:" & vbNewLine & ex.Message)
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Sub Save_Splitter_Layout()
|
||||||
|
Try
|
||||||
|
Dim XMLPath = Get_Splitter_Layout_Filename()
|
||||||
|
Dim layout As New ClassLayout(XMLPath)
|
||||||
|
Dim settings As New System.Collections.Generic.List(Of ClassSetting)
|
||||||
|
settings.Add(New ClassSetting("SplitViewTopSplitterPosition", SplitContainerTop.SplitterPosition))
|
||||||
|
settings.Add(New ClassSetting("SplitViewMainSplitterPosition", SplitContainerMain.SplitterPosition))
|
||||||
|
layout.Save(settings)
|
||||||
|
Catch ex As Exception
|
||||||
|
MsgBox("Error in Save_Splitter_Layout:" & vbNewLine & ex.Message)
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Function GetSafeFilename(filename As String)
|
||||||
|
Return String.Join("_", filename.Split(Path.GetInvalidFileNameChars()))
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Private Function Get_Splitter_Layout_Filename()
|
||||||
|
Dim Filename As String = String.Format("{0}-SplitterLayout.xml", CONSTRUCTORID)
|
||||||
|
Return System.IO.Path.Combine(Application.UserAppDataPath(), Filename)
|
||||||
|
End Function
|
||||||
|
|
||||||
Private Function Get_POSGrid_Layout_Filename()
|
Private Function Get_POSGrid_Layout_Filename()
|
||||||
Dim EntityRegex As New RegularExpressions.Regex("\s+\(\d+\)")
|
Dim EntityRegex As New RegularExpressions.Regex("\s+\(\d+\)")
|
||||||
Dim EntityName As String = EntityRegex.Replace(ACT_EBENE_STRING, "")
|
Dim EntityName As String = EntityRegex.Replace(ACT_EBENE_STRING, "")
|
||||||
Dim Filename As String = String.Format("{0}-{1}-{2}-UserLayout.xml", grvwGrid.Name, EntityName, CONSTRUCTORID)
|
Dim Filename As String = String.Format("{0}-{1}-{2}-UserLayout.xml", grvwGrid.Name, GetSafeFilename(EntityName), CONSTRUCTORID)
|
||||||
Return System.IO.Path.Combine(Application.UserAppDataPath(), Filename)
|
Return System.IO.Path.Combine(Application.UserAppDataPath(), Filename)
|
||||||
End Function
|
End Function
|
||||||
Private Function Get_Grid_Layout_Filename()
|
Private Function Get_Grid_Layout_Filename()
|
||||||
Dim EntityRegex As New RegularExpressions.Regex("\s+\(\d+\)")
|
Dim EntityRegex As New RegularExpressions.Regex("\s+\(\d+\)")
|
||||||
Dim EntityName As String = EntityRegex.Replace(ACT_EBENE_STRING, "")
|
Dim EntityName As String = EntityRegex.Replace(ACT_EBENE_STRING, "")
|
||||||
Dim Filename As String = String.Format("{0}-{1}-{2}-UserLayout.xml", grvwGrid.Name, EntityName, CONSTRUCTORID)
|
Dim Filename As String = String.Format("{0}-{1}-{2}-UserLayout.xml", grvwGrid.Name, GetSafeFilename(EntityName), CONSTRUCTORID)
|
||||||
Return System.IO.Path.Combine(Application.UserAppDataPath(), Filename)
|
Return System.IO.Path.Combine(Application.UserAppDataPath(), Filename)
|
||||||
End Function
|
End Function
|
||||||
#End Region
|
#End Region
|
||||||
@ -370,7 +436,30 @@ Public Class frmForm_Constructor_Main_2
|
|||||||
Next
|
Next
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
'Public Function Get_Grid_Sql(ConstructorId As Integer, FormId As Integer)
|
||||||
|
' If GRID_TYPE = GridType.Grid Then
|
||||||
|
' CURRENT_ENTITYSQL = "SELECT T.* FROM VWTEMP_PMO_FORM" & FormId.ToString & " T"
|
||||||
|
' Else 'Tiles und Carousel bekommen Quick View
|
||||||
|
' CURRENT_ENTITYSQL = String.Format("SELECT SQL_QUICK_VIEW FROM VWPMO_CONSTRUCTOR_FORMS WHERE CONSTRUCT_ID = {0} AND FORM_ID = {1}", ConstructorId, FormId)
|
||||||
|
' CURRENT_ENTITYSQL = ClassDatabase.Execute_Scalar(CURRENT_ENTITYSQL, True)
|
||||||
|
' If CURRENT_ENTITYSQL = String.Empty Then
|
||||||
|
' CURRENT_ENTITYSQL = "SELECT T.* FROM VWTEMP_PMO_FORM" & FormId.ToString & " T"
|
||||||
|
' If IS_SINGLE_RECORD = True Or CURRENT_FORM_TYPE = 5 Then
|
||||||
|
|
||||||
|
' Else
|
||||||
|
' GRID_TYPE = GridType.Grid
|
||||||
|
' GridControlMain.MainView = grvwGrid
|
||||||
|
' VIEW_ID = 3
|
||||||
|
' End If
|
||||||
|
|
||||||
|
|
||||||
|
' GridControlMain.MainView = grvwGrid
|
||||||
|
' End If
|
||||||
|
' End If
|
||||||
|
'End Function
|
||||||
|
|
||||||
Public Function Get_Grid_Sql(ConstructorId As Integer, FormId As Integer)
|
Public Function Get_Grid_Sql(ConstructorId As Integer, FormId As Integer)
|
||||||
|
Try
|
||||||
If GRID_TYPE = GridType.Grid Then
|
If GRID_TYPE = GridType.Grid Then
|
||||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> GridType = Grid", False)
|
If LogErrorsOnly = False Then ClassLogger.Add(" >> GridType = Grid", False)
|
||||||
CURRENT_ENTITYSQL = "SELECT T.* FROM VWTEMP_PMO_FORM" & FormId.ToString & " T"
|
CURRENT_ENTITYSQL = "SELECT T.* FROM VWTEMP_PMO_FORM" & FormId.ToString & " T"
|
||||||
@ -392,7 +481,12 @@ Public Class frmForm_Constructor_Main_2
|
|||||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Quick-View is configured", False)
|
If LogErrorsOnly = False Then ClassLogger.Add(" >> Quick-View is configured", False)
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
ClassLogger.Add("Error in Get_Grid_Sql: " & vbNewLine & ex.Message, True)
|
||||||
|
MsgBox("Error in Get_Grid_Sql: " & vbNewLine & ex.Message)
|
||||||
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function Get_Pos_SQL(FormId As Integer)
|
Public Function Get_Pos_SQL(FormId As Integer)
|
||||||
POS_SQL = "SELECT T.* FROM VWTEMP_PMO_FORM" & FormId.ToString & " T, TBPMO_RECORD_CONNECT t1 where T.[Record-ID] = T1.RECORD2_ID AND T1.RECORD1_ID = @PARENT_ID"
|
POS_SQL = "SELECT T.* FROM VWTEMP_PMO_FORM" & FormId.ToString & " T, TBPMO_RECORD_CONNECT t1 where T.[Record-ID] = T1.RECORD2_ID AND T1.RECORD1_ID = @PARENT_ID"
|
||||||
End Function
|
End Function
|
||||||
@ -889,6 +983,10 @@ Public Class frmForm_Constructor_Main_2
|
|||||||
tsButtonShowWorkflowTasks.Enabled = True
|
tsButtonShowWorkflowTasks.Enabled = True
|
||||||
ClassControlValues.LoadDefaultValues(CURRENT_FORM_ID, SELECTED_RECORD_ID, pnlDetails.Controls)
|
ClassControlValues.LoadDefaultValues(CURRENT_FORM_ID, SELECTED_RECORD_ID, pnlDetails.Controls)
|
||||||
ClassControlValues.LoadControlValuesList(SELECTED_RECORD_ID, CURRENT_FORM_ID, CtrlBuilder.AllControls)
|
ClassControlValues.LoadControlValuesList(SELECTED_RECORD_ID, CURRENT_FORM_ID, CtrlBuilder.AllControls)
|
||||||
|
|
||||||
|
' Im gegensatz zu EnableEditMode muss hier nur der save button enabled werden
|
||||||
|
tsButtonSave.Enabled = True
|
||||||
|
EDIT_STATE = EditState.Insert
|
||||||
RECORD_CHANGED = True
|
RECORD_CHANGED = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@ -1005,6 +1103,13 @@ Public Class frmForm_Constructor_Main_2
|
|||||||
MsgBox("Error in Save Data:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
MsgBox("Error in Save Data:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||||
End Try
|
End Try
|
||||||
|
|
||||||
|
If CtrlCommandUI.IsInsert Then
|
||||||
|
tsButtonSave.Enabled = False
|
||||||
|
Else
|
||||||
|
DisableEditMode()
|
||||||
|
End If
|
||||||
|
|
||||||
|
CtrlCommandUI.IsInsert = False
|
||||||
EDIT_STATE = EditState.None
|
EDIT_STATE = EditState.None
|
||||||
RECORD_CHANGED = False
|
RECORD_CHANGED = False
|
||||||
SAVE_ROUTINE_ACTIVE = False
|
SAVE_ROUTINE_ACTIVE = False
|
||||||
@ -1019,6 +1124,7 @@ Public Class frmForm_Constructor_Main_2
|
|||||||
Update_Status_Label(True, "Der Datensatz '" & SELECTED_RECORD_ID & "' wurde erfolgreich gelöscht - " & Now, EditState.Update)
|
Update_Status_Label(True, "Der Datensatz '" & SELECTED_RECORD_ID & "' wurde erfolgreich gelöscht - " & Now, EditState.Update)
|
||||||
Update_Record_Label(SELECTED_RECORD_ID)
|
Update_Record_Label(SELECTED_RECORD_ID)
|
||||||
Load_Tree_View_Data()
|
Load_Tree_View_Data()
|
||||||
|
DisableEditMode()
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
EDIT_STATE = EditState.None
|
EDIT_STATE = EditState.None
|
||||||
@ -1368,6 +1474,7 @@ Public Class frmForm_Constructor_Main_2
|
|||||||
'Überprüfen ob es für diese Entität Wiedervorlagen gibt?
|
'Überprüfen ob es für diese Entität Wiedervorlagen gibt?
|
||||||
Check_FOLLOWUP_IsConfigured(CURRENT_FORM_ID)
|
Check_FOLLOWUP_IsConfigured(CURRENT_FORM_ID)
|
||||||
Load_Grid_Layout()
|
Load_Grid_Layout()
|
||||||
|
Load_Splitter_Layout()
|
||||||
End If
|
End If
|
||||||
If POS_ENTITY > 0 Then
|
If POS_ENTITY > 0 Then
|
||||||
TabDetails.Text = "Kopfdaten"
|
TabDetails.Text = "Kopfdaten"
|
||||||
@ -1562,10 +1669,11 @@ Public Class frmForm_Constructor_Main_2
|
|||||||
EDIT_STATE = EditState.None
|
EDIT_STATE = EditState.None
|
||||||
Lock_RecordControls(True)
|
Lock_RecordControls(True)
|
||||||
'Me.pnlDetails.Enabled = False
|
'Me.pnlDetails.Enabled = False
|
||||||
CtrlCommandUI.IsInsert = False
|
'CtrlCommandUI.IsInsert = False
|
||||||
End If
|
End If
|
||||||
Update_Record_OnChange()
|
Update_Record_OnChange()
|
||||||
End If
|
End If
|
||||||
|
CtrlCommandUI.IsInsert = False
|
||||||
RECORD_CHANGED = False
|
RECORD_CHANGED = False
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user