Beispiel #1
0
        //View the currently selected Guest
        private void ViewGuestBtn_Click(object sender, RoutedEventArgs e)
        {
            Guest       guest = GuestListBox.SelectedItem as Guest;
            GuestWindow win   = new GuestWindow();

            win.NameBox.Text     = guest.Name;
            win.AgeBox.Text      = guest.Age.ToString();
            win.PassportBox.Text = guest.PassportNum.ToString();

            win.NameBox.IsReadOnly     = true;
            win.AgeBox.IsReadOnly      = true;
            win.PassportBox.IsReadOnly = true;

            win.ShowDialog();
        }
Beispiel #2
0
        //Add guest to the current booking
        private void AddGuestBtn_Click(object sender, RoutedEventArgs e)
        {
            if (bookingInstance.GuestList.Count >= 6)
            {
                MessageBox.Show("Maximun number(6) of guests reached!");
                return;
            }

            GuestWindow win = new GuestWindow();

            win.ShowDialog();

            win.NameBox.IsReadOnly     = false;
            win.AgeBox.IsReadOnly      = false;
            win.PassportBox.IsReadOnly = false;

            //Any guest related logic is handled in the GuesWindow class
        }