diff --git a/.vs/Gästeliste/v14/.suo b/.vs/Gästeliste/v14/.suo index 6cb93cc..64d4330 100644 Binary files a/.vs/Gästeliste/v14/.suo and b/.vs/Gästeliste/v14/.suo differ diff --git a/Gästeliste/GästeDataSet.Designer.vb b/Gästeliste/GästeDataSet.Designer.vb index a613b04..2836632 100644 --- a/Gästeliste/GästeDataSet.Designer.vb +++ b/Gästeliste/GästeDataSet.Designer.vb @@ -557,8 +557,10 @@ Partial Public Class GästeDataSet Me.columnVorname.AllowDBNull = false Me.columnStraße.AllowDBNull = false Me.columnPLZ.AllowDBNull = false + Me.columnPLZ.MaxLength = 15 Me.columnOrt.AllowDBNull = false Me.columnLand.AllowDBNull = false + Me.columnLand.DefaultValue = CType("D",String) Me.CaseSensitive = false End Sub diff --git a/Gästeliste/GästeDataSet.xsd b/Gästeliste/GästeDataSet.xsd index 4ca938d..a339d51 100644 --- a/Gästeliste/GästeDataSet.xsd +++ b/Gästeliste/GästeDataSet.xsd @@ -12,16 +12,22 @@ - + - + + + + + + + - + diff --git a/Gästeliste/GästeDataSet.xss b/Gästeliste/GästeDataSet.xss index 530de8c..2ebf3d7 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/Gästeliste.vbproj b/Gästeliste/Gästeliste.vbproj index e518020..61320d7 100644 --- a/Gästeliste/Gästeliste.vbproj +++ b/Gästeliste/Gästeliste.vbproj @@ -32,7 +32,7 @@ Dominic Reich 1.0.0.0 false - 7 + 8 1.0.0.%2a true true diff --git a/Gästeliste/frmMain.Designer.vb b/Gästeliste/frmMain.Designer.vb index 39272eb..ca8379a 100644 --- a/Gästeliste/frmMain.Designer.vb +++ b/Gästeliste/frmMain.Designer.vb @@ -25,17 +25,6 @@ Partial Class frmMain Me.components = New System.ComponentModel.Container() Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmMain)) Me.DataGridView1 = New System.Windows.Forms.DataGridView() - Me.mnuMain = New System.Windows.Forms.MenuStrip() - Me.HilfeToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.InfoToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.OnlineHilfeToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.ToolStripMenuItem1 = New System.Windows.Forms.ToolStripSeparator() - Me.HilfePerEmailAnfordernToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.FehlerMeldenToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.mnuContext = New System.Windows.Forms.ContextMenuStrip(Me.components) - Me.EintragLöschenToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.UpdateToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.ToolStripMenuItem2 = New System.Windows.Forms.ToolStripSeparator() Me.IDDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.NachnameDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.VornameDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() @@ -48,98 +37,42 @@ Partial Class frmMain Me.StammgastDataGridViewCheckBoxColumn = New System.Windows.Forms.DataGridViewCheckBoxColumn() Me.BlockiertDataGridViewCheckBoxColumn = New System.Windows.Forms.DataGridViewCheckBoxColumn() Me.AnmerkungDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.mnuContext = New System.Windows.Forms.ContextMenuStrip(Me.components) + Me.EintragLöschenToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.GästeBindingSource = New System.Windows.Forms.BindingSource(Me.components) Me.GästeDataSet = New Gästeliste.GästeDataSet() + Me.mnuMain = New System.Windows.Forms.MenuStrip() + Me.HilfeToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.InfoToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.OnlineHilfeToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.ToolStripMenuItem1 = New System.Windows.Forms.ToolStripSeparator() + Me.UpdateToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit() - Me.mnuMain.SuspendLayout() Me.mnuContext.SuspendLayout() CType(Me.GästeBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.GästeDataSet, System.ComponentModel.ISupportInitialize).BeginInit() + Me.mnuMain.SuspendLayout() Me.SuspendLayout() ' 'DataGridView1 ' + Me.DataGridView1.AllowUserToAddRows = False + Me.DataGridView1.AllowUserToDeleteRows = False Me.DataGridView1.AllowUserToResizeRows = False Me.DataGridView1.AutoGenerateColumns = False + Me.DataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize Me.DataGridView1.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.IDDataGridViewTextBoxColumn, Me.NachnameDataGridViewTextBoxColumn, Me.VornameDataGridViewTextBoxColumn, Me.StraßeDataGridViewTextBoxColumn, Me.PLZDataGridViewTextBoxColumn, Me.OrtDataGridViewTextBoxColumn, Me.LandDataGridViewTextBoxColumn, Me.TelefonDataGridViewTextBoxColumn, Me.EmailDataGridViewTextBoxColumn, Me.StammgastDataGridViewCheckBoxColumn, Me.BlockiertDataGridViewCheckBoxColumn, Me.AnmerkungDataGridViewTextBoxColumn}) + Me.DataGridView1.ContextMenuStrip = Me.mnuContext Me.DataGridView1.DataSource = Me.GästeBindingSource Me.DataGridView1.Dock = System.Windows.Forms.DockStyle.Fill Me.DataGridView1.Location = New System.Drawing.Point(0, 24) Me.DataGridView1.Name = "DataGridView1" Me.DataGridView1.RowHeadersVisible = False - Me.DataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect - Me.DataGridView1.Size = New System.Drawing.Size(818, 483) + Me.DataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect + Me.DataGridView1.Size = New System.Drawing.Size(867, 483) Me.DataGridView1.TabIndex = 4 ' - 'mnuMain - ' - Me.mnuMain.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.HilfeToolStripMenuItem}) - Me.mnuMain.Location = New System.Drawing.Point(0, 0) - Me.mnuMain.Name = "mnuMain" - Me.mnuMain.Size = New System.Drawing.Size(818, 24) - Me.mnuMain.TabIndex = 5 - Me.mnuMain.Text = "MenuStrip1" - ' - 'HilfeToolStripMenuItem - ' - Me.HilfeToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.InfoToolStripMenuItem, Me.OnlineHilfeToolStripMenuItem, Me.ToolStripMenuItem1, Me.UpdateToolStripMenuItem, Me.ToolStripMenuItem2, Me.HilfePerEmailAnfordernToolStripMenuItem, Me.FehlerMeldenToolStripMenuItem}) - Me.HilfeToolStripMenuItem.Name = "HilfeToolStripMenuItem" - Me.HilfeToolStripMenuItem.Size = New System.Drawing.Size(44, 20) - Me.HilfeToolStripMenuItem.Text = "Hilfe" - ' - 'InfoToolStripMenuItem - ' - Me.InfoToolStripMenuItem.Name = "InfoToolStripMenuItem" - Me.InfoToolStripMenuItem.Size = New System.Drawing.Size(206, 22) - Me.InfoToolStripMenuItem.Text = "Info" - ' - 'OnlineHilfeToolStripMenuItem - ' - Me.OnlineHilfeToolStripMenuItem.Name = "OnlineHilfeToolStripMenuItem" - Me.OnlineHilfeToolStripMenuItem.Size = New System.Drawing.Size(206, 22) - Me.OnlineHilfeToolStripMenuItem.Text = "Online-Hilfe" - ' - 'ToolStripMenuItem1 - ' - Me.ToolStripMenuItem1.Name = "ToolStripMenuItem1" - Me.ToolStripMenuItem1.Size = New System.Drawing.Size(203, 6) - ' - 'HilfePerEmailAnfordernToolStripMenuItem - ' - Me.HilfePerEmailAnfordernToolStripMenuItem.Name = "HilfePerEmailAnfordernToolStripMenuItem" - Me.HilfePerEmailAnfordernToolStripMenuItem.Size = New System.Drawing.Size(206, 22) - Me.HilfePerEmailAnfordernToolStripMenuItem.Text = "Hilfe per Email anfordern" - ' - 'FehlerMeldenToolStripMenuItem - ' - Me.FehlerMeldenToolStripMenuItem.Name = "FehlerMeldenToolStripMenuItem" - Me.FehlerMeldenToolStripMenuItem.Size = New System.Drawing.Size(206, 22) - Me.FehlerMeldenToolStripMenuItem.Text = "Fehler melden" - ' - 'mnuContext - ' - Me.mnuContext.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.EintragLöschenToolStripMenuItem}) - Me.mnuContext.Name = "mnuContext" - Me.mnuContext.Size = New System.Drawing.Size(156, 26) - ' - 'EintragLöschenToolStripMenuItem - ' - Me.EintragLöschenToolStripMenuItem.Name = "EintragLöschenToolStripMenuItem" - Me.EintragLöschenToolStripMenuItem.Size = New System.Drawing.Size(155, 22) - Me.EintragLöschenToolStripMenuItem.Text = "Eintrag löschen" - ' - 'UpdateToolStripMenuItem - ' - Me.UpdateToolStripMenuItem.Name = "UpdateToolStripMenuItem" - Me.UpdateToolStripMenuItem.Size = New System.Drawing.Size(206, 22) - Me.UpdateToolStripMenuItem.Text = "Update nachholen" - ' - 'ToolStripMenuItem2 - ' - Me.ToolStripMenuItem2.Name = "ToolStripMenuItem2" - Me.ToolStripMenuItem2.Size = New System.Drawing.Size(203, 6) - ' 'IDDataGridViewTextBoxColumn ' Me.IDDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells @@ -234,7 +167,19 @@ Partial Class frmMain Me.AnmerkungDataGridViewTextBoxColumn.DataPropertyName = "Anmerkung" Me.AnmerkungDataGridViewTextBoxColumn.HeaderText = "Anmerkung" Me.AnmerkungDataGridViewTextBoxColumn.Name = "AnmerkungDataGridViewTextBoxColumn" - Me.AnmerkungDataGridViewTextBoxColumn.Width = 200 + Me.AnmerkungDataGridViewTextBoxColumn.Width = 86 + ' + 'mnuContext + ' + Me.mnuContext.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.EintragLöschenToolStripMenuItem}) + Me.mnuContext.Name = "mnuContext" + Me.mnuContext.Size = New System.Drawing.Size(156, 26) + ' + 'EintragLöschenToolStripMenuItem + ' + Me.EintragLöschenToolStripMenuItem.Name = "EintragLöschenToolStripMenuItem" + Me.EintragLöschenToolStripMenuItem.Size = New System.Drawing.Size(155, 22) + Me.EintragLöschenToolStripMenuItem.Text = "Eintrag löschen" ' 'GästeBindingSource ' @@ -246,11 +191,50 @@ Partial Class frmMain Me.GästeDataSet.DataSetName = "GästeDataSet" Me.GästeDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema ' + 'mnuMain + ' + Me.mnuMain.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.HilfeToolStripMenuItem}) + Me.mnuMain.Location = New System.Drawing.Point(0, 0) + Me.mnuMain.Name = "mnuMain" + Me.mnuMain.Size = New System.Drawing.Size(867, 24) + Me.mnuMain.TabIndex = 5 + Me.mnuMain.Text = "MenuStrip1" + ' + 'HilfeToolStripMenuItem + ' + Me.HilfeToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.InfoToolStripMenuItem, Me.OnlineHilfeToolStripMenuItem, Me.ToolStripMenuItem1, Me.UpdateToolStripMenuItem}) + Me.HilfeToolStripMenuItem.Name = "HilfeToolStripMenuItem" + Me.HilfeToolStripMenuItem.Size = New System.Drawing.Size(44, 20) + Me.HilfeToolStripMenuItem.Text = "Hilfe" + ' + 'InfoToolStripMenuItem + ' + Me.InfoToolStripMenuItem.Name = "InfoToolStripMenuItem" + Me.InfoToolStripMenuItem.Size = New System.Drawing.Size(152, 22) + Me.InfoToolStripMenuItem.Text = "Info" + ' + 'OnlineHilfeToolStripMenuItem + ' + Me.OnlineHilfeToolStripMenuItem.Name = "OnlineHilfeToolStripMenuItem" + Me.OnlineHilfeToolStripMenuItem.Size = New System.Drawing.Size(152, 22) + Me.OnlineHilfeToolStripMenuItem.Text = "Online-Hilfe" + ' + 'ToolStripMenuItem1 + ' + Me.ToolStripMenuItem1.Name = "ToolStripMenuItem1" + Me.ToolStripMenuItem1.Size = New System.Drawing.Size(149, 6) + ' + 'UpdateToolStripMenuItem + ' + Me.UpdateToolStripMenuItem.Name = "UpdateToolStripMenuItem" + Me.UpdateToolStripMenuItem.Size = New System.Drawing.Size(152, 22) + Me.UpdateToolStripMenuItem.Text = "Update" + ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(818, 507) + Me.ClientSize = New System.Drawing.Size(867, 507) Me.Controls.Add(Me.DataGridView1) Me.Controls.Add(Me.mnuMain) Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) @@ -258,11 +242,11 @@ Partial Class frmMain Me.Name = "frmMain" Me.Text = "Gästeliste" CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit() - Me.mnuMain.ResumeLayout(False) - Me.mnuMain.PerformLayout() Me.mnuContext.ResumeLayout(False) CType(Me.GästeBindingSource, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.GästeDataSet, System.ComponentModel.ISupportInitialize).EndInit() + Me.mnuMain.ResumeLayout(False) + Me.mnuMain.PerformLayout() Me.ResumeLayout(False) Me.PerformLayout() @@ -286,12 +270,9 @@ Partial Class frmMain Friend WithEvents AnmerkungDataGridViewTextBoxColumn As DataGridViewTextBoxColumn Friend WithEvents HilfeToolStripMenuItem As ToolStripMenuItem Friend WithEvents InfoToolStripMenuItem As ToolStripMenuItem - Friend WithEvents HilfePerEmailAnfordernToolStripMenuItem As ToolStripMenuItem Friend WithEvents ToolStripMenuItem1 As ToolStripSeparator - Friend WithEvents FehlerMeldenToolStripMenuItem As ToolStripMenuItem Friend WithEvents mnuContext As ContextMenuStrip Friend WithEvents EintragLöschenToolStripMenuItem As ToolStripMenuItem Friend WithEvents OnlineHilfeToolStripMenuItem As ToolStripMenuItem Friend WithEvents UpdateToolStripMenuItem As ToolStripMenuItem - Friend WithEvents ToolStripMenuItem2 As ToolStripSeparator End Class diff --git a/Gästeliste/frmMain.resx b/Gästeliste/frmMain.resx index 7d17b6f..180a11f 100644 --- a/Gästeliste/frmMain.resx +++ b/Gästeliste/frmMain.resx @@ -117,6 +117,9 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 407, 17 + 142, 17 @@ -126,9 +129,6 @@ 303, 17 - - 407, 17 - diff --git a/Gästeliste/frmMain.vb b/Gästeliste/frmMain.vb index db3f807..7d74ef4 100644 --- a/Gästeliste/frmMain.vb +++ b/Gästeliste/frmMain.vb @@ -4,10 +4,13 @@ Imports System.Deployment.Application Public Class frmMain Private _dataPath As String = System.IO.Path.Combine(My.Computer.FileSystem.SpecialDirectories.MyDocuments, "Gästeliste.xml") - Private _rowIndex As Integer = 0 + 'I should not need this for now - we do not work with mouse pointer rows index for selection but we select them with left-click. + ' and with ctrl select (left click, multi-select!) + 'Private _rowIndex As Integer = 0 Private Sub LoadWindowPosition() 'http://christ-offer.blogspot.co.at/2012/02/vbnet-remember-application-window-size.html + 'TODO: Change this to get loaded from registry. I'm not a huge fan of my.settings ;) Dim ptLocation As System.Drawing.Point = My.Settings.WindowLocation If (ptLocation.X = -1) And (ptLocation.Y = -1) Then @@ -48,6 +51,7 @@ Public Class frmMain LoadWindowPosition() ' Setting colors of grids to some fancy ones :) + 'TODO: Save some colors in registry. Me.DataGridView1.RowsDefaultCellStyle.BackColor = Color.Azure Me.DataGridView1.AlternatingRowsDefaultCellStyle.BackColor = Color.Beige End Sub @@ -59,32 +63,22 @@ Public Class frmMain oForm = Nothing End Sub - Private Sub HilfePerEmailAnfordernToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles HilfePerEmailAnfordernToolStripMenuItem.Click - If MsgBox("Dies startet dein Emailprogramm, um mir eine Email zu schreiben", vbOKCancel) = vbOK Then - Process.Start("mailto:Dominic%20Reich%20?subject=[FEWO%20Gästeliste]%20Bitte%20um%20Hilfe&body=Hallo%20Dominic,%0Aich%20brauche%20Hilfe%20bei%20%0A%0A--%20%0AEmail%20über%20das%20Programm%20'Gästeliste'%20erstellt.") - End If - End Sub - - Private Sub FehlerMeldenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles FehlerMeldenToolStripMenuItem.Click - If MsgBox("Dies öffnet deinen Browser und führt dich zur Github-Issues Seite." + Chr(13) + "Ein Github-Konto ist zwingend erforderlich!", vbOKCancel) = vbOK Then - Process.Start("https://github.com/freefallcid/Gaesteliste/issues") - End If - End Sub - - Private Sub DataGridView1_CellMouseUp(sender As Object, e As DataGridViewCellMouseEventArgs) Handles DataGridView1.CellMouseUp - If e.Button = MouseButtons.Right Then - Me.DataGridView1.Rows(e.RowIndex).Selected = True - Me._rowIndex = e.RowIndex - Me.DataGridView1.CurrentCell = Me.DataGridView1.Rows(e.RowIndex).Cells(1) - Me.mnuContext.Show(Me.DataGridView1, e.Location) - mnuContext.Show(Cursor.Position) - End If - End Sub + 'We should not have to use this any more. but for backup we left this here... + 'Private Sub DataGridView1_CellMouseUp(sender As Object, e As DataGridViewCellMouseEventArgs) Handles DataGridView1.CellMouseUp + ' If e.Button = MouseButtons.Right Then + ' Me.DataGridView1.Rows(e.RowIndex).Selected = True + ' Me._rowIndex = e.RowIndex + ' Me.DataGridView1.CurrentCell = Me.DataGridView1.Rows(e.RowIndex).Cells(1) + ' Me.mnuContext.Show(Me.DataGridView1, e.Location) + ' mnuContext.Show(Cursor.Position) + ' End If + 'End Sub Private Sub EintragLöschenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles EintragLöschenToolStripMenuItem.Click - If Not Me.DataGridView1.Rows(Me._rowIndex).IsNewRow Then - Me.DataGridView1.Rows.RemoveAt(Me._rowIndex) - End If + 'TODO: Einen Button zum Hinzufügen, eine eigene Form zum Hinzufügen bzw bearbeiten. + For Each Row As DataGridViewRow In DataGridView1.SelectedRows + Me.DataGridView1.Rows.RemoveAt(Row.Index) + Next End Sub Private Sub OnlineHilfeToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles OnlineHilfeToolStripMenuItem.Click