예제 #1
0
        private void button_Click(object sender, RoutedEventArgs e)
        {
            Registr reg = new Registr
            {
                Log             = Log.Text,
                FullName        = Nam.Text,
                NumberPassport  = Passp.Text,
                Password        = pass1.Password,
                PasswordConfirm = pass2.Password
            };

            db re = new db();

            try
            {
                if (Validate.Valid(reg))
                {
                    SaltedHash salt = new SaltedHash(reg.Password);

                    string hash = salt.Hash;
                    string sal  = salt.Salt;

                    if (re.Vald(reg.Log))
                    {
                        re.Reg(reg.Log, reg.FullName, sal, reg.NumberPassport, hash);
                        Sign_in ni = new Sign_in();
                        NavigationService.Navigate(ni);
                    }
                    else
                    {
                        MessageBox.Show("Пользователь с таким логином существует");
                    }
                }
            }
            catch (Exception)
            {
                MessageBox.Show(ToString());
            }
        }
예제 #2
0
        private void buttonClick(object sender, RoutedEventArgs e)
        {
            Sign_in login = new Sign_in();

            NavigationService.Navigate(login);
        }