private void LogInButton_Click(object sender, RoutedEventArgs e) { var loginWindow = new LogInWindow(); loginWindow.Show(); this.Close(); }
private void ButtonAdmin_Click(object sender, RoutedEventArgs e) { var logInWindow = new LogInWindow(); logInWindow.DoNotHaveAnAccount.Visibility = Visibility.Hidden; logInWindow.Show(); Close(); }
private void ButtonRegister_Click(object sender, RoutedEventArgs e) { if (string.IsNullOrWhiteSpace(textBoxLogin.Text)) { MessageBox.Show("Password cannot be empty", "Error"); textBoxLogin.Focus(); return; } else if (string.IsNullOrWhiteSpace(textBoxName.Text)) { MessageBox.Show("Name cannot be empty", "Error"); textBoxName.Focus(); return; } else if (string.IsNullOrWhiteSpace(textBoxSurname.Text)) { MessageBox.Show("Surname cannot be empty", "Error"); textBoxSurname.Focus(); return; } else if (string.IsNullOrWhiteSpace(textBoxPassword.Password)) { MessageBox.Show("Password cannot be empty", "Error"); textBoxPassword.Focus(); return; } Guest guest; Hotel hotel; _repo.Authorize(textBoxLogin.Text, Hash.GetHash(textBoxPassword.Password), out guest, out hotel); if (guest != null) { MessageBox.Show("This user has been already created", "Error"); return; } if (Guest == null) { Guest = new Guest { Name = textBoxName.Text, Surname = textBoxSurname.Text, Email = textBoxLogin.Text, Password = textBoxPassword.Password, }; _repo.RegisterGuest(Guest); LogInWindow logInWindow = new LogInWindow(); logInWindow.Show(); Close(); } }
private void ButtonLogIn_Click(object sender, RoutedEventArgs e) { var loginWindow = new LogInWindow(); loginWindow.Show(); }