private void Login_Click(object sender, RoutedEventArgs e) { if (textBoxLogin.Text == null) { MessageBox.Show("Please, enter your login"); } if (PasswordBox.Password == null) { MessageBox.Show("Please, enter your password"); } if (ifemployer == true) { var t = Employer.Sign(textBoxLogin.Text, DataBaseRepository.GetHash(PasswordBox.Password)); if (t != null) { NavigationService.Navigate(new EmployerAccountPage(repository, t)); } else { MessageBox.Show("Wrong login or password"); } } else { var t = Employee.Sign(textBoxLogin.Text, DataBaseRepository.GetHash(PasswordBox.Password)); if (t != null) { NavigationService.Navigate(new EmployeeAccountPage(repository, t)); } else { MessageBox.Show("Wrong login or password"); } } }