예제 #1
0
        public void Button_Click(object sender, RoutedEventArgs e)
        {
            tc.UserDetailsColumn();
            List <UserInformationColumns> UserInformationList = tc.Users;
            bool UN = true;

            if (userName.Text.Length <= 10)
            {
                if (passWord.Text.Length <= 10)
                {
                    for (int i = 0; i < UserInformationList.Count; i++)
                    {
                        if (userName.Text == UserInformationList[i].UserName)
                        {
                            PassError.Text = "UserNameTaken";
                            UN             = false;
                        }
                    }
                    if (UN == true)
                    {
                        if (passWord.Text == confPassword.Text)
                        {
                            PassError.Text      = "Account Created!";
                            UserInfo.UserValues = Userdetails();
                            UserInfo.CreateAccount();
                            PassError.Foreground = new SolidColorBrush(Colors.Green);
                            ReturntoLogin();
                        }
                        else
                        {
                            PassError.Text = "Passwords do not match";
                        }
                    }
                }
                else
                {
                    PassError.Text = "Password too long, please keep it to 10 characters";
                }
            }
            else
            {
                PassError.Text = "UserName too long, please keep it to 10 characters";
            }
        }
예제 #2
0
        public void Button_Click(object sender, RoutedEventArgs e)
        {
            tc.UserDetailsColumn();
            List <string> UserNameList = tc.UserNameList;
            bool          UN           = false;

            foreach (string _u in UserNameList)
            {
                if (userName.Text == _u)
                {
                    UN = true;
                }
                else
                {
                    UN = false;
                }
            }
            if (UN == false)
            {
                if (passWord.Text != confPassword.Text)
                {
                    PassError.Text = "Passwords do not Match";
                }
                else
                {
                    PassError.Text = "Account Created!";
                    a.uservals     = Userdetails();
                    a.CreateAccount();
                    PassError.Foreground = new SolidColorBrush(Colors.Green);
                    ReturntoLogin();
                }
            }
            else
            {
                PassError.Text = "UserName Taken";
            }
        }