Example #1
0
 private void clickSubmitTrigger(object sender, MouseButtonEventArgs e)
 {
     SQLConnection connection = new SQLConnection();
     if (!connection.checkUserExists(this.UsernameInput.Text.ToString()))
         MessageBox.Show("This username already exists!", "Alert",
             MessageBoxButton.OK, MessageBoxImage.Hand);
     else
     {
         String u = this.UsernameInput.Text.ToString();
         String p = this.PasswordInput.Password.ToString();
         connection.insertNewUser(u, p);
     }
 }
Example #2
0
 private void ClickLoginTrigger(object sender, MouseButtonEventArgs e)
 {
     String username = UsernameInputField.Text;
     String password = PasswordInputField.Password;
     //Proceed to login
     SQLConnection connect = new SQLConnection();
     if (connect.checkUserCredentials(username, password))
     {
         PlayMode goForm = new PlayMode();
         goForm.ShowDialog();
         GameType hold = goForm.type;
         MainGameWindow main = new MainGameWindow(hold);
         main.ShowDialog();
     }
     else
     {
         HeaderLogin.Content = "Invalid Username or Password";
     }
 }
Example #3
0
        public bool isWordDB(String s)
        {
            SQLConnection connect = new SQLConnection();
            int dt = connect.getWords(s).Rows.Count;

            if (dt == 0)
            {
                return false;
            }
            else
            {
                return true;
            }
        }
Example #4
0
 private Dictionary<String, int> getScoringIndex()
 {
     SQLConnection connect = new SQLConnection();
     return connect.getScoreIndex();
 }
Example #5
0
 public List<String> getAllWords()
 {
     long counter_pre = DateTime.Now.Millisecond;
     SQLConnection connect = new SQLConnection();
     List<String> output = connect.getWords();
     long counter_post= DateTime.Now.Millisecond;
     return output;
 }