diff --git a/app/DD_PM_WINDREAM/ClassControlCreator.vb b/app/DD_PM_WINDREAM/ClassControlCreator.vb index 439a26a..7d22320 100644 --- a/app/DD_PM_WINDREAM/ClassControlCreator.vb +++ b/app/DD_PM_WINDREAM/ClassControlCreator.vb @@ -1,5 +1,8 @@ Imports DD_LIB_Standards Imports DevExpress.Utils +Imports DevExpress.XtraEditors +Imports DevExpress.XtraEditors.Controls +Imports DevExpress.XtraEditors.NavigatorButtons Imports DevExpress.XtraGrid Imports DevExpress.XtraGrid.Views.Grid Imports DigitalData.Controls.LookupGrid @@ -179,6 +182,8 @@ Public Class ClassControlCreator .Cursor = Cursors.Hand, .Location = location } + oControl.UseEmbeddedNavigator = True + oControl.ForceInitialize() Dim oView As GridView = oControl.DefaultView oView.OptionsView.ShowGroupPanel = False @@ -236,8 +241,8 @@ Public Class ClassControlCreator Return control End Function - Public Shared Function CreateExistingCombobox(row As DataRow, designMode As Boolean) As ComboBox - Dim control As ComboBox = CreateBaseControl(New ComboBox(), row, designMode) + Public Shared Function CreateExistingCombobox(row As DataRow, designMode As Boolean) As Windows.Forms.ComboBox + Dim control As Windows.Forms.ComboBox = CreateBaseControl(New Windows.Forms.ComboBox(), row, designMode) control.Size = New Size(row.Item("WIDTH"), row.Item("HEIGHT")) @@ -321,8 +326,6 @@ Public Class ClassControlCreator Dim oDatatable As New DataTable Dim oView As GridView - - oControl.ForceInitialize() oView = oControl.DefaultView @@ -343,11 +346,27 @@ Public Class ClassControlCreator oControl.Size = New Size(row.Item("WIDTH"), row.Item("HEIGHT")) + ' Add and configure navigator to delete rows + oControl.UseEmbeddedNavigator = True + With oControl.EmbeddedNavigator.Buttons + .CancelEdit.Visible = False + .Edit.Visible = False + .EndEdit.Visible = False + .First.Visible = False + .Last.Visible = False + .Next.Visible = False + .NextPage.Visible = False + .Append.Visible = False + .PrevPage.Visible = False + .Prev.Visible = False + End With + For Each oRow As DD_DMSLiteDataSet.TBPM_CONTROL_TABLERow In columns Dim oColumn = New DataColumn() With { .DataType = GetType(String), .ColumnName = oRow.SPALTENNAME, - .Caption = oRow.SPALTEN_HEADER + .Caption = oRow.SPALTEN_HEADER, + .ReadOnly = False } oDatatable.Columns.Add(oColumn) @@ -358,6 +377,7 @@ Public Class ClassControlCreator Return oControl End Function + Public Shared Function CreateExistingLine(row As DataRow, designMode As Boolean) As LineLabel Dim control As LineLabel = CreateBaseControl(New LineLabel(), row, designMode) control.Text = "------------------------------" diff --git a/app/DD_PM_WINDREAM/DD_DMSLiteDataSet.Designer.vb b/app/DD_PM_WINDREAM/DD_DMSLiteDataSet.Designer.vb index e21d64b..bf3fbc5 100644 --- a/app/DD_PM_WINDREAM/DD_DMSLiteDataSet.Designer.vb +++ b/app/DD_PM_WINDREAM/DD_DMSLiteDataSet.Designer.vb @@ -20803,9 +20803,9 @@ Namespace DD_DMSLiteDataSetTableAdapters Me._adapter.TableMappings.Add(tableMapping) Me._adapter.DeleteCommand = New Global.System.Data.SqlClient.SqlCommand() Me._adapter.DeleteCommand.Connection = Me.Connection - Me._adapter.DeleteCommand.CommandText = "DELETE FROM TBPM_CONTROL_TABLE"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"WHERE (CONTROL_ID = @Original_CONTROL_ID)" + Me._adapter.DeleteCommand.CommandText = "DELETE FROM TBPM_CONTROL_TABLE"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"WHERE (GUID = @COLUMNID)" Me._adapter.DeleteCommand.CommandType = Global.System.Data.CommandType.Text - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_CONTROL_ID", Global.System.Data.SqlDbType.Int, 4, Global.System.Data.ParameterDirection.Input, 0, 0, "CONTROL_ID", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) + Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@COLUMNID", Global.System.Data.SqlDbType.Int, 4, Global.System.Data.ParameterDirection.Input, 0, 0, "GUID", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) Me._adapter.InsertCommand = New Global.System.Data.SqlClient.SqlCommand() Me._adapter.InsertCommand.Connection = Me.Connection Me._adapter.InsertCommand.CommandText = "INSERT INTO TBPM_CONTROL_TABLE"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" (CONTROL_ID, SPALTENNAME"& _ @@ -20891,7 +20891,7 @@ Namespace DD_DMSLiteDataSetTableAdapters _ Private Sub InitCommandCollection() - Me._commandCollection = New Global.System.Data.SqlClient.SqlCommand(4) {} + Me._commandCollection = New Global.System.Data.SqlClient.SqlCommand(5) {} Me._commandCollection(0) = New Global.System.Data.SqlClient.SqlCommand() Me._commandCollection(0).Connection = Me.Connection Me._commandCollection(0).CommandText = "SELECT GUID, CONTROL_ID, SPALTENNAME, SPALTEN_HEADER, SPALTENBREITE, VALID"& _ @@ -20918,23 +20918,28 @@ Namespace DD_DMSLiteDataSetTableAdapters Me._commandCollection(1).Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_GUID", Global.System.Data.SqlDbType.Int, 4, Global.System.Data.ParameterDirection.Input, 0, 0, "GUID", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) Me._commandCollection(2) = New Global.System.Data.SqlClient.SqlCommand() Me._commandCollection(2).Connection = Me.Connection - Me._commandCollection(2).CommandText = "SELECT *"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"FROM TBPM_CONTROL_TABLE" + Me._commandCollection(2).CommandText = "DELETE FROM TBPM_CONTROL_TABLE"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"WHERE (CONTROL_ID = @CONTROL_ID)" Me._commandCollection(2).CommandType = Global.System.Data.CommandType.Text + Me._commandCollection(2).Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@CONTROL_ID", Global.System.Data.SqlDbType.Int, 4, Global.System.Data.ParameterDirection.Input, 0, 0, "CONTROL_ID", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) Me._commandCollection(3) = New Global.System.Data.SqlClient.SqlCommand() Me._commandCollection(3).Connection = Me.Connection - Me._commandCollection(3).CommandText = "SELECT GUID, CONTROL_ID, SPALTENNAME, SPALTEN_HEADER, SPALTENBREITE, VALID"& _ + Me._commandCollection(3).CommandText = "SELECT *"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"FROM TBPM_CONTROL_TABLE" + Me._commandCollection(3).CommandType = Global.System.Data.CommandType.Text + Me._commandCollection(4) = New Global.System.Data.SqlClient.SqlCommand() + Me._commandCollection(4).Connection = Me.Connection + Me._commandCollection(4).CommandText = "SELECT GUID, CONTROL_ID, SPALTENNAME, SPALTEN_HEADER, SPALTENBREITE, VALID"& _ "ATION, CHOICE_LIST, CONNECTION_ID, SQL_COMMAND, READ_ONLY, LOAD_IDX_VALUE, ADDED"& _ "_WHO, ADDED_WHEN, "&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" CHANGED_WHO, CHANGED_WHEN"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"FROM "& _ " TBPM_CONTROL_TABLE"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"WHERE (GUID = @GUID)" - Me._commandCollection(3).CommandType = Global.System.Data.CommandType.Text - Me._commandCollection(3).Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@GUID", Global.System.Data.SqlDbType.Int, 4, Global.System.Data.ParameterDirection.Input, 0, 0, "GUID", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) - Me._commandCollection(4) = New Global.System.Data.SqlClient.SqlCommand() - Me._commandCollection(4).Connection = Me.Connection - Me._commandCollection(4).CommandText = "SELECT GUID FROM TBPM_CONTROL_TABLE where Control_ID = @control_id and Spaltennam"& _ - "e = @spaltenname" Me._commandCollection(4).CommandType = Global.System.Data.CommandType.Text - Me._commandCollection(4).Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@control_id", Global.System.Data.SqlDbType.Int, 4, Global.System.Data.ParameterDirection.Input, 0, 0, "CONTROL_ID", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) - Me._commandCollection(4).Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@spaltenname", Global.System.Data.SqlDbType.VarChar, 100, Global.System.Data.ParameterDirection.Input, 0, 0, "SPALTENNAME", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) + Me._commandCollection(4).Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@GUID", Global.System.Data.SqlDbType.Int, 4, Global.System.Data.ParameterDirection.Input, 0, 0, "GUID", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) + Me._commandCollection(5) = New Global.System.Data.SqlClient.SqlCommand() + Me._commandCollection(5).Connection = Me.Connection + Me._commandCollection(5).CommandText = "SELECT GUID FROM TBPM_CONTROL_TABLE where Control_ID = @control_id and Spaltennam"& _ + "e = @spaltenname" + Me._commandCollection(5).CommandType = Global.System.Data.CommandType.Text + Me._commandCollection(5).Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@control_id", Global.System.Data.SqlDbType.Int, 4, Global.System.Data.ParameterDirection.Input, 0, 0, "CONTROL_ID", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) + Me._commandCollection(5).Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@spaltenname", Global.System.Data.SqlDbType.VarChar, 100, Global.System.Data.ParameterDirection.Input, 0, 0, "SPALTENNAME", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) End Sub _ Public Overloads Overridable Function FillAll(ByVal dataTable As DD_DMSLiteDataSet.TBPM_CONTROL_TABLEDataTable) As Integer - Me.Adapter.SelectCommand = Me.CommandCollection(2) + Me.Adapter.SelectCommand = Me.CommandCollection(3) If (Me.ClearBeforeFill = true) Then dataTable.Clear End If @@ -20981,7 +20986,7 @@ Namespace DD_DMSLiteDataSetTableAdapters Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _ Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.[Select], false)> _ Public Overloads Overridable Function GetDataAll() As DD_DMSLiteDataSet.TBPM_CONTROL_TABLEDataTable - Me.Adapter.SelectCommand = Me.CommandCollection(2) + Me.Adapter.SelectCommand = Me.CommandCollection(3) Dim dataTable As DD_DMSLiteDataSet.TBPM_CONTROL_TABLEDataTable = New DD_DMSLiteDataSet.TBPM_CONTROL_TABLEDataTable() Me.Adapter.Fill(dataTable) Return dataTable @@ -20992,7 +20997,7 @@ Namespace DD_DMSLiteDataSetTableAdapters Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _ Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Fill, false)> _ Public Overloads Overridable Function FillByGUID(ByVal dataTable As DD_DMSLiteDataSet.TBPM_CONTROL_TABLEDataTable, ByVal GUID As Integer) As Integer - Me.Adapter.SelectCommand = Me.CommandCollection(3) + Me.Adapter.SelectCommand = Me.CommandCollection(4) Me.Adapter.SelectCommand.Parameters(0).Value = CType(GUID,Integer) If (Me.ClearBeforeFill = true) Then dataTable.Clear @@ -21006,7 +21011,7 @@ Namespace DD_DMSLiteDataSetTableAdapters Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _ Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.[Select], false)> _ Public Overloads Overridable Function GetDataByGUID(ByVal GUID As Integer) As DD_DMSLiteDataSet.TBPM_CONTROL_TABLEDataTable - Me.Adapter.SelectCommand = Me.CommandCollection(3) + Me.Adapter.SelectCommand = Me.CommandCollection(4) Me.Adapter.SelectCommand.Parameters(0).Value = CType(GUID,Integer) Dim dataTable As DD_DMSLiteDataSet.TBPM_CONTROL_TABLEDataTable = New DD_DMSLiteDataSet.TBPM_CONTROL_TABLEDataTable() Me.Adapter.Fill(dataTable) @@ -21045,8 +21050,8 @@ Namespace DD_DMSLiteDataSetTableAdapters Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _ Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Delete, true)> _ - Public Overloads Overridable Function Delete(ByVal Original_CONTROL_ID As Integer) As Integer - Me.Adapter.DeleteCommand.Parameters(0).Value = CType(Original_CONTROL_ID,Integer) + Public Overloads Overridable Function Delete(ByVal COLUMNID As Integer) As Integer + Me.Adapter.DeleteCommand.Parameters(0).Value = CType(COLUMNID,Integer) Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.DeleteCommand.Connection.State If ((Me.Adapter.DeleteCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then @@ -21331,11 +21336,34 @@ Namespace DD_DMSLiteDataSetTableAdapters Return returnValue End Function + _ + Public Overloads Overridable Function DeleteColumnsByControlId(ByVal CONTROL_ID As Integer) As Integer + Dim command As Global.System.Data.SqlClient.SqlCommand = Me.CommandCollection(2) + command.Parameters(0).Value = CType(CONTROL_ID,Integer) + Dim previousConnectionState As Global.System.Data.ConnectionState = command.Connection.State + If ((command.Connection.State And Global.System.Data.ConnectionState.Open) _ + <> Global.System.Data.ConnectionState.Open) Then + command.Connection.Open + End If + Dim returnValue As Integer + Try + returnValue = command.ExecuteNonQuery + Finally + If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then + command.Connection.Close + End If + End Try + Return returnValue + End Function + _ Public Overloads Overridable Function getColumnID(ByVal control_id As Integer, ByVal spaltenname As String) As Global.System.Nullable(Of Integer) - Dim command As Global.System.Data.SqlClient.SqlCommand = Me.CommandCollection(4) + Dim command As Global.System.Data.SqlClient.SqlCommand = Me.CommandCollection(5) command.Parameters(0).Value = CType(control_id,Integer) If (spaltenname Is Nothing) Then Throw New Global.System.ArgumentNullException("spaltenname") diff --git a/app/DD_PM_WINDREAM/DD_DMSLiteDataSet.xsd b/app/DD_PM_WINDREAM/DD_DMSLiteDataSet.xsd index 52efbf7..486528d 100644 --- a/app/DD_PM_WINDREAM/DD_DMSLiteDataSet.xsd +++ b/app/DD_PM_WINDREAM/DD_DMSLiteDataSet.xsd @@ -1774,9 +1774,9 @@ ORDER BY Y_LOC, X_LOC DELETE FROM TBPM_CONTROL_TABLE -WHERE (CONTROL_ID = @Original_CONTROL_ID) +WHERE (GUID = @COLUMNID) - + @@ -1910,6 +1910,17 @@ WHERE (GUID = @Original_GUID) + + + + DELETE FROM TBPM_CONTROL_TABLE +WHERE (CONTROL_ID = @CONTROL_ID) + + + + + + diff --git a/app/DD_PM_WINDREAM/DD_DMSLiteDataSet.xss b/app/DD_PM_WINDREAM/DD_DMSLiteDataSet.xss index 4f1229d..bda728d 100644 --- a/app/DD_PM_WINDREAM/DD_DMSLiteDataSet.xss +++ b/app/DD_PM_WINDREAM/DD_DMSLiteDataSet.xss @@ -4,7 +4,7 @@ Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. --> - + diff --git a/app/DD_PM_WINDREAM/My Project/AssemblyInfo.vb b/app/DD_PM_WINDREAM/My Project/AssemblyInfo.vb index 819a952..2c3e8d4 100644 --- a/app/DD_PM_WINDREAM/My Project/AssemblyInfo.vb +++ b/app/DD_PM_WINDREAM/My Project/AssemblyInfo.vb @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' übernehmen, indem Sie "*" eingeben: ' - + diff --git a/app/DD_PM_WINDREAM/frmControl_Detail.Designer.vb b/app/DD_PM_WINDREAM/frmControl_Detail.Designer.vb index 66c7348..2ceb72f 100644 --- a/app/DD_PM_WINDREAM/frmControl_Detail.Designer.vb +++ b/app/DD_PM_WINDREAM/frmControl_Detail.Designer.vb @@ -49,6 +49,7 @@ Partial Class frmControl_Detail Me.CHANGED_WHENTextBox = New System.Windows.Forms.TextBox() Me.StatusStrip1 = New System.Windows.Forms.StatusStrip() Me.tslblAenderungen = New System.Windows.Forms.ToolStripStatusLabel() + Me.btnDelete = New System.Windows.Forms.Button() SPALTENNAMELabel = New System.Windows.Forms.Label() SPALTEN_HEADERLabel = New System.Windows.Forms.Label() SPALTENBREITELabel = New System.Windows.Forms.Label() @@ -218,6 +219,13 @@ Partial Class frmControl_Detail Me.tslblAenderungen.Name = "tslblAenderungen" resources.ApplyResources(Me.tslblAenderungen, "tslblAenderungen") ' + 'btnDelete + ' + Me.btnDelete.Image = Global.DD_PM_WINDREAM.My.Resources.Resources.cancel + resources.ApplyResources(Me.btnDelete, "btnDelete") + Me.btnDelete.Name = "btnDelete" + Me.btnDelete.UseVisualStyleBackColor = True + ' 'frmControl_Detail ' resources.ApplyResources(Me, "$this") @@ -231,6 +239,7 @@ Partial Class frmControl_Detail Me.Controls.Add(Me.ADDED_WHENTextBox) Me.Controls.Add(ADDED_WHOLabel) Me.Controls.Add(Me.ADDED_WHOTextBox) + Me.Controls.Add(Me.btnDelete) Me.Controls.Add(Me.btnSave) Me.Controls.Add(Me.LOAD_IDX_VALUECheckBox) Me.Controls.Add(Me.READ_ONLYCheckBox) @@ -271,4 +280,5 @@ End Sub Friend WithEvents CHANGED_WHENTextBox As System.Windows.Forms.TextBox Friend WithEvents StatusStrip1 As System.Windows.Forms.StatusStrip Friend WithEvents tslblAenderungen As System.Windows.Forms.ToolStripStatusLabel + Friend WithEvents btnDelete As Button End Class diff --git a/app/DD_PM_WINDREAM/frmControl_Detail.resx b/app/DD_PM_WINDREAM/frmControl_Detail.resx index c365c27..9f1a7c9 100644 --- a/app/DD_PM_WINDREAM/frmControl_Detail.resx +++ b/app/DD_PM_WINDREAM/frmControl_Detail.resx @@ -147,7 +147,7 @@ $this - 18 + 19 False @@ -177,7 +177,7 @@ $this - 16 + 17 False @@ -207,7 +207,7 @@ $this - 14 + 15 False @@ -237,7 +237,7 @@ $this - 12 + 13 False @@ -246,7 +246,7 @@ True - 11, 213 + 11, 263 67, 13 @@ -276,7 +276,7 @@ True - 164, 213 + 164, 263 77, 13 @@ -306,7 +306,7 @@ True - 12, 254 + 12, 304 80, 13 @@ -336,7 +336,7 @@ True - 164, 254 + 164, 304 90, 13 @@ -390,7 +390,7 @@ $this - 19 + 20 15, 108 @@ -411,7 +411,7 @@ $this - 17 + 18 15, 149 @@ -432,7 +432,7 @@ $this - 15 + 16 15, 25 @@ -453,7 +453,7 @@ $this - 13 + 14 15, 177 @@ -477,7 +477,7 @@ $this - 11 + 12 108, 177 @@ -501,16 +501,16 @@ $this - 10 + 11 MiddleLeft - 240, 169 + 167, 228 - 86, 32 + 159, 32 12 @@ -531,10 +531,10 @@ $this - 9 + 10 - 14, 229 + 14, 279 147, 22 @@ -555,7 +555,7 @@ 8 - 167, 229 + 167, 279 159, 22 @@ -576,7 +576,7 @@ 6 - 15, 270 + 15, 320 146, 22 @@ -597,7 +597,7 @@ 4 - 167, 270 + 167, 320 159, 22 @@ -630,10 +630,10 @@ False - 0, 309 + 0, 353 - 346, 22 + 342, 22 21 @@ -653,6 +653,40 @@ 0 + + MiddleLeft + + + + NoControl + + + 12, 228 + + + 149, 32 + + + 12 + + + Löschen + + + MiddleRight + + + btnDelete + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 9 + True @@ -660,7 +694,7 @@ 6, 13 - 346, 331 + 342, 375 Segoe UI, 8.25pt diff --git a/app/DD_PM_WINDREAM/frmControl_Detail.vb b/app/DD_PM_WINDREAM/frmControl_Detail.vb index 4f7e813..cfa48a2 100644 --- a/app/DD_PM_WINDREAM/frmControl_Detail.vb +++ b/app/DD_PM_WINDREAM/frmControl_Detail.vb @@ -37,6 +37,18 @@ Public Class frmControl_Detail End Sub + Private Sub btnDelete_Click(sender As Object, e As EventArgs) Handles btnDelete.Click + Try + If MessageBox.Show("Wollen Sie diese Spalte wirklich löschen?", "Spalte löschen", MessageBoxButtons.YesNo) = DialogResult.Yes Then + TBPM_CONTROL_TABLETableAdapter.Delete(GUIDTextBox.Text) + Close() + End If + Catch ex As Exception + LOGGER.Error(ex) + MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler beim Löschen:") + End Try + End Sub + Private Sub frmControl_Detail_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing My.Settings.frmTableColumns_Position = Me.Location End Sub @@ -55,4 +67,6 @@ Public Class frmControl_Detail End Try End Sub + + End Class \ No newline at end of file diff --git a/app/DD_PM_WINDREAM/frmFormDesigner.Designer.vb b/app/DD_PM_WINDREAM/frmFormDesigner.Designer.vb index 2689266..a5ead72 100644 --- a/app/DD_PM_WINDREAM/frmFormDesigner.Designer.vb +++ b/app/DD_PM_WINDREAM/frmFormDesigner.Designer.vb @@ -61,6 +61,8 @@ Partial Class frmFormDesigner Me.TBWH_CHECK_PROFILE_CONTROLSTableAdapter = New DD_PM_WINDREAM.DD_DMSLiteDataSetTableAdapters.TBWH_CHECK_PROFILE_CONTROLSTableAdapter() Me.TBPM_CONTROL_TABLEBindingSource = New System.Windows.Forms.BindingSource(Me.components) Me.TBPM_CONTROL_TABLETableAdapter = New DD_PM_WINDREAM.DD_DMSLiteDataSetTableAdapters.TBPM_CONTROL_TABLETableAdapter() + Me.GridControlContextMenu = New System.Windows.Forms.ContextMenuStrip(Me.components) + Me.MenuItemAddColumn = New System.Windows.Forms.ToolStripMenuItem() Me.GroupBox1.SuspendLayout() Me.pnldesigner.SuspendLayout() Me.TabControlEigenschaften.SuspendLayout() @@ -72,6 +74,7 @@ Partial Class frmFormDesigner Me.StatusStrip1.SuspendLayout() CType(Me.TBWH_CHECK_PROFILE_CONTROLSBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.TBPM_CONTROL_TABLEBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + Me.GridControlContextMenu.SuspendLayout() Me.SuspendLayout() ' 'GroupBox1 @@ -453,6 +456,18 @@ Partial Class frmFormDesigner ' Me.TBPM_CONTROL_TABLETableAdapter.ClearBeforeFill = True ' + 'GridControlContextMenu + ' + Me.GridControlContextMenu.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.MenuItemAddColumn}) + Me.GridControlContextMenu.Name = "ContextMenuStrip1" + Me.GridControlContextMenu.Size = New System.Drawing.Size(181, 48) + ' + 'MenuItemAddColumn + ' + Me.MenuItemAddColumn.Name = "MenuItemAddColumn" + Me.MenuItemAddColumn.Size = New System.Drawing.Size(180, 22) + Me.MenuItemAddColumn.Text = "Spalte hinzufügen" + ' 'frmFormDesigner ' Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 16.0!) @@ -485,6 +500,7 @@ Partial Class frmFormDesigner Me.StatusStrip1.PerformLayout() CType(Me.TBWH_CHECK_PROFILE_CONTROLSBindingSource, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.TBPM_CONTROL_TABLEBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + Me.GridControlContextMenu.ResumeLayout(False) Me.ResumeLayout(False) Me.PerformLayout() @@ -526,4 +542,6 @@ Partial Class frmFormDesigner Friend WithEvents pageProperties As TabPage Friend WithEvents pgControls As PropertyGrid Friend WithEvents btnLine As Button + Friend WithEvents GridControlContextMenu As ContextMenuStrip + Friend WithEvents MenuItemAddColumn As ToolStripMenuItem End Class diff --git a/app/DD_PM_WINDREAM/frmFormDesigner.resx b/app/DD_PM_WINDREAM/frmFormDesigner.resx index ac1726e..a7507ec 100644 --- a/app/DD_PM_WINDREAM/frmFormDesigner.resx +++ b/app/DD_PM_WINDREAM/frmFormDesigner.resx @@ -127,43 +127,49 @@ - 179, 17 + 368, 17 - 17, 17 + 206, 17 + + + 206, 17 - 1021, 17 - - - 904, 17 - - - 898, 56 - - - 458, 17 - - - 731, 17 - - 17, 56 + + 1093, 17 + + + 1141, 56 + + + 647, 17 + + + 920, 17 + + + 261, 56 + - 256, 56 + 499, 56 - 580, 56 + 823, 56 - 997, 56 - - 17, 95 + + 278, 95 + + + 17, 17 + - 25 + 213 diff --git a/app/DD_PM_WINDREAM/frmFormDesigner.vb b/app/DD_PM_WINDREAM/frmFormDesigner.vb index d292c0d..01ae430 100644 --- a/app/DD_PM_WINDREAM/frmFormDesigner.vb +++ b/app/DD_PM_WINDREAM/frmFormDesigner.vb @@ -27,6 +27,8 @@ Public Class frmFormDesigner Private Windream_SimpleIndicies As List(Of String) Private Windream_LookupIndicies As List(Of String) + Private CurrentColumnId As Integer = 0 + Private Sub frmFormDesigner_Load(sender As Object, e As EventArgs) Handles Me.Load Try @@ -361,7 +363,6 @@ Public Class frmFormDesigner SetMovementHandlers(tb) AddHandler tb.MouseClick, AddressOf gridControl_MouseClick - '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) @@ -441,7 +442,7 @@ Public Class frmFormDesigner CurrentControl = sender CURRENT_CONTROL_ID = sender.Tag - If oHitinfo.InColumn Then + If oHitinfo.IsValid And oHitinfo.InColumn Then Dim oColumn As GridColumn = oHitinfo.Column If oColumn Is Nothing Then @@ -452,10 +453,17 @@ Public Class frmFormDesigner Dim oColumnName As String = oColumn.FieldName Dim oColumnId = TBPM_CONTROL_TABLETableAdapter.getColumnID(CURRENT_CONTROL_ID, oColumnName) + CurrentColumnId = oColumnId + Dim frmTableColumn = New frmControl_Detail() - frmTableColumn.FillData(oColumnId) + frmTableColumn.FillData(CurrentColumnId) frmTableColumn.Text = "Konfiguration von Spalte: " & oColumnCaption - frmTableColumn.Show() + Dim oResult = frmTableColumn.ShowDialog() + + LoadControls() + + ElseIf oHitinfo.IsValid And e.Button = MouseButtons.Right Then + GridControlContextMenu.Show(Cursor.Position.X, Cursor.Position.Y) End If Catch ex As Exception LOGGER.Error(ex) @@ -463,26 +471,6 @@ Public Class frmFormDesigner End Try End Sub - Public Sub table_ColumnHeaderMouseClick(sender As System.Object, e As DataGridViewCellMouseEventArgs) - Try - CurrentControl = sender - Dim dgv As DataGridView = sender - - CurrentControl = dgv - CURRENT_CONTROL_ID = dgv.Tag - - Dim dgvColumn As DataGridViewColumn = dgv.Columns(e.ColumnIndex) - Dim columnId = TBPM_CONTROL_TABLETableAdapter.getColumnID(CURRENT_CONTROL_ID, dgvColumn.Name) - Dim frmTableColumn = New frmControl_Detail() - - frmTableColumn.FillData(columnId) - frmTableColumn.Text = "Konfiguration von Spalte: " & dgvColumn.Name - frmTableColumn.Show() - Catch ex As Exception - LOGGER.Error(ex) - MsgBox("Error while loading Column Configuration: " & vbCrLf & ex.Message, MsgBoxStyle.Critical) - End Try - End Sub Sub DeleteControl(controlName As String) Try @@ -491,7 +479,7 @@ Public Class frmFormDesigner If result = MsgBoxResult.Yes Then Dim controlId As Integer = TBPM_PROFILE_CONTROLSTableAdapter.cmdGetGUID(ProfileId, controlName) If controlId > 0 Then - Me.TBPM_CONTROL_TABLETableAdapter.Delete(controlId) + TBPM_CONTROL_TABLETableAdapter.DeleteColumnsByControlId(controlId) TBPM_PROFILE_CONTROLSTableAdapter.Delete(controlId) LoadControls() End If @@ -934,4 +922,22 @@ Public Class frmFormDesigner LOGGER.Info(msg) End Try End Sub + + Private Sub MenuItemAddColumn_Click(sender As Object, e As EventArgs) Handles MenuItemAddColumn.Click + Try + Dim oGuid = clsTools.ShortGuid() + Dim oColumnName As String = "colNew" & oGuid + Dim oColumnCaption As String = "New Column " & oGuid + If ClassDatabase.Execute_non_Query($"INSERT INTO TBPM_CONTROL_TABLE (CONTROL_ID, SPALTENNAME, SPALTEN_HEADER, SPALTENBREITE) VALUES({CURRENT_CONTROL_ID}, '{oColumnName}', '{oColumnCaption}', 95)", True) = True Then + tslblAenderungen.Visible = True + tslblAenderungen.Text = "Änderungen gespeichert - " & Now + + LoadControls() + End If + Catch ex As Exception + Dim msg = $"MenuItemAddColumn_Click - Fehler beim Hinzufügen von einer neuen Spalte: {vbCrLf}{ex.Message}" + MsgBox(msg) + LOGGER.Error(ex) + End Try + End Sub End Class \ No newline at end of file diff --git a/app/DD_PM_WINDREAM/frmValidator.Designer.vb b/app/DD_PM_WINDREAM/frmValidator.Designer.vb index e674e51..7404dd6 100644 --- a/app/DD_PM_WINDREAM/frmValidator.Designer.vb +++ b/app/DD_PM_WINDREAM/frmValidator.Designer.vb @@ -241,8 +241,8 @@ Partial Class frmValidator ' 'RefreshAdditionalSearchToolStripMenuItem ' - Me.RefreshAdditionalSearchToolStripMenuItem.Name = "RefreshAdditionalSearchToolStripMenuItem" resources.ApplyResources(Me.RefreshAdditionalSearchToolStripMenuItem, "RefreshAdditionalSearchToolStripMenuItem") + Me.RefreshAdditionalSearchToolStripMenuItem.Name = "RefreshAdditionalSearchToolStripMenuItem" ' 'TITLELabel1 ' @@ -284,6 +284,7 @@ Partial Class frmValidator Me.TableAdapterManager.TBPM_KONFIGURATIONTableAdapter = Me.TBPM_KONFIGURATIONTableAdapter Me.TableAdapterManager.TBPM_PROFILE_CONTROLSTableAdapter = Me.TBPM_PROFILE_CONTROLSTableAdapter Me.TableAdapterManager.TBPM_PROFILE_FILESTableAdapter = Me.TBPM_PROFILE_FILESTableAdapter + Me.TableAdapterManager.TBPM_PROFILE_FINAL_INDEXINGTableAdapter = Nothing Me.TableAdapterManager.TBPM_PROFILETableAdapter = Me.TBPM_PROFILETableAdapter Me.TableAdapterManager.TBPM_TYPETableAdapter = Nothing Me.TableAdapterManager.UpdateOrder = DD_PM_WINDREAM.DD_DMSLiteDataSetTableAdapters.TableAdapterManager.UpdateOrderOption.InsertUpdateDelete diff --git a/app/DD_PM_WINDREAM/frmValidator.resx b/app/DD_PM_WINDREAM/frmValidator.resx index 23c8aba..847b586 100644 --- a/app/DD_PM_WINDREAM/frmValidator.resx +++ b/app/DD_PM_WINDREAM/frmValidator.resx @@ -130,6 +130,31 @@ 608, 17 + + Segoe UI, 9pt, style=Bold + + + 22, 17 + + + sss + + + + False + + + 89, 17 + + + Anzahl Dateien: + + + 82, 17 + + + Document-ID: + 0, 621 @@ -140,7 +165,6 @@ 962, 22 - 4 @@ -159,35 +183,48 @@ 3 - - Segoe UI, 9pt, style=Bold - - - 22, 17 - - - sss - - - False - - - 89, 17 - - - Anzahl Dateien: - - - 82, 17 - - - Document-ID: - 790, 173 + + 206, 22 + + + Datei öffnen + + + 206, 22 + + + Datei-Info + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + xAAADsQBlSsOGwAAANlJREFUOE+lkrsRgzAQRCmBEijBNZDTgwNqIacCQkIHFEAJJBRATkBGer6nQTYS + 4mffzBv9dhchKRKRvwhO3uHb8Wqe50R5KbKCcbJI9gNUFCtTWZaSpqkhyzIZx5GQSXmgOwqofHPf985O + 0B0FfMxgzbSE0Ud3OaAoChmGwZgZs64kwQBd4P+dALBmYB3tJmAxd03TOOY1nI1qtmdww8wtmKv0A1rf + zFjn11RK+B1wSAFzp8SLflNOAF/I89yY67o+NVN+wJMQdqJte2amnABbV4y2nIDfkOgNgPkt6Gl+jn4A + AAAASUVORK5CYII= + + + + 206, 22 + + + Dateieigenschaften + + + False + + + 206, 22 + + + Refresh AdditionalSearch + - 207, 92 + 207, 114 ContextMenuStrip1 @@ -351,40 +388,6 @@ 0 - - 206, 22 - - - Datei öffnen - - - 206, 22 - - - Datei-Info - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - xAAADsQBlSsOGwAAANlJREFUOE+lkrsRgzAQRCmBEijBNZDTgwNqIacCQkIHFEAJJBRATkBGer6nQTYS - 4mffzBv9dhchKRKRvwhO3uHb8Wqe50R5KbKCcbJI9gNUFCtTWZaSpqkhyzIZx5GQSXmgOwqofHPf985O - 0B0FfMxgzbSE0Ud3OaAoChmGwZgZs64kwQBd4P+dALBmYB3tJmAxd03TOOY1nI1qtmdww8wtmKv0A1rf - zFjn11RK+B1wSAFzp8SLflNOAF/I89yY67o+NVN+wJMQdqJte2amnABbV4y2nIDfkOgNgPkt6Gl+jn4A - AAAASUVORK5CYII= - - - - 206, 22 - - - Dateieigenschaften - - - 206, 22 - - - Refresh AdditionalSearch - 725, 17 @@ -553,6 +556,33 @@ Segoe UI, 9.75pt + + Magenta + + + 165, 22 + + + Datei überspringen (F4) + + + Magenta + + + 106, 22 + + + Datei löschen + + + Magenta + + + 105, 22 + + + Annotationen + 0, 0 @@ -595,9 +625,21 @@ 0 - - 165, 212 - + + Fill + + + 3, 21 + + + 20, 20 + + + 194, 54 + + + 2 + WebBrowser @@ -610,6 +652,27 @@ 0 + + 165, 212 + + + 120, 17 + + + ToolStripStatusLabel1 + + + 3, 75 + + + 194, 22 + + + 0 + + + StatusStrip3 + StatusStrip3 @@ -646,6 +709,21 @@ 0 + + Fill + + + Segoe UI, 9.75pt, style=Italic + + + 3, 21 + + + 194, 25 + + + 0 + txtBetreff @@ -1797,6 +1875,24 @@ 947, 173 + + Segoe UI Semibold, 9pt, style=Bold, Italic + + + 139, 16 + + + ToolStripStatusLabel1 + + + Magenta + + + 153, 20 + + + Seitenansicht Minimal + 0, 340 @@ -1866,144 +1962,12 @@ 1 - - Segoe UI Semibold, 9pt, style=Bold, Italic - - - 139, 16 - - - ToolStripStatusLabel1 - - - Magenta - - - 153, 20 - - - Seitenansicht Minimal - 1064, 173 17, 212 - - Fill - - - 3, 21 - - - 20, 20 - - - 194, 54 - - - 2 - - - WebBrowser - - - System.Windows.Forms.WebBrowser, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpbxMailBody - - - 0 - - - 165, 212 - - - 3, 75 - - - 194, 22 - - - 0 - - - StatusStrip3 - - - StatusStrip3 - - - System.Windows.Forms.StatusStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpbxMailBody - - - 1 - - - 120, 17 - - - ToolStripStatusLabel1 - - - Fill - - - Segoe UI, 9.75pt, style=Italic - - - 3, 21 - - - 194, 25 - - - 0 - - - txtBetreff - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpBetreff - - - 0 - - - Magenta - - - 165, 22 - - - Datei überspringen (F4) - - - Magenta - - - 106, 22 - - - Datei löschen - - - Magenta - - - 105, 22 - - - Annotationen - 389, 212 diff --git a/app/DD_PM_WINDREAM/frmValidator.vb b/app/DD_PM_WINDREAM/frmValidator.vb index ff5a4bb..21a02c8 100644 --- a/app/DD_PM_WINDREAM/frmValidator.vb +++ b/app/DD_PM_WINDREAM/frmValidator.vb @@ -286,10 +286,6 @@ LOGGER.Error(ex) Try WINDREAM = New ClassPMWindream() WINDREAM.Create_Session() - '_windreamPM = New ClassPMWindream() - '_windreamPM.Create_Session() - '_windream = New ClassWindream_allgemein - '_windream.Create_Session() LOGGER.Debug(" >> Windream initiiert", False) Return True Catch ex As Exception @@ -519,10 +515,29 @@ LOGGER.Error(ex) LOGGER.Error(ex) clsLogger.Add("Error in LoadSimpleData for LookupControl2: " & ex.Message) End Try - ElseIf TypeOf control Is DataGridView Then + ElseIf TypeOf control Is GridControl Then Try - Dim dataGridView As DataGridView = control - dataGridView.DataSource = dt + Dim dataGridView As GridControl = control + Dim oDataSource As DataTable = dataGridView.DataSource + + If oDataSource Is Nothing OrElse oDataSource.Rows.Count = 0 Then + 'dataGridView.DataSource = dt + + Dim oDatatable As DataTable = dt.Clone() + + For Each oColumn As DataColumn In oDatatable.Columns + If oDataSource.Columns(oColumn.ColumnName) Is Nothing Then + 'oDataSource.Columns.Add(oColumn) + oDataSource.Columns.Add(oColumn.ColumnName, oColumn.DataType) + End If + Next + + For Each oRow As DataRow In dt.Rows + oDataSource.ImportRow(oRow) + Next + + dataGridView.DataSource = oDataSource + End If Catch ex As Exception LOGGER.Error(ex) clsLogger.Add("Error in LoadSimpleData for DataGridView: " & ex.Message) @@ -755,7 +770,7 @@ LOGGER.Error(ex) pnldesigner.Controls.Add(ctrl) - LoadSimpleData(ctrl, oControlRow.Item("GUID")) + 'LoadSimpleData(ctrl, oControlRow.Item("GUID")) Next LOGGER.Debug(" >> Controls geladen", False) LOGGER.Info("", False) @@ -1413,7 +1428,12 @@ LOGGER.Error(ex) - FillIndexValues() + FillIndexValues(first) + + For Each oControl As Control In pnldesigner.Controls + LoadSimpleData(oControl, oControl.Tag) + Next + LOGGER.Debug(" >> Indexmaske geladen", False) LOGGER.Debug("", False) @@ -1874,7 +1894,7 @@ LOGGER.Error(ex) End Function - Sub FillIndexValues() + Sub FillIndexValues(first As Boolean) Dim oControlType As String Dim oIndexName As String Try @@ -2038,6 +2058,7 @@ LOGGER.Error(ex) Select Case oTyp 'Tabellendarstellung Case "TABLE" + Dim dt As DataTable = ClassDatabase.Return_Datatable("SELECT * FROM TBPM_CONTROL_TABLE WHERE CONTROL_ID = " & oControlId) Dim SpaltenWerte As String() LOGGER.Debug($" >> {dt.Rows.Count} Columns configured for control {oControlId}.", False) @@ -2114,13 +2135,18 @@ LOGGER.Error(ex) 'Tabellendarstellung Case "TABLE" Dim dt As DataTable = ClassDatabase.Return_Datatable("SELECT * FROM TBPM_CONTROL_TABLE WHERE CONTROL_ID = " & oControlId) + Dim SpaltenWerte As String() LOGGER.Debug($" >> {dt.Rows.Count} Columns configured for control {oControlId}.", False) If dt.Rows.Count > 1 Then + Dim oDataSource As DataTable = dgv.DataSource + oDataSource.Rows.Clear() + For Each Zeile As Object In wertWD LOGGER.Debug($" >> vektorrow Value {Zeile.ToString}...", False) SpaltenWerte = Split(Zeile, Delimiter) - Dim oDataSource As DataTable = dgv.DataSource + + Select Case dt.Rows.Count Case 1 @@ -2178,6 +2204,16 @@ LOGGER.Error(ex) End Select + End If + + Else + If first = False Then + Dim oDataSource As DataTable = dgv.DataSource + + If oDataSource.Rows.Count > 0 Then + oDataSource.Rows.Clear() + End If + End If End If End If @@ -3216,7 +3252,15 @@ LOGGER.Error(ex) 'Das Array anpassen ReDim Preserve myVektorArr(ZeilenGrid) - str = String.Join(Delimiter, row.ItemArray) + Dim oValueList As New List(Of String) + + For Each item In row.ItemArray + item = NotNull(item, String.Empty) + If TypeOf item IsNot String Then item.ToString() + oValueList.Add(item) + Next + + str = String.Join(Delimiter, oValueList.ToArray) 'Den Wert im Array speichern myVektorArr(ZeilenGrid) = str @@ -3480,13 +3524,13 @@ LOGGER.Error(ex) Private Sub DateieigenschaftenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles DateieigenschaftenToolStripMenuItem.Click If Windream_Document_Path <> "" Then Cursor = Cursors.WaitCursor - Dim sei As New SHELLEXECUTEINFO - sei.cbSize = Marshal.SizeOf(sei) - sei.lpVerb = "properties" - sei.lpFile = Filesystem_Document_Path - sei.nShow = SW_SHOW - sei.fMask = SEE_MASK_INVOKEIDLIST - If Not ShellExecuteEx(sei) Then + Dim oShellExecuteInfo As New SHELLEXECUTEINFO + oShellExecuteInfo.cbSize = Marshal.SizeOf(oShellExecuteInfo) + oShellExecuteInfo.lpVerb = "properties" + oShellExecuteInfo.lpFile = Filesystem_Document_Path + oShellExecuteInfo.nShow = SW_SHOW + oShellExecuteInfo.fMask = SEE_MASK_INVOKEIDLIST + If Not ShellExecuteEx(oShellExecuteInfo) Then Dim ex As New System.ComponentModel.Win32Exception(System.Runtime.InteropServices.Marshal.GetLastWin32Error()) MsgBox("Fehler in Datei-Eigenschaften öffnen:" & vbNewLine & ex.Message, MsgBoxStyle.Critical) End If