Ejemplo n.º 1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Window LoginWindow = new LoginWindow();

            LoginWindow.Show();
            this.Close();
        }
Ejemplo n.º 2
0
        private void ButtonPopUpLogout_Click(object sender, RoutedEventArgs e)
        {
            LoginWindow win3 = new LoginWindow();

            win3.Show();
            this.Close();
        }
Ejemplo n.º 3
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            LoginWindow lw = new LoginWindow();

            lw.Show();
            this.Hide();
        }
Ejemplo n.º 4
0
        private void OptionsLogOut_Click(object sender, RoutedEventArgs e)
        {
            CurrentUser.clearUser();
            LoginWindow lw = new LoginWindow();

            lw.Show();
            this.Close();
        }
Ejemplo n.º 5
0
 private void ButtonSignUp_Click(object sender, RoutedEventArgs e)
 {
     if (txtEmail.Text == "" || txtUsername.Text == "")
     {
         label1.Content    = "Invalid Username and/or Email!";
         label1.Visibility = Visibility.Visible;
     }
     else if (txtPassword.Password != txtPassword2.Password)
     {
         label1.Content    = "Passwords don't match!";
         label1.Visibility = Visibility.Visible;
     }
     else
     {
         LoginWindow win = new LoginWindow();
         win.Show();
         this.Close();
     }
 }
Ejemplo n.º 6
0
        private void SubButton_Click(object sender, RoutedEventArgs e)
        {
            using (DBEntities context = new DBEntities())
            {
                var user = this.usernamebox.Text;
                if (!(String.IsNullOrEmpty(user) || String.IsNullOrEmpty(this.pass1.Password) || String.IsNullOrEmpty(this.pass2.Password)))

                {
                    Console.WriteLine(user + this.pass1.Password);
                    var founduser = (context.UserTables.SingleOrDefault(u => u.UserName == user));
                    if (founduser != null)
                    {
                        this.TextBox.Text = "User already exists.";
                    }



                    else if (this.pass1.Password != this.pass2.Password)
                    {
                        this.TextBox.Text = "Password do not match. Try again.";
                    }

                    else
                    {
                        this.TextBox.Text = "Complete! Returning to Login Screen...";
                        var NewUser = new UserTable()
                        {
                            UserName     = user,
                            PasswordHash = Encrypt(this.pass1.Password),
                            DateCreated  = DateTime.Now
                        };
                        context.UserTables.Add(NewUser);
                        context.SaveChanges();
                        this.Hide();
                        loginWindow.Show();
                    }
                }
                else
                {
                    this.TextBox.Text = "Fill in all blanks.";
                }
            }
        }
Ejemplo n.º 7
0
 private void LogoutButton_Click(object sender, RoutedEventArgs e)
 {
     this.Hide();
     loginWindow.Show();
 }