/*
         * Refreshes all booking detail fields displayed in the window
         * according to current booking state.
         */
        private void refreshBookDetailDisplay()
        {
            if (mFacade.IsABookingLoaded())
            {
                // update field contents:
                DateTime start;
                DateTime end;
                mFacade.GetCurrentBookDates(out start, out end);
                lblArrivalValue.Content   = start.ToString().Substring(0, 10);
                lblDepartureValue.Content = end.ToString().Substring(0, 10);
                lblCustNameValue.Content  = mFacade.GetCurrentCustName();
                lstGuests.Items.Clear();

                foreach (String g in mFacade.GetGuestNames())
                {
                    lstGuests.Items.Add(g);
                }

                // make labels visible:
                lblArrivalValue.Visibility   = Visibility.Visible;
                lblDepartureValue.Visibility = Visibility.Visible;
                lblCustNameValue.Visibility  = Visibility.Visible;
            }
            else
            {
                refreshDisplay();
            }
        }
        // METHODS RELATED TO GUESTS:

        /*
         * Refreshes the guests fields displayed in the window.
         */
        private void refreshGuestsDisplay()
        {
            if (mFacade.IsABookingLoaded())
            {
                lblGuest.Visibility  = Visibility.Visible;
                lstGuests.Visibility = Visibility.Visible;

                lstGuests.ItemsSource = mFacade.GetGuestNames();
            }
        }
コード例 #3
0
        /*
         * Refreshes the guests fields displayed in the window.
         */
        private void refreshGuestsDisplay()
        {
            // update listbox content:
            foreach (String g in mFacade.GetGuestNames())
            {
                lstGuests.Items.Add(g);
            }

            // make label & list box visible:
            lblGuests.Visibility = Visibility.Visible;
            lstGuests.Visibility = Visibility.Visible;
        }