Example #1
0
        partial void LoginButtonClick(UIButton sender)
        {
            string result = tryLogin(UsernameText.Text, PasswordText.Text);

            if (result == "0")
            {
                ErrorText.Text = "Log In Failed";
            }
            else
            {
                ErrorText.Text = "Logged In";
                UserDataManager.SetData(result);
                UserDataManager.SetPassword(PasswordText.Text);
                UserDataManager.SaveCredentials();
                GoToMainMenu();
            }
        }
Example #2
0
        private void trySubmit(string email, string username, string password, string firstname, string lastname)
        {
            string result = trySignUp(email, username, password, String.Format("{0} {1}", firstname, lastname));

            if (result == "0")
            {
                ErrorText.Text = "Submission Failed";
            }
            else if (result == "-1")
            {
                ErrorText.Text = "This email is already in use";
            }
            else
            {
                ErrorText.Text = "New User Created";
                UserDataManager.SetData(result);
                UserDataManager.SetPassword(password);
                UserDataManager.SaveCredentials();
                GoToMainMenu();
            }
        }