fixes crash when editing a person with filled out note/checkboxes. also fixes crash when dbnull value is in checkboxes - also saves entries by default with "False" value rather then DBNull value.
This commit is contained in:
parent
3da77b5380
commit
577829e294
5 changed files with 15 additions and 41 deletions
Binary file not shown.
40
Gästeliste/GästeDataSet.Designer.vb
generated
40
Gästeliste/GästeDataSet.Designer.vb
generated
|
@ -561,6 +561,10 @@ Partial Public Class GästeDataSet
|
|||
Me.columnOrt.AllowDBNull = false
|
||||
Me.columnLand.AllowDBNull = false
|
||||
Me.columnLand.DefaultValue = CType("Deutschland",String)
|
||||
Me.columnStammgast.AllowDBNull = false
|
||||
Me.columnStammgast.DefaultValue = CType(false,Boolean)
|
||||
Me.columnBlockiert.AllowDBNull = false
|
||||
Me.columnBlockiert.DefaultValue = CType(false,Boolean)
|
||||
Me.CaseSensitive = false
|
||||
End Sub
|
||||
|
||||
|
@ -832,11 +836,7 @@ Partial Public Class GästeDataSet
|
|||
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
|
||||
Public Property Stammgast() As Boolean
|
||||
Get
|
||||
Try
|
||||
Return CType(Me(Me.tableGäste.StammgastColumn),Boolean)
|
||||
Catch e As Global.System.InvalidCastException
|
||||
Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte Stammgast in Tabelle Gäste ist DBNull.", e)
|
||||
End Try
|
||||
Return CType(Me(Me.tableGäste.StammgastColumn),Boolean)
|
||||
End Get
|
||||
Set
|
||||
Me(Me.tableGäste.StammgastColumn) = value
|
||||
|
@ -847,11 +847,7 @@ Partial Public Class GästeDataSet
|
|||
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
|
||||
Public Property Blockiert() As Boolean
|
||||
Get
|
||||
Try
|
||||
Return CType(Me(Me.tableGäste.BlockiertColumn),Boolean)
|
||||
Catch e As Global.System.InvalidCastException
|
||||
Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte Blockiert in Tabelle Gäste ist DBNull.", e)
|
||||
End Try
|
||||
Return CType(Me(Me.tableGäste.BlockiertColumn),Boolean)
|
||||
End Get
|
||||
Set
|
||||
Me(Me.tableGäste.BlockiertColumn) = value
|
||||
|
@ -893,30 +889,6 @@ Partial Public Class GästeDataSet
|
|||
Public Sub SetAnmerkungNull()
|
||||
Me(Me.tableGäste.AnmerkungColumn) = Global.System.Convert.DBNull
|
||||
End Sub
|
||||
|
||||
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
|
||||
Public Function IsStammgastNull() As Boolean
|
||||
Return Me.IsNull(Me.tableGäste.StammgastColumn)
|
||||
End Function
|
||||
|
||||
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
|
||||
Public Sub SetStammgastNull()
|
||||
Me(Me.tableGäste.StammgastColumn) = Global.System.Convert.DBNull
|
||||
End Sub
|
||||
|
||||
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
|
||||
Public Function IsBlockiertNull() As Boolean
|
||||
Return Me.IsNull(Me.tableGäste.BlockiertColumn)
|
||||
End Function
|
||||
|
||||
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
|
||||
Public Sub SetBlockiertNull()
|
||||
Me(Me.tableGäste.BlockiertColumn) = Global.System.Convert.DBNull
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
'''<summary>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<xs:element name="GästeDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:EnableTableAdapterManager="true" msprop:Generator_DataSetName="GästeDataSet" msprop:Generator_UserDSName="GästeDataSet">
|
||||
<xs:complexType>
|
||||
<xs:choice minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:element name="Gäste" msdata:CaseSensitive="False" msprop:Generator_TableClassName="GästeDataTable" msprop:Generator_TableVarName="tableGäste" msprop:Generator_RowChangedName="GästeRowChanged" msprop:Generator_TablePropName="Gäste" msprop:Generator_RowDeletingName="GästeRowDeleting" msprop:Generator_RowChangingName="GästeRowChanging" msprop:Generator_RowEvHandlerName="GästeRowChangeEventHandler" msprop:Generator_RowDeletedName="GästeRowDeleted" msprop:Generator_RowClassName="GästeRow" msprop:Generator_UserTableName="Gäste" msprop:Generator_RowEvArgName="GästeRowChangeEvent">
|
||||
<xs:element name="Gäste" msdata:CaseSensitive="False" msprop:Generator_TableClassName="GästeDataTable" msprop:Generator_TableVarName="tableGäste" msprop:Generator_TablePropName="Gäste" msprop:Generator_RowDeletingName="GästeRowDeleting" msprop:Generator_RowChangingName="GästeRowChanging" msprop:Generator_RowEvHandlerName="GästeRowChangeEventHandler" msprop:Generator_RowDeletedName="GästeRowDeleted" msprop:Generator_UserTableName="Gäste" msprop:Generator_RowChangedName="GästeRowChanged" msprop:Generator_RowEvArgName="GästeRowChangeEvent" msprop:Generator_RowClassName="GästeRow">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" msdata:ReadOnly="true" msdata:AutoIncrement="true" msdata:AutoIncrementSeed="1" msprop:Generator_ColumnVarNameInTable="columnID" msprop:Generator_ColumnPropNameInRow="ID" msprop:Generator_ColumnPropNameInTable="IDColumn" msprop:Generator_UserColumnName="ID" type="xs:int" />
|
||||
|
@ -31,8 +31,8 @@
|
|||
<xs:element name="Telefon" msprop:Generator_ColumnVarNameInTable="columnTelefon" msprop:Generator_ColumnPropNameInRow="Telefon" msprop:Generator_ColumnPropNameInTable="TelefonColumn" msprop:Generator_UserColumnName="Telefon" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="Email" msprop:Generator_ColumnVarNameInTable="columnEmail" msprop:Generator_ColumnPropNameInRow="Email" msprop:Generator_ColumnPropNameInTable="EmailColumn" msprop:Generator_UserColumnName="Email" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="Anmerkung" msprop:Generator_ColumnVarNameInTable="columnAnmerkung" msprop:Generator_ColumnPropNameInRow="Anmerkung" msprop:Generator_ColumnPropNameInTable="AnmerkungColumn" msprop:Generator_UserColumnName="Anmerkung" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="Stammgast" msprop:Generator_ColumnVarNameInTable="columnStammgast" msprop:Generator_ColumnPropNameInRow="Stammgast" msprop:Generator_ColumnPropNameInTable="StammgastColumn" msprop:Generator_UserColumnName="Stammgast" type="xs:boolean" minOccurs="0" />
|
||||
<xs:element name="Blockiert" msprop:Generator_ColumnVarNameInTable="columnBlockiert" msprop:Generator_ColumnPropNameInRow="Blockiert" msprop:Generator_ColumnPropNameInTable="BlockiertColumn" msprop:Generator_UserColumnName="Blockiert" type="xs:boolean" minOccurs="0" />
|
||||
<xs:element name="Stammgast" msprop:Generator_ColumnVarNameInTable="columnStammgast" msprop:Generator_ColumnPropNameInRow="Stammgast" msprop:Generator_ColumnPropNameInTable="StammgastColumn" msprop:Generator_UserColumnName="Stammgast" type="xs:boolean" default="false" />
|
||||
<xs:element name="Blockiert" msprop:Generator_ColumnVarNameInTable="columnBlockiert" msprop:Generator_ColumnPropNameInRow="Blockiert" msprop:Generator_ColumnPropNameInTable="BlockiertColumn" msprop:Generator_UserColumnName="Blockiert" type="xs:boolean" default="false" />
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
</autogenerated>-->
|
||||
<DiagramLayout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ex:showrelationlabel="False" ViewPortX="0" ViewPortY="92" xmlns:ex="urn:schemas-microsoft-com:xml-msdatasource-layout-extended" xmlns="urn:schemas-microsoft-com:xml-msdatasource-layout">
|
||||
<Shapes>
|
||||
<Shape ID="DesignTable:Gäste" ZOrder="1" X="143" Y="167" Height="257" Width="150" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="24" SplitterPosition="253" />
|
||||
<Shape ID="DesignTable:Gäste" ZOrder="1" X="182" Y="153" Height="257" Width="150" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="24" SplitterPosition="253" />
|
||||
</Shapes>
|
||||
<Connectors />
|
||||
</DiagramLayout>
|
|
@ -167,11 +167,13 @@ Public Class frmMain
|
|||
.cboLand.Text = Me.DataGridView1.SelectedCells(6).Value.ToString
|
||||
.txtTelefon.Text = Me.DataGridView1.SelectedCells(7).Value.ToString
|
||||
.txtEmail.Text = Me.DataGridView1.SelectedCells(8).Value.ToString
|
||||
.txtAnmerkung.Text = Me.DataGridView1.SelectedCells(9).Value.ToString
|
||||
'.chkStammgast.Checked = CBool(Me.DataGridView1.SelectedCells(10).Value)
|
||||
'.chkBlacklist.Checked = CBool(Me.DataGridView1.SelectedCells(11).Value)
|
||||
.txtAnmerkung.Text = Me.DataGridView1.SelectedCells(11).Value.ToString
|
||||
.chkStammgast.Checked = CBool(Me.DataGridView1.SelectedCells(9).Value)
|
||||
.chkBlacklist.Checked = CBool(Me.DataGridView1.SelectedCells(10).Value)
|
||||
End With
|
||||
'MsgBox(CType(Me.DataGridView1.SelectedCells(10).Value, Boolean))
|
||||
'TODO: Lookup how to edit an entry without modifying the autoincrement_value (without changing the ID)
|
||||
'i first thought on deleting and re-creating the entry, but that would have created the person with another ID number
|
||||
|
||||
oForm.ShowDialog()
|
||||
oForm.Dispose()
|
||||
|
|
Loading…
Reference in a new issue