This commit is contained in:
JenneJ 2015-12-01 15:34:19 +01:00
parent 2720196564
commit 6580796ef6
4 changed files with 101 additions and 67 deletions

View File

@ -330,7 +330,7 @@ Public Class ClassControlCommandsUI
InsertAllControls(FormID, RecordID, DirectCast(ctrl, GroupBox).Controls)
End If
Else
InsertControlValue(ctrl.Name, FormID, RecordID, CONTROL_VALUE)
InsertControlValue(ctrl.Name, RecordID, CONTROL_VALUE)
End If
Next
End Sub
@ -466,7 +466,7 @@ Public Class ClassControlCommandsUI
UpdateAllControls(FormID, RecordID, ctrls)
End If
Else
InsertControlValue(ctrl.Name, FormID, RecordID, CONTROL_VALUE)
InsertControlValue(ctrl.Name, RecordID, CONTROL_VALUE)
End If
Else ' Control Updaten
CONTROL_VALUE = GetControlValue(ctrl)
@ -574,9 +574,8 @@ Public Class ClassControlCommandsUI
End Select
End Function
Function InsertControlValue(ControlName As String, FormID As Integer, RecordID As Integer, Value As String)
Public Shared Function InsertControlValue(ControlID As String, RecordID As Integer, Value As String)
Try
Dim ControlID = GetControlID_for_Name(ControlName, FormID)
Dim AddedWho = Environment.UserName
Dim FORMAT_TYPE As String = ClassDatabase.Execute_Scalar("SELECT FORMAT_TYPE FROM TBPMO_CONTROL WHERE GUID = " & ControlID)
Try
@ -595,7 +594,7 @@ Public Class ClassControlCommandsUI
Catch ex As Exception
ClassLogger.Add("Unerwarteter Fehler in Insert ConvertValue to Format'" & FORMAT_TYPE & "': " & ex.Message, True)
End Try
Dim SQL = "INSERT INTO TBPMO_CONTROL_VALUE (CONTROL_ID, RECORD_ID, VALUE, ADDED_WHO) VALUES (" & ControlID & ", " & RecordID & ", '" & Value & "', '" & AddedWho & "')"
Return ClassDatabase.Execute_non_Query(SQL, True)
Catch ex As Exception

View File

@ -84,7 +84,6 @@ Partial Class frmForm_Constructor_Main_2
Me.ColumnHeader1 = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.ColumnHeader2 = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.TabPos = New DevExpress.XtraTab.XtraTabPage()
Me.SplitContainerControl1 = New DevExpress.XtraEditors.SplitContainerControl()
Me.GridControlPos = New DevExpress.XtraGrid.GridControl()
Me.grvwGridPos = New DevExpress.XtraGrid.Views.Grid.GridView()
Me.ToolStripEdit = New System.Windows.Forms.ToolStrip()
@ -113,7 +112,6 @@ Partial Class frmForm_Constructor_Main_2
Me.VWPMO_WF_ACTIVEBindingSource = New System.Windows.Forms.BindingSource(Me.components)
Me.VWPMO_WF_ACTIVETableAdapter = New DD_Record_Organiser.DD_DMSDataSetTableAdapters.VWPMO_WF_ACTIVETableAdapter()
Me.TBPMO_FILES_USERBindingSource = New System.Windows.Forms.BindingSource(Me.components)
Me.pnlDetails_Pos = New System.Windows.Forms.Panel()
CType(Me.grvwGrid, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.GridControlMain, System.ComponentModel.ISupportInitialize).BeginInit()
Me.ContextMenuGrid.SuspendLayout()
@ -137,8 +135,6 @@ Partial Class frmForm_Constructor_Main_2
Me.grpbxFU_Profile.SuspendLayout()
Me.GroupBox4.SuspendLayout()
Me.TabPos.SuspendLayout()
CType(Me.SplitContainerControl1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SplitContainerControl1.SuspendLayout()
CType(Me.GridControlPos, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.grvwGridPos, System.ComponentModel.ISupportInitialize).BeginInit()
Me.ToolStripEdit.SuspendLayout()
@ -183,7 +179,7 @@ Partial Class frmForm_Constructor_Main_2
Me.GridControlMain.Location = New System.Drawing.Point(0, 0)
Me.GridControlMain.MainView = Me.grvwTiles
Me.GridControlMain.Name = "GridControlMain"
Me.GridControlMain.Size = New System.Drawing.Size(779, 270)
Me.GridControlMain.Size = New System.Drawing.Size(786, 270)
Me.GridControlMain.TabIndex = 0
Me.GridControlMain.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.grvwCarousel, Me.grvwTiles, Me.grvwGrid})
'
@ -437,7 +433,7 @@ Partial Class frmForm_Constructor_Main_2
Me.SplitContainerBottom.Panel1.Controls.Add(Me.ToolStripEdit)
Me.SplitContainerBottom.Panel1.Text = "Panel1"
Me.SplitContainerBottom.Panel2.Text = "Panel2"
Me.SplitContainerBottom.Size = New System.Drawing.Size(1074, 365)
Me.SplitContainerBottom.Size = New System.Drawing.Size(1074, 372)
Me.SplitContainerBottom.SplitterPosition = 448
Me.SplitContainerBottom.TabIndex = 0
Me.SplitContainerBottom.Text = "SplitContainerControl1"
@ -453,7 +449,7 @@ Partial Class frmForm_Constructor_Main_2
Me.TCDetails.Location = New System.Drawing.Point(0, 25)
Me.TCDetails.Name = "TCDetails"
Me.TCDetails.SelectedTabPage = Me.TabDetails
Me.TCDetails.Size = New System.Drawing.Size(1062, 340)
Me.TCDetails.Size = New System.Drawing.Size(1069, 347)
Me.TCDetails.TabIndex = 1
Me.TCDetails.TabPages.AddRange(New DevExpress.XtraTab.XtraTabPage() {Me.TabDetails, Me.TabWindream, Me.TabFollowUp, Me.TabPos})
'
@ -462,7 +458,7 @@ Partial Class frmForm_Constructor_Main_2
Me.TabDetails.Controls.Add(Me.pnlDetails)
Me.TabDetails.Image = Global.DD_Record_Organiser.My.Resources.Resources.grid_Data_16xMD
Me.TabDetails.Name = "TabDetails"
Me.TabDetails.Size = New System.Drawing.Size(1060, 312)
Me.TabDetails.Size = New System.Drawing.Size(1063, 316)
Me.TabDetails.Text = "Detailansicht"
'
'pnlDetails
@ -471,7 +467,7 @@ Partial Class frmForm_Constructor_Main_2
Me.pnlDetails.Dock = System.Windows.Forms.DockStyle.Fill
Me.pnlDetails.Location = New System.Drawing.Point(0, 0)
Me.pnlDetails.Name = "pnlDetails"
Me.pnlDetails.Size = New System.Drawing.Size(1060, 312)
Me.pnlDetails.Size = New System.Drawing.Size(1063, 316)
Me.pnlDetails.TabIndex = 0
'
'TabWindream
@ -480,7 +476,7 @@ Partial Class frmForm_Constructor_Main_2
Me.TabWindream.Controls.Add(Me.ToolStripDokumente)
Me.TabWindream.Image = Global.DD_Record_Organiser.My.Resources.Resources.Files_7954
Me.TabWindream.Name = "TabWindream"
Me.TabWindream.Size = New System.Drawing.Size(1060, 312)
Me.TabWindream.Size = New System.Drawing.Size(1063, 316)
Me.TabWindream.Text = "windream-Dateien"
'
'AxObjectListControl
@ -491,7 +487,7 @@ Partial Class frmForm_Constructor_Main_2
Me.AxObjectListControl.Location = New System.Drawing.Point(0, 25)
Me.AxObjectListControl.Name = "AxObjectListControl"
Me.AxObjectListControl.OcxState = CType(resources.GetObject("AxObjectListControl.OcxState"), System.Windows.Forms.AxHost.State)
Me.AxObjectListControl.Size = New System.Drawing.Size(1060, 287)
Me.AxObjectListControl.Size = New System.Drawing.Size(1063, 291)
Me.AxObjectListControl.TabIndex = 6
Me.AxObjectListControl.TabStop = False
'
@ -500,7 +496,7 @@ Partial Class frmForm_Constructor_Main_2
Me.ToolStripDokumente.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.tslblWindreamView, Me.ToolStripDropDownButton2})
Me.ToolStripDokumente.Location = New System.Drawing.Point(0, 0)
Me.ToolStripDokumente.Name = "ToolStripDokumente"
Me.ToolStripDokumente.Size = New System.Drawing.Size(1060, 25)
Me.ToolStripDokumente.Size = New System.Drawing.Size(1063, 25)
Me.ToolStripDokumente.TabIndex = 2
Me.ToolStripDokumente.Text = "ToolStrip2"
'
@ -534,7 +530,7 @@ Partial Class frmForm_Constructor_Main_2
Me.TabFollowUp.Controls.Add(Me.ListViewFollowUp)
Me.TabFollowUp.Image = Global.DD_Record_Organiser.My.Resources.Resources.Task_16xMD
Me.TabFollowUp.Name = "TabFollowUp"
Me.TabFollowUp.Size = New System.Drawing.Size(1060, 312)
Me.TabFollowUp.Size = New System.Drawing.Size(1063, 316)
Me.TabFollowUp.Text = "Wiedervorlage"
'
'grpbxFU_Profile
@ -700,33 +696,20 @@ Partial Class frmForm_Constructor_Main_2
'
'TabPos
'
Me.TabPos.Controls.Add(Me.SplitContainerControl1)
Me.TabPos.Controls.Add(Me.GridControlPos)
Me.TabPos.Image = CType(resources.GetObject("TabPos.Image"), System.Drawing.Image)
Me.TabPos.Name = "TabPos"
Me.TabPos.PageVisible = False
Me.TabPos.Size = New System.Drawing.Size(1060, 312)
Me.TabPos.Size = New System.Drawing.Size(1063, 316)
Me.TabPos.Text = "Positionen"
'
'SplitContainerControl1
'
Me.SplitContainerControl1.Dock = System.Windows.Forms.DockStyle.Fill
Me.SplitContainerControl1.Location = New System.Drawing.Point(0, 0)
Me.SplitContainerControl1.Name = "SplitContainerControl1"
Me.SplitContainerControl1.Panel1.Controls.Add(Me.GridControlPos)
Me.SplitContainerControl1.Panel1.Text = "Panel1"
Me.SplitContainerControl1.Panel2.Controls.Add(Me.pnlDetails_Pos)
Me.SplitContainerControl1.Panel2.Text = "Panel2"
Me.SplitContainerControl1.Size = New System.Drawing.Size(1060, 312)
Me.SplitContainerControl1.SplitterPosition = 534
Me.SplitContainerControl1.TabIndex = 1
Me.SplitContainerControl1.Text = "SplitContainerControl1"
'
'GridControlPos
'
Me.GridControlPos.Dock = System.Windows.Forms.DockStyle.Fill
Me.GridControlPos.Location = New System.Drawing.Point(0, 0)
Me.GridControlPos.MainView = Me.grvwGridPos
Me.GridControlPos.Name = "GridControlPos"
Me.GridControlPos.Size = New System.Drawing.Size(534, 312)
Me.GridControlPos.Size = New System.Drawing.Size(1063, 316)
Me.GridControlPos.TabIndex = 0
Me.GridControlPos.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.grvwGridPos})
'
@ -745,7 +728,7 @@ Partial Class frmForm_Constructor_Main_2
Me.ToolStripEdit.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.tsButtonAdd, Me.tsButtonSave, Me.tsButtonDelete, Me.tsButtonEditMode, Me.ToolStripDropDownButton1, Me.tsButtonShowTaskOverview, Me.tsButtonShowWorkflowTasks})
Me.ToolStripEdit.Location = New System.Drawing.Point(0, 0)
Me.ToolStripEdit.Name = "ToolStripEdit"
Me.ToolStripEdit.Size = New System.Drawing.Size(1062, 25)
Me.ToolStripEdit.Size = New System.Drawing.Size(1069, 25)
Me.ToolStripEdit.TabIndex = 0
Me.ToolStripEdit.Text = "ToolStrip1"
'
@ -926,14 +909,6 @@ Partial Class frmForm_Constructor_Main_2
Me.TBPMO_FILES_USERBindingSource.DataMember = "TBPMO_FILES_USER"
Me.TBPMO_FILES_USERBindingSource.DataSource = Me.DD_DMSDataSet
'
'pnlDetails_Pos
'
Me.pnlDetails_Pos.Dock = System.Windows.Forms.DockStyle.Fill
Me.pnlDetails_Pos.Location = New System.Drawing.Point(0, 0)
Me.pnlDetails_Pos.Name = "pnlDetails_Pos"
Me.pnlDetails_Pos.Size = New System.Drawing.Size(514, 312)
Me.pnlDetails_Pos.TabIndex = 0
'
'frmForm_Constructor_Main_2
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
@ -973,8 +948,6 @@ Partial Class frmForm_Constructor_Main_2
Me.GroupBox4.ResumeLayout(False)
Me.GroupBox4.PerformLayout()
Me.TabPos.ResumeLayout(False)
CType(Me.SplitContainerControl1, System.ComponentModel.ISupportInitialize).EndInit()
Me.SplitContainerControl1.ResumeLayout(False)
CType(Me.GridControlPos, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.grvwGridPos, System.ComponentModel.ISupportInitialize).EndInit()
Me.ToolStripEdit.ResumeLayout(False)
@ -1076,6 +1049,4 @@ Partial Class frmForm_Constructor_Main_2
Friend WithEvents TabPos As DevExpress.XtraTab.XtraTabPage
Friend WithEvents GridControlPos As DevExpress.XtraGrid.GridControl
Friend WithEvents grvwGridPos As DevExpress.XtraGrid.Views.Grid.GridView
Friend WithEvents SplitContainerControl1 As DevExpress.XtraEditors.SplitContainerControl
Friend WithEvents pnlDetails_Pos As System.Windows.Forms.Panel
End Class

View File

@ -176,6 +176,15 @@
QNZXOJ+UG+leKBFEziSfaFcB0/llZ2XA64LAz5JA8cDLA5WDxP2K7CbINfm4TzvWIQc6bHRIkI8ZgQcf
D+56vpkB1A0978LsCwa9rbtK97dFEArTmp6FTReKO20oprrxPcdDpvpl0YG8v8LfaIoAkP8AXetq1oFY
DwcIdDRYJUwiAB0yTe/NNUuIXy/etxLLTTpKAAAAAElFTkSuQmCC
</value>
</data>
<data name="TabPos.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAAEnRFWHRUaXRsZQBMaXN0O0J1
bGxldDtRc385AAAAWklEQVQ4T2P4//8/RRhDwMbGhhGIQTReDFMP01QAxA9ANJJBzEDMggWzgmh0A0Ca
/4NoJANAfJwYpg6mGMMFxGKsgqRgrIKkYDBBsRegmkGBMxqIIzEQ/zMAAEU1ijjtzZ+zAAAAAElFTkSu
QmCC
</value>
</data>
<metadata name="ToolStripEdit.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">

View File

@ -1,6 +1,7 @@
Imports DevExpress.Utils
Imports DevExpress.XtraBars.Navigation
Imports DevExpress.XtraEditors
Imports DevExpress.XtraEditors.Controls
Imports DevExpress.XtraEditors.Repository
Imports DevExpress.XtraGrid.Views.Base
Imports DevExpress.XtraGrid.Views.Tile
@ -719,19 +720,7 @@ Public Class frmForm_Constructor_Main_2
pnlDetails.Enabled = False
AddHandler CtrlBuilder.OnRecordChanged, AddressOf OnRecordChanged
End Sub
Sub Load_POS_Controls(FORM_VIEW_ID As Integer, ENTITY_ID As Integer)
thisFORMVIEW_ID = FORM_VIEW_ID
CURRENT_FORM_ID = ClassDatabase.Execute_Scalar("SELECT FORM_ID FROM TBPMO_FORM_VIEW WHERE GUID = " & FORM_VIEW_ID)
CtrlBuilder = New ClassControlBuilder(pnlDetails_Pos, ttToolTip)
'LoadControls(thisFormId)
CtrlCommandUI = New ClassControlCommandsUI(CtrlBuilder,
ContextMenuDetails,
AddressOf NewEditAppointment,
AddressOf OpenFormData)
CtrlCommandUI.LoadControls(ENTITY_ID)
pnlDetails.Enabled = False
AddHandler CtrlBuilder.OnRecordChanged, AddressOf OnRecordChanged
End Sub
Private Sub OnRecordChanged(sender As Object, e As System.EventArgs)
RECORD_CHANGED = True
End Sub
@ -1716,6 +1705,54 @@ Public Class frmForm_Constructor_Main_2
End Try
End Sub
Sub Create_Grid_Editor(formId As Integer)
Dim SQL As String = "SELECT CONTROL_COL_NAME,CONTROL_SQLCOMMAND_1,CONTROL_STATIC_LIST FROM [VWPMO_CONTROL_SCREEN] WHERE CTRLTYPE_ID = 3 AND FORM_ID = " & formId
Dim ComboColumns As DataTable = ClassDatabase.Return_Datatable(SQL)
Dim comboEdit As New RepositoryItemComboBox()
Dim comboItems As ComboBoxItemCollection = comboEdit.Items
For Each col As DataRow In ComboColumns.Rows
Dim colName As String = col.Item(0)
Dim hasSqlCommand = col.Item(1).ToString() <> ""
Dim hasStaticList = col.Item(2).ToString() <> ""
If hasStaticList = True Then
Dim staticListItems = col.Item(2).ToString.Split(";")
comboItems.BeginUpdate()
Try
For Each item In staticListItems
comboItems.Add(item)
Next
Finally
comboItems.EndUpdate()
End Try
ElseIf hasSqlCommand = True Then
SQL = col.Item(1).ToString()
Dim dt As DataTable = ClassDatabase.Return_Datatable(SQL, "Load_Pos_Data")
For Each row As DataRow In dt.Rows
Dim value = row.Item(0)
comboItems.BeginUpdate()
Try
comboItems.Add(value)
Finally
comboItems.EndUpdate()
End Try
Next
End If
GridControlPos.RepositoryItems.Add(comboEdit)
If Not IsNothing(grvwGridPos.Columns(colName)) Then
grvwGridPos.Columns(colName).ColumnEdit = comboEdit
End If
Next
End Sub
Sub Load_Pos_Data()
Try
If POS_ENTITY > 0 Then
@ -1725,6 +1762,13 @@ Public Class frmForm_Constructor_Main_2
Clear_GridPos_View()
If Not IsNothing(DT_POS) Then
GridControlPos.DataSource = DT_POS
' --- Editoren laden für Combobox ---
Create_Grid_Editor(POS_ENTITY)
HideColumns_Pos(PARENT_RECORDID)
End If
End If
@ -2778,18 +2822,29 @@ Public Class frmForm_Constructor_Main_2
End Sub
Private Sub grvwGridPos_CellValueChanged(sender As Object, e As CellValueChangedEventArgs) Handles grvwGridPos.CellValueChanged
Dim column = e.Column.Name.Replace("col", "")
Dim column = e.Column.FieldName
Dim sql = String.Format("select guid from TBPMO_CONTROL where COL_NAME = '{0}' and FORM_ID = {1}", column, POS_ENTITY)
Dim controlid = ClassDatabase.Execute_Scalar(sql, True)
If Not IsNothing(controlid) Then
ClassControlCommandsUI.UpdateControlValue(controlid, POS_RECORD_ID, e.Value)
'Überprüfen ob schon value vorhanden
sql = String.Format("SELECT CONTROL_ID FROM VWPMO_VALUES WHERE CONTROL_ID = {0} AND FORM_ID = {1} AND CONTROL_COLUMN = '{2}' AND RECORD_ID = {3}", controlid, POS_ENTITY, column, POS_RECORD_ID)
Dim cId As Integer = ClassDatabase.Execute_Scalar(sql)
' Wenn cId = 0, existiert noch kein wert für diese controlId/FormId Kombination
If cId = 0 Then
ClassControlCommandsUI.InsertControlValue(controlid, POS_RECORD_ID, e.Value)
Update_Status_Label(True, "Datensatz wurde eingefügt", EditState.Insert)
Else
ClassControlCommandsUI.UpdateControlValue(controlid, POS_RECORD_ID, e.Value)
Update_Status_Label(True, "Datensatz wurde aktualisiert", EditState.Update)
End If
Else
Update_Status_Label(False)
End If
End Sub
Private Sub grvwGridPos_Click(sender As Object, e As EventArgs) Handles grvwGridPos.Click
End Sub
Private Sub grvwGridPos_FocusedRowChanged(sender As Object, e As FocusedRowChangedEventArgs) Handles grvwGridPos.FocusedRowChanged