Ejemplo n.º 1
0
        private void Email_Click(object sender, RoutedEventArgs e)
        {
            Regex sc = new Regex("@");

            if (String.IsNullOrEmpty(TextBox1.Text))
            {
                this.Snack.IsActive        = false;
                this.Snack.Message.Content = "Insert a valid email!";
                this.Snack.IsActive        = true;
            }
            else if (!sc.IsMatch(TextBox1.Text))
            {
                this.Snack.IsActive        = false;
                this.Snack.Message.Content = "Insert a valid email!";
                this.Snack.IsActive        = true;
            }
            else
            {
                AX_Login login = new AX_Login();
                login.Snack.IsActive        = false;
                login.Snack.Message.Content = "Email sent successfully!";
                login.Snack.IsActive        = true;
                this.NavigationService.Navigate(login);
            }
        }
Ejemplo n.º 2
0
        private void Create_Click(object sender, RoutedEventArgs e)
        {
            Insert_user.username = TextBox2.Text;
            Insert_user.email = TextBox1.Text;
            Insert_user.password = PasswordBox1.Password.ToString();
            Regex sc = new Regex("@");

            if (String.IsNullOrEmpty(TextBox1.Text))
            {
                this.Snack.IsActive = false;
                this.Snack.Message.Content = "Insert a valid email!";
                this.Snack.IsActive = true;
            }
            else if (String.IsNullOrEmpty(TextBox2.Text))
            {
                this.Snack.IsActive = false;
                this.Snack.Message.Content = "Insert a valid username!";
                this.Snack.IsActive = true;
            }
            else if (String.IsNullOrEmpty(PasswordBox1.Password))
            {
                this.Snack.IsActive = false;
                this.Snack.Message.Content = "Insert a valid password!";
                this.Snack.IsActive = true;
            }
            else if (String.IsNullOrEmpty(PasswordBox2.Password))
            {
                this.Snack.IsActive = false;
                this.Snack.Message.Content = "Confirm password!";
                this.Snack.IsActive = true;
            }
            else if (PasswordBox1.Password.ToString() != PasswordBox2.Password.ToString())
            {
                this.Snack.IsActive = false;
                this.Snack.Message.Content = "Password must be equal!";
                this.Snack.IsActive = true;
            }
            else if (!sc.IsMatch(TextBox1.Text))
            {
                this.Snack.IsActive = false;
                this.Snack.Message.Content = "Insert a valid email!";
                this.Snack.IsActive = true;
            }
            else
            {
                Local_db.add_db(Insert_user.username, Insert_user.password, Insert_user.email);
                AX_Login login = new AX_Login();
                login.Snack.IsActive = false;
                login.Snack.Message.Content = "Account Created Successfully!";
                login.Snack.IsActive = true;
                this.NavigationService.Navigate(login);
            }
        }
Ejemplo n.º 3
0
        private void Logout_Click(object e, RoutedEventArgs sender)
        {
            AX_Login login = new AX_Login();

            this.NavigationService.Navigate(login);
        }
Ejemplo n.º 4
0
        private void Cancel_Click(object sender, RoutedEventArgs e)
        {
            AX_Login login = new AX_Login();

            this.NavigationService.Navigate(login);
        }