Example #1
0
 private void _regbutton_Click(object sender, RoutedEventArgs e)
 {
     if (_password.Password == _password1.Password && _password.Password.Length >= 8)
     {
         Avtorization window = new Avtorization();
         this.Close();
         window.Show();
         context.Registration.Add(new Registration
         {
             name      = _name.Text,
             sname     = _sname.Text,
             login     = _login.Text,
             groupname = _group.Text,
             password  = _password.Password
         });
         context.SaveChanges();
         MessageBox.Show("Пользователь создан");
     }
     else if (_password.Password == _password1.Password && _password.Password.Length < 8)
     {
         MessageBox.Show("Длинна пароля не соответсвует минимальной");
         _password.Clear();
         _password1.Clear();
     }
     else
     {
         MessageBox.Show("Пароли не совпадают");
         _password.Clear();
         _password1.Clear();
     }
 }
        private void _back_Click(object sender, RoutedEventArgs e)
        {
            Avtorization avt = new Avtorization();

            this.Close();
            avt.Show();
        }