Esempio n. 1
0
        private void ButtonRegistration_Click(object sender, RoutedEventArgs e)
        {
            // Проверка заполненности боксов и регистрация пользователя
            if (string.IsNullOrWhiteSpace(textBox_FullName.Text))
            {
                MessageBox.Show("Введите имя");
                textBox_FullName.Focus();
                return;
            }
            if (string.IsNullOrWhiteSpace(textBox_Email.Text))
            {
                MessageBox.Show("Введите Email");
                textBox_Email.Focus();
                return;
            }
            if (string.IsNullOrWhiteSpace(passwordBox_Password.Password.ToString()))
            {
                MessageBox.Show("Введите пароль");
                passwordBox_Password.Focus();
                return;
            }
            if (string.IsNullOrWhiteSpace(textBox_Login.Text))
            {
                MessageBox.Show("Введите логин");
                textBox_Login.Focus();
                return;
            }
            if (!_repo.Registration(textBox_FullName.Text, textBox_Email.Text, textBox_Login.Text, passwordBox_Password.Password.ToString()))
            {
                MessageBox.Show("Данный Email уже зарегистрирован");
            }
            AppWindow app = new AppWindow();

            app.ShowDialog();
        }
Esempio n. 2
0
 private void ButtonLogIn_Click(object sender, RoutedEventArgs e)
 {
     if (string.IsNullOrWhiteSpace(textBox_Login.Text))
     {
         MessageBox.Show("Введите логин");
         textBox_Login.Focus();
         return;
     }
     if (string.IsNullOrWhiteSpace(passwordBox_Password.Password.ToString()))
     {
         MessageBox.Show("Введите пароль");
         passwordBox_Password.Focus();
         return;
     }
     // Авторизация
     if (_repo.Authorization(textBox_Login.Text, passwordBox_Password.Password.ToString()))
     {
         AppWindow app = new AppWindow();
         app.Show();
     }
     else
     {
         MessageBox.Show("Неверный Email или пароль");
     }
 }