private void LogInClick(object sender, RoutedEventArgs e)
        {
            MainWindow main = new MainWindow();

            main.Show();
            var thisWindow = SignUpWindow.GetWindow(this);

            thisWindow.Close();
        }
Beispiel #2
0
        private void SignUpClick(object sender, RoutedEventArgs e)
        {
            SignUpWindow Click = new SignUpWindow();

            Click.Show();
            var myWindow = MainWindow.GetWindow(this);

            myWindow.Close();
        }
        private void ButtonSignUpClick(object sender, RoutedEventArgs e)
        {
            Regex regexPass  = new Regex("(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])[0-9a-zA-Z]{6,}");
            Regex regexEmail = new Regex("/@/");

            //if (regexPass.IsMatch(TextBoxPasswordReg.Password))
            //{
            //    LabelAnswer.Content = "Лёгкий пароль, Пример:Fg78Td62";
            //}

            if (regexEmail.IsMatch(TextBoxEmailReg.Text))
            {
                LabelAnswer.Content = "Не паравильно введена почта";
            }

            else if (TextBoxPasswordReg.Password != TextBoxConfirmPassword.Password)
            {
                LabelAnswer.Content = "Повторный пароль не совпадает";
            }

            else if (TextBoxPasswordReg.Password == TextBoxConfirmPassword.Password)
            {
                User user = new User();
                user.Surname    = TextBoxSurnameReg.Text;
                user.Name       = TextBoxNameReg.Text;
                user.Patronumic = TextBoxPatronumicReg.Text;
                user.Telephone  = TextBoxPhoneReg.Text;
                user.Login      = TextBoxLiginReg.Text;
                user.Password   = TextBoxPasswordReg.Password;
                user.Email      = TextBoxEmailReg.Text;
                user.TotalID    = 3;
                dataEntities.User.Add(user);
                dataEntities.SaveChanges();


                WindowUser windowUser = new WindowUser();
                windowUser.Show();
                var ThisWindow = SignUpWindow.GetWindow(this);
                ThisWindow.Close();
            }
        }