From 577829e294ffe52e7de86cdca725693737775cb9 Mon Sep 17 00:00:00 2001 From: Dominic Reich Date: Sun, 20 Mar 2016 00:13:40 +0100 Subject: [PATCH] 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. --- .vs/Gästeliste/v14/.suo | Bin 52736 -> 52736 bytes Gästeliste/GästeDataSet.Designer.vb | 40 ++++---------------------- Gästeliste/GästeDataSet.xsd | 6 ++-- Gästeliste/GästeDataSet.xss | 2 +- Gästeliste/frmMain.vb | 8 ++++-- 5 files changed, 15 insertions(+), 41 deletions(-) diff --git a/.vs/Gästeliste/v14/.suo b/.vs/Gästeliste/v14/.suo index c5b70e1b768f12c4879cd35ba95e5aa9122c4395..6b954ff78580d96ff657405cc14bc7b8025b9782 100644 GIT binary patch delta 1972 zcmchYe{54#6vy9veJySGt83X0Mn}t-VPLnlTSv#}vUcq@$7Z{Z3DXd>;)WO}4)#Xo z*pCMqAO>aaL1V&Vq{T4zhitos$O2izP?R8w@`w0qqG%L0FL1DozL90Mih!U9tfAYFOn_j5J0i0IW zrnu2z+f**tDzvCj2WFK<#U|=8ur=WG!b=8sb|(&=Lb{OMNH@}h^dhkw1T|(53>t8# z4+|$T4j-%U6WAnV$Jr~cV&oI#Q{*$`bL0zT68RFjhJ1y5ja)~*LB2(PK)yr1M{WQy z=%6*u9B4}qCb|VyQMhO|k$&jN=p%>VW?~)c!F4hL}=g<*gW`$Q^Rg8AV zkI<3*k-$2D4M9w35VB&+nPv`Vl5GFyanh$1`6ysG3uYJhLg$iaf!CHRSs_>lMm670 zJM$TDz{oiGSL4knM)3iW{CvE(gCU|o+82Gb8s%zOs9)cq~5K} z#>K2Y^M`^Ctw%-JL0R+8KTg{q#7<4c%wdwb9;a#$*1oJf3@`fZ4fBChm8RUZFau4N z!z$L6eTYQoR-PyGX~I5{vo^j$XYN@q16RHT6RY-syJT3=h~dI`m|Z=q@SwYkr?aKi zm}r>=#Im~RsbhIjX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ästeDataSet.Designer.vb b/Gästeliste/GästeDataSet.Designer.vb index 407749c..1a58ccb 100644 --- a/Gästeliste/GästeDataSet.Designer.vb +++ b/Gästeliste/GästeDataSet.Designer.vb @@ -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 - - _ - Public Function IsStammgastNull() As Boolean - Return Me.IsNull(Me.tableGäste.StammgastColumn) - End Function - - _ - Public Sub SetStammgastNull() - Me(Me.tableGäste.StammgastColumn) = Global.System.Convert.DBNull - End Sub - - _ - Public Function IsBlockiertNull() As Boolean - Return Me.IsNull(Me.tableGäste.BlockiertColumn) - End Function - - _ - Public Sub SetBlockiertNull() - Me(Me.tableGäste.BlockiertColumn) = Global.System.Convert.DBNull - End Sub End Class ''' diff --git a/Gästeliste/GästeDataSet.xsd b/Gästeliste/GästeDataSet.xsd index 6e1c31a..a6db2d3 100644 --- a/Gästeliste/GästeDataSet.xsd +++ b/Gästeliste/GästeDataSet.xsd @@ -12,7 +12,7 @@ - + @@ -31,8 +31,8 @@ - - + + diff --git a/Gästeliste/GästeDataSet.xss b/Gästeliste/GästeDataSet.xss index 2ebf3d7..9cfe2c1 100644 --- a/Gästeliste/GästeDataSet.xss +++ b/Gästeliste/GästeDataSet.xss @@ -6,7 +6,7 @@ --> - + \ No newline at end of file diff --git a/Gästeliste/frmMain.vb b/Gästeliste/frmMain.vb index 1e13dbb..680e446 100644 --- a/Gästeliste/frmMain.vb +++ b/Gästeliste/frmMain.vb @@ -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()