private void btnShowGuest_Click(object sender, EventArgs e) { bool found = bbc.GetGuestByPassPortNo(txtPasnr.Text); if (found) { txtPasnr.Text = bbc.g.PassPortNo; txtTlf.Text = bbc.g.PhoneNo.ToString(); txtFname.Text = bbc.g.FName; txtLname.Text = bbc.g.LName; txtKøn.Text = bbc.g.Gender.ToString(); txtAdresse.Text = bbc.g.Address; } else { MessageBox.Show("Gæst blev ikke fundet"); foreach (Control c in this.Controls) { if (c.GetType() == typeof(TextBox)) { c.Text = ""; } } } }
public void GetGuestByPassPortno() { Console.WriteLine("Indlæs og udfør GetGuestByPassPortNo-metode"); bbc.GetGuestByPassPortNo("P78"); }