예제 #1
0
        private void viewReviewsButton_Click(object sender, EventArgs e)
        {
            ReviewsPanel reviewsPanel = new ReviewsPanel(hotel);

            this.Hide();
            reviewsPanel.Show();
        }
예제 #2
0
        private void addReviewButton_Click(object sender, EventArgs e)
        {
            if (ValidateText(reviewTextBox))
            {
                Review review = new Review
                {
                    Guest = hotel.Guests.Last(),
                    Text  = reviewTextBox.Text
                };
                hotel.AddReview(review);
                hotel.Save();

                ReviewsPanel reviewsPanel = new ReviewsPanel(hotel);
                this.Hide();
                reviewsPanel.Show();
            }
            else
            {
                reviewTextBox.Clear();
            }
        }