|
|
|
|
Imports System.Windows.Forms
|
|
|
|
|
|
|
|
|
|
Public Class frmPerson
|
|
|
|
|
|
|
|
|
|
Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click
|
|
|
|
|
Me.DialogResult = System.Windows.Forms.DialogResult.OK
|
|
|
|
|
Me.Close()
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel_Button.Click
|
|
|
|
|
Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
|
|
|
|
|
Me.Close()
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
Private Sub frmPerson_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
|
|
|
|
If Me.Tag = "add" Then
|
|
|
|
|
Me.Text = "Gast hinzufügen"
|
|
|
|
|
ElseIf Me.Tag = "edit" Then
|
|
|
|
|
Me.Text = "Gast bearbeiten"
|
|
|
|
|
End If
|
|
|
|
|
' INFO: Das scheint ja nicht wirklich zu funktionieren (fuck DataSet)
|
|
|
|
|
'Dim dt As DataTable = GästeDataSet.Tables("Länder")
|
|
|
|
|
'Dim dr As DataRow = dt.NewRow()
|
|
|
|
|
|
|
|
|
|
'With dr
|
|
|
|
|
'.Item("Land") = 'unfinished
|
|
|
|
|
'End With
|
|
|
|
|
'cboLand.Items.Add("Neues Land eintragen")
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
Private Sub cboLand_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboLand.SelectedIndexChanged
|
|
|
|
|
If cboLand.Text = "Neues Land eintragen" Then
|
|
|
|
|
Dim NeuesLand As String = InputBox("Name des neuen Landes:", "Neues Land eintragen")
|
|
|
|
|
If NeuesLand <> "" Then
|
|
|
|
|
' eintragen
|
|
|
|
|
If Not cboLand.Items.Contains(NeuesLand) Then
|
|
|
|
|
Dim Anzahl As Integer = cboLand.Items.Count
|
|
|
|
|
cboLand.Items.Insert(Anzahl - 1, NeuesLand.ToString)
|
|
|
|
|
cboLand.Text = NeuesLand.ToString
|
|
|
|
|
'TODO: Das Land auch in die Registry schreiben.
|
|
|
|
|
' viele Länder in einem String (REG_SZ)
|
|
|
|
|
' oder wirklich nachlesen wie man den Schrott in das DataSet schiebt....
|
|
|
|
|
Else
|
|
|
|
|
MsgBox("Tut mir leid, das Land ist doch schon in der Liste!")
|
|
|
|
|
Exit Sub
|
|
|
|
|
End If
|
|
|
|
|
Else
|
|
|
|
|
' abbruch
|
|
|
|
|
Exit Sub
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
End Sub
|
|
|
|
|
End Class
|