Example #1
0
        private void ExitToHotelButton_Click(object sender, RoutedEventArgs e)
        {
            var adminhotelWindow = new AdminHotelWindow(Hotel);

            adminhotelWindow.Show();
            this.Close();
        }
Example #2
0
        private void ButtonLogin_Click(object sender, RoutedEventArgs e)
        {
            Hotel hotel = new Hotel();
            Guest guest = new Guest();

            if (string.IsNullOrWhiteSpace(textBoxEmail.Text))
            {
                MessageBox.Show("Email cannot be empty", "Error");
                textBoxEmail.Focus();
                return;
            }

            else if (string.IsNullOrWhiteSpace(passwordBoxPassword.Password))
            {
                MessageBox.Show("Password cannot be empty", "Error");
                passwordBoxPassword.Focus();
                return;
            }

            else if (guest != null)
            {
                ///////////////////////открытие профиля гостя
                var searchWindow = new SearchWindow(guest);
                searchWindow.Show();
                Close();
            }
            else if (hotel != null)
            {
                ///////////////////////открытие профиля отеля
                var adminHotelWindow = new AdminHotelWindow(hotel);
                adminHotelWindow.Show();
                Close();
            }

            else if ((hotel == null) && (guest == null))
            {
                MessageBox.Show("Incorrect login/password");
            }
            _repo.Authorize(textBoxEmail.Text, passwordBoxPassword.Password, out guest, out hotel);
        }