Esempio n. 1
0
 private void RegisterButtonRegistrationWindow_Click(object sender, RoutedEventArgs e)
 {
     if (string.IsNullOrWhiteSpace(EmailTextBox.Text))
     {
         MessageBox.Show("Email is not entered!");
         EmailTextBox.Focus();
     }
     else if (!_repo.IsEmailUnique(EmailTextBox.Text))
     {
         MessageBox.Show("User with such email already exists. \nEmail should be unique!");
         return;
     }
     else if (string.IsNullOrWhiteSpace(NameTextBox.Text))
     {
         MessageBox.Show("Full name is not entered!");
         NameTextBox.Focus();
     }
     else if (string.IsNullOrWhiteSpace(PasswordTextBox.Password))
     {
         MessageBox.Show("Password is not entered");
         PasswordTextBox.Focus();
     }
     else
     {
         _repo.CreateNewUser(NameTextBox.Text, EmailTextBox.Text, PasswordTextBox.Password);
         DialogResult = true;
     }
 }