ZooFlow: Add Attribute Edit Form

This commit is contained in:
Jonathan Jenne
2021-02-11 13:04:50 +01:00
parent 055b14ab6b
commit 882b5b9718
13 changed files with 511 additions and 268 deletions

View File

@@ -2863,6 +2863,19 @@ Namespace DSIDB_StammdatenTableAdapters
tableMapping.ColumnMappings.Add("DELETED_WHEN", "DELETED_WHEN")
tableMapping.ColumnMappings.Add("ATTR_TYPE", "ATTR_TYPE")
Me._adapter.TableMappings.Add(tableMapping)
Me._adapter.UpdateCommand = New Global.System.Data.SqlClient.SqlCommand()
Me._adapter.UpdateCommand.Connection = Me.Connection
Me._adapter.UpdateCommand.CommandText = "UPDATE TBIDB_ATTRIBUTE"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"SET TITLE = @TITLE, TYP_ID = @TYP_ID"& _
", MULTI_CONTEXT = @MULTI_CONTEXT, VIEW_SEQUENCE = @VIEW_SEQUENCE, VIEW_VISIBLE ="& _
" @VIEW_VISIBLE, COMMENT = @COMMENT"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"WHERE (GUID = @GUID)"
Me._adapter.UpdateCommand.CommandType = Global.System.Data.CommandType.Text
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@TITLE", Global.System.Data.SqlDbType.VarChar, 100, Global.System.Data.ParameterDirection.Input, 0, 0, "TITLE", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@TYP_ID", Global.System.Data.SqlDbType.TinyInt, 1, Global.System.Data.ParameterDirection.Input, 0, 0, "TYP_ID", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@MULTI_CONTEXT", Global.System.Data.SqlDbType.Bit, 1, Global.System.Data.ParameterDirection.Input, 0, 0, "MULTI_CONTEXT", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@VIEW_SEQUENCE", Global.System.Data.SqlDbType.Int, 4, Global.System.Data.ParameterDirection.Input, 0, 0, "VIEW_SEQUENCE", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@VIEW_VISIBLE", Global.System.Data.SqlDbType.Bit, 1, Global.System.Data.ParameterDirection.Input, 0, 0, "VIEW_VISIBLE", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@COMMENT", Global.System.Data.SqlDbType.VarChar, 1000, Global.System.Data.ParameterDirection.Input, 0, 0, "COMMENT", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._adapter.UpdateCommand.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.Original, false, Nothing, "", "", ""))
End Sub
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
@@ -2915,6 +2928,34 @@ Namespace DSIDB_StammdatenTableAdapters
Me.Adapter.Fill(dataTable)
Return dataTable
End Function
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0"), _
Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")> _
Public Overloads Overridable Function Update(ByVal dataTable As DSIDB_Stammdaten.TBIDB_ATTRIBUTEDataTable) As Integer
Return Me.Adapter.Update(dataTable)
End Function
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0"), _
Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")> _
Public Overloads Overridable Function Update(ByVal dataSet As DSIDB_Stammdaten) As Integer
Return Me.Adapter.Update(dataSet, "TBIDB_ATTRIBUTE")
End Function
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0"), _
Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")> _
Public Overloads Overridable Function Update(ByVal dataRow As Global.System.Data.DataRow) As Integer
Return Me.Adapter.Update(New Global.System.Data.DataRow() {dataRow})
End Function
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0"), _
Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")> _
Public Overloads Overridable Function Update(ByVal dataRows() As Global.System.Data.DataRow) As Integer
Return Me.Adapter.Update(dataRows)
End Function
End Class
'''<summary>
@@ -3490,6 +3531,8 @@ Namespace DSIDB_StammdatenTableAdapters
Private _tBIDB_BUSINESS_ENTITYTableAdapter As TBIDB_BUSINESS_ENTITYTableAdapter
Private _tBIDB_ATTRIBUTETableAdapter As TBIDB_ATTRIBUTETableAdapter
Private _tBIDB_ATTRIBUTE_TYPETableAdapter As TBIDB_ATTRIBUTE_TYPETableAdapter
Private _backupDataSetBeforeUpdate As Boolean
@@ -3521,6 +3564,20 @@ Namespace DSIDB_StammdatenTableAdapters
End Set
End Property
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0"), _
Global.System.ComponentModel.EditorAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerPropertyEditor, Microso"& _
"ft.VSDesigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3"& _
"a", "System.Drawing.Design.UITypeEditor")> _
Public Property TBIDB_ATTRIBUTETableAdapter() As TBIDB_ATTRIBUTETableAdapter
Get
Return Me._tBIDB_ATTRIBUTETableAdapter
End Get
Set
Me._tBIDB_ATTRIBUTETableAdapter = value
End Set
End Property
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0"), _
Global.System.ComponentModel.EditorAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerPropertyEditor, Microso"& _
@@ -3558,6 +3615,10 @@ Namespace DSIDB_StammdatenTableAdapters
AndAlso (Not (Me._tBIDB_BUSINESS_ENTITYTableAdapter.Connection) Is Nothing)) Then
Return Me._tBIDB_BUSINESS_ENTITYTableAdapter.Connection
End If
If ((Not (Me._tBIDB_ATTRIBUTETableAdapter) Is Nothing) _
AndAlso (Not (Me._tBIDB_ATTRIBUTETableAdapter.Connection) Is Nothing)) Then
Return Me._tBIDB_ATTRIBUTETableAdapter.Connection
End If
If ((Not (Me._tBIDB_ATTRIBUTE_TYPETableAdapter) Is Nothing) _
AndAlso (Not (Me._tBIDB_ATTRIBUTE_TYPETableAdapter.Connection) Is Nothing)) Then
Return Me._tBIDB_ATTRIBUTE_TYPETableAdapter.Connection
@@ -3578,6 +3639,9 @@ Namespace DSIDB_StammdatenTableAdapters
If (Not (Me._tBIDB_BUSINESS_ENTITYTableAdapter) Is Nothing) Then
count = (count + 1)
End If
If (Not (Me._tBIDB_ATTRIBUTETableAdapter) Is Nothing) Then
count = (count + 1)
End If
If (Not (Me._tBIDB_ATTRIBUTE_TYPETableAdapter) Is Nothing) Then
count = (count + 1)
End If
@@ -3601,6 +3665,15 @@ Namespace DSIDB_StammdatenTableAdapters
allChangedRows.AddRange(updatedRows)
End If
End If
If (Not (Me._tBIDB_ATTRIBUTETableAdapter) Is Nothing) Then
Dim updatedRows() As Global.System.Data.DataRow = dataSet.TBIDB_ATTRIBUTE.Select(Nothing, Nothing, Global.System.Data.DataViewRowState.ModifiedCurrent)
updatedRows = Me.GetRealUpdatedRows(updatedRows, allAddedRows)
If ((Not (updatedRows) Is Nothing) _
AndAlso (0 < updatedRows.Length)) Then
result = (result + Me._tBIDB_ATTRIBUTETableAdapter.Update(updatedRows))
allChangedRows.AddRange(updatedRows)
End If
End If
If (Not (Me._tBIDB_BUSINESS_ENTITYTableAdapter) Is Nothing) Then
Dim updatedRows() As Global.System.Data.DataRow = dataSet.TBIDB_BUSINESS_ENTITY.Select(Nothing, Nothing, Global.System.Data.DataViewRowState.ModifiedCurrent)
updatedRows = Me.GetRealUpdatedRows(updatedRows, allAddedRows)
@@ -3628,6 +3701,14 @@ Namespace DSIDB_StammdatenTableAdapters
allAddedRows.AddRange(addedRows)
End If
End If
If (Not (Me._tBIDB_ATTRIBUTETableAdapter) Is Nothing) Then
Dim addedRows() As Global.System.Data.DataRow = dataSet.TBIDB_ATTRIBUTE.Select(Nothing, Nothing, Global.System.Data.DataViewRowState.Added)
If ((Not (addedRows) Is Nothing) _
AndAlso (0 < addedRows.Length)) Then
result = (result + Me._tBIDB_ATTRIBUTETableAdapter.Update(addedRows))
allAddedRows.AddRange(addedRows)
End If
End If
If (Not (Me._tBIDB_BUSINESS_ENTITYTableAdapter) Is Nothing) Then
Dim addedRows() As Global.System.Data.DataRow = dataSet.TBIDB_BUSINESS_ENTITY.Select(Nothing, Nothing, Global.System.Data.DataViewRowState.Added)
If ((Not (addedRows) Is Nothing) _
@@ -3654,6 +3735,14 @@ Namespace DSIDB_StammdatenTableAdapters
allChangedRows.AddRange(deletedRows)
End If
End If
If (Not (Me._tBIDB_ATTRIBUTETableAdapter) Is Nothing) Then
Dim deletedRows() As Global.System.Data.DataRow = dataSet.TBIDB_ATTRIBUTE.Select(Nothing, Nothing, Global.System.Data.DataViewRowState.Deleted)
If ((Not (deletedRows) Is Nothing) _
AndAlso (0 < deletedRows.Length)) Then
result = (result + Me._tBIDB_ATTRIBUTETableAdapter.Update(deletedRows))
allChangedRows.AddRange(deletedRows)
End If
End If
If (Not (Me._tBIDB_ATTRIBUTE_TYPETableAdapter) Is Nothing) Then
Dim deletedRows() As Global.System.Data.DataRow = dataSet.TBIDB_ATTRIBUTE_TYPE.Select(Nothing, Nothing, Global.System.Data.DataViewRowState.Deleted)
If ((Not (deletedRows) Is Nothing) _
@@ -3708,6 +3797,11 @@ Namespace DSIDB_StammdatenTableAdapters
Throw New Global.System.ArgumentException("Für alle von einem TableAdapterManager verwalteten Instanzen von TableAdapter mus"& _
"s die gleiche Verbindungszeichenfolge verwendet werden.")
End If
If ((Not (Me._tBIDB_ATTRIBUTETableAdapter) Is Nothing) _
AndAlso (Me.MatchTableAdapterConnection(Me._tBIDB_ATTRIBUTETableAdapter.Connection) = false)) Then
Throw New Global.System.ArgumentException("Für alle von einem TableAdapterManager verwalteten Instanzen von TableAdapter mus"& _
"s die gleiche Verbindungszeichenfolge verwendet werden.")
End If
If ((Not (Me._tBIDB_ATTRIBUTE_TYPETableAdapter) Is Nothing) _
AndAlso (Me.MatchTableAdapterConnection(Me._tBIDB_ATTRIBUTE_TYPETableAdapter.Connection) = false)) Then
Throw New Global.System.ArgumentException("Für alle von einem TableAdapterManager verwalteten Instanzen von TableAdapter mus"& _
@@ -3756,6 +3850,15 @@ Namespace DSIDB_StammdatenTableAdapters
adaptersWithAcceptChangesDuringUpdate.Add(Me._tBIDB_BUSINESS_ENTITYTableAdapter.Adapter)
End If
End If
If (Not (Me._tBIDB_ATTRIBUTETableAdapter) Is Nothing) Then
revertConnections.Add(Me._tBIDB_ATTRIBUTETableAdapter, Me._tBIDB_ATTRIBUTETableAdapter.Connection)
Me._tBIDB_ATTRIBUTETableAdapter.Connection = CType(workConnection,Global.System.Data.SqlClient.SqlConnection)
Me._tBIDB_ATTRIBUTETableAdapter.Transaction = CType(workTransaction,Global.System.Data.SqlClient.SqlTransaction)
If Me._tBIDB_ATTRIBUTETableAdapter.Adapter.AcceptChangesDuringUpdate Then
Me._tBIDB_ATTRIBUTETableAdapter.Adapter.AcceptChangesDuringUpdate = false
adaptersWithAcceptChangesDuringUpdate.Add(Me._tBIDB_ATTRIBUTETableAdapter.Adapter)
End If
End If
If (Not (Me._tBIDB_ATTRIBUTE_TYPETableAdapter) Is Nothing) Then
revertConnections.Add(Me._tBIDB_ATTRIBUTE_TYPETableAdapter, Me._tBIDB_ATTRIBUTE_TYPETableAdapter.Connection)
Me._tBIDB_ATTRIBUTE_TYPETableAdapter.Connection = CType(workConnection,Global.System.Data.SqlClient.SqlConnection)
@@ -3829,6 +3932,10 @@ Namespace DSIDB_StammdatenTableAdapters
Me._tBIDB_BUSINESS_ENTITYTableAdapter.Connection = CType(revertConnections(Me._tBIDB_BUSINESS_ENTITYTableAdapter),Global.System.Data.SqlClient.SqlConnection)
Me._tBIDB_BUSINESS_ENTITYTableAdapter.Transaction = Nothing
End If
If (Not (Me._tBIDB_ATTRIBUTETableAdapter) Is Nothing) Then
Me._tBIDB_ATTRIBUTETableAdapter.Connection = CType(revertConnections(Me._tBIDB_ATTRIBUTETableAdapter),Global.System.Data.SqlClient.SqlConnection)
Me._tBIDB_ATTRIBUTETableAdapter.Transaction = Nothing
End If
If (Not (Me._tBIDB_ATTRIBUTE_TYPETableAdapter) Is Nothing) Then
Me._tBIDB_ATTRIBUTE_TYPETableAdapter.Connection = CType(revertConnections(Me._tBIDB_ATTRIBUTE_TYPETableAdapter),Global.System.Data.SqlClient.SqlConnection)
Me._tBIDB_ATTRIBUTE_TYPETableAdapter.Transaction = Nothing