예제 #1
0
        /// <summary>
        /// Alisa Roehr
        /// Created: 2019/02/01
        ///
        /// for creating a new guest.
        /// </summary>
        /// <remarks>
        ///
        /// </remarks>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAddGuest_Click(object sender, RoutedEventArgs e)
        {
            var detail = new frmAddEditGuest();

            detail.ShowDialog();
            _guests = _guestManager.ReadAllGuests();
            dgGuests.ItemsSource = _guests;
        }
예제 #2
0
        private void BtnViewGuestDetails_Click(object sender, RoutedEventArgs e)
        {
            frmAddEditGuest guestDetail = new frmAddEditGuest(_guest);
            var             formResult  = guestDetail.ShowDialog();

            if (formResult == true)
            {
                // If the guest form was edited, refresh the guest.
                _guest = _guestManager.ReadGuestByGuestID(_guest.GuestID);
                populateGuestTextBoxes();
            }
        }
예제 #3
0
 /// <summary>
 /// Alisa Roehr
 /// Created: 2019/02/01
 ///
 /// for loading the guest details
 /// </summary>
 /// <remarks>
 ///
 /// </remarks>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void dgGuests_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     try
     {
         if (dgGuests.SelectedItem != null && ((Guest)dgGuests.SelectedItem).Active != false)
         {
             var selectedGuest = (Guest)dgGuests.SelectedItem;
             var detail        = new frmAddEditGuest(selectedGuest);
             var result        = detail.ShowDialog();
             _guests = _guestManager.ReadAllGuests();
             dgGuests.ItemsSource = _guests;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Viewing Guest Failed!");
     }
 }
예제 #4
0
        /// <summary>
        /// James Heim
        /// Created 2019-04-26
        ///
        /// View the Guest Detail (if exists) for the selected ViewModel.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnViewGuest_Click(object sender, RoutedEventArgs e)
        {
            if (_selectedItem != null && _selectedItem.GuestID != null)
            {
                Guest guest = null;

                try
                {
                    guest = _guestManager.ReadGuestByGuestID((int)_selectedItem.GuestID);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }

                if (guest != null)
                {
                    frmAddEditGuest window = new frmAddEditGuest(guest);
                    window.ShowDialog();
                }
            }
        }