Esempio n. 1
0
 private void EnterButton_Click(object sender, EventArgs e)
 {
     if ((UserIdText.Text.Length != 6 || PasswordText.Text.Length != 8))
     {
         MessageBox.Show("Account Number should be 6 character. Password should be 8 character, Please Try Again.", "Notice", MessageBoxButtons.OK);
         UserIdText.Clear();
         PasswordText.Clear();
     }
     else
     {
         if ((client = AccountHolders.FindClient(UserIdText.Text, "Account Number")) == null)
         {
             MessageBox.Show("Account Number or Password is Incorrect, Please Try Again.", "Notice", MessageBoxButtons.OK);
             PasswordText.Clear();
         }
         else
         {
             if (client.Check(PasswordText.Text) && client.IsLocked())
             {
                 AccountScreen accountScreen = new AccountScreen(UserIdText.Text);
                 this.Hide();
                 accountScreen.Show();
                 PasswordText.Clear();
             }
             else
             {
                 Logger();
                 MessageBox.Show("Account Number or Password is Incorrect, Please Try Again.", "Notice", MessageBoxButtons.OK);
                 PasswordText.Clear();
             }
         }
     }
 }
        void ReleaseDesignerOutlets()
        {
            if (btnRestoreData != null)
            {
                btnRestoreData.Dispose();
                btnRestoreData = null;
            }

            if (btnStoreData != null)
            {
                btnStoreData.Dispose();
                btnStoreData = null;
            }

            if (lblResult != null)
            {
                lblResult.Dispose();
                lblResult = null;
            }

            if (PasswordText != null)
            {
                PasswordText.Dispose();
                PasswordText = null;
            }

            if (txtPassword != null)
            {
                txtPassword.Dispose();
                txtPassword = null;
            }
        }
Esempio n. 3
0
        void ReleaseDesignerOutlets()
        {
            if (ConfirmPasswordText != null)
            {
                ConfirmPasswordText.Dispose();
                ConfirmPasswordText = null;
            }

            if (EmailText != null)
            {
                EmailText.Dispose();
                EmailText = null;
            }

            if (PasswordText != null)
            {
                PasswordText.Dispose();
                PasswordText = null;
            }

            if (SignUpButton != null)
            {
                SignUpButton.Dispose();
                SignUpButton = null;
            }

            if (UsernameText != null)
            {
                UsernameText.Dispose();
                UsernameText = null;
            }
        }
Esempio n. 4
0
        public bool Validate()
        {
            var result = PasswordText.Count(x => x.ToString() == UniqueChar);
            var data   = MinLength <= result && MaxLength >= result;

            return(data);
        }
Esempio n. 5
0
        void ReleaseDesignerOutlets()
        {
            if (LoginButton != null)
            {
                LoginButton.Dispose();
                LoginButton = null;
            }

            if (PasswordText != null)
            {
                PasswordText.Dispose();
                PasswordText = null;
            }

            if (RegisterButton != null)
            {
                RegisterButton.Dispose();
                RegisterButton = null;
            }

            if (UsernameText != null)
            {
                UsernameText.Dispose();
                UsernameText = null;
            }
        }
Esempio n. 6
0
        public void ForConstructorTrueAndTextNUllShouldReturnnull()
        {
            var    isTrue = new PasswordText("true");
            IMatch actual = isTrue.Match(null);

            Assert.Null(actual.RemainingText());
        }
    public void ReturnFromRegistration()
    {
        HeadingText.GetComponent <TextMeshProUGUI>().text = "User Login";
        LoginButton.SetActive(true);
        LoginButtonCover.SetActive(true);
        UserLoginText.SetActive(true);
        PasswordText.SetActive(true);
        RegisterButton.SetActive(true);
        //RegisterName, RegisterPassword, RegisterLocation, RegisterAge, SubmitCoverButton, SubmitButton;
        RegisterName.SetActive(false);
        RegisterPassword.SetActive(false);
        RegisterLocation.SetActive(false);
        RegisterAge.SetActive(false);
        SubmitCoverButton.SetActive(false);
        SubmitButton.SetActive(false);
        Registering = false;

        if (netManager)
        {
            if (netManager.IsConnectedToServer())
            {
                netManager.AttemptAccountCreation(RegisterName.GetComponent <TMP_InputField>().text, RegisterPassword.GetComponent <TMP_InputField>().text);
            }
        }
    }
Esempio n. 8
0
        public void ForConstructorFalseAndTextEmptyStringShouldReturnFalse()
        {
            var    isFalse = new PasswordText("false");
            IMatch actual  = isFalse.Match(string.Empty);

            Assert.False(actual.Succes());
        }
Esempio n. 9
0
        public void ForConstructorFalseAndTextNullShouldReturnNull()
        {
            var    isFalse = new PasswordText("false");
            IMatch actual  = isFalse.Match(null);

            Assert.Null(actual.RemainingText());
        }
Esempio n. 10
0
        public void ForConstructorFalseAndTextFalseShouldReturnTextEmprtyString()
        {
            var    isFalse = new PasswordText("false");
            IMatch actual  = isFalse.Match("false");

            Assert.Equal(string.Empty, actual.RemainingText());
        }
Esempio n. 11
0
        public void ForConstructorFalseAndTextFalsexShouldReturnTextx()
        {
            var    isFalse = new PasswordText("false");
            IMatch actual  = isFalse.Match("falsex");

            Assert.Equal("x", actual.RemainingText());
        }
 void ReleaseDesignerOutlets()
 {
     if (ErrorText != null)
     {
         ErrorText.Dispose();
         ErrorText = null;
     }
     if (LoginButton != null)
     {
         LoginButton.Dispose();
         LoginButton = null;
     }
     if (PasswordText != null)
     {
         PasswordText.Dispose();
         PasswordText = null;
     }
     if (SignupButton != null)
     {
         SignupButton.Dispose();
         SignupButton = null;
     }
     if (UsernameText != null)
     {
         UsernameText.Dispose();
         UsernameText = null;
     }
 }
        /// <summary>
        /// Validating user inputs
        /// </summary>
        private bool ValidateParameters()
        {
            if (string.IsNullOrWhiteSpace(UrlText.Text))
            {
                MessageBox.Show("Please enter SharePoint Url value.");
                UrlText.Focus();
                return(false);
            }

            if (string.IsNullOrWhiteSpace(UserText.Text))
            {
                MessageBox.Show("Please enter User value.");
                UserText.Focus();
                return(false);
            }

            if (string.IsNullOrWhiteSpace(PasswordText.Text))
            {
                MessageBox.Show("Please enter Password.");
                PasswordText.Focus();
                return(false);
            }

            return(true);
        }
        private void PasswordGotFocus(object sender, RoutedEventArgs e)
        {
            PasswordWatermark.Opacity = 0;
            PasswordText.Opacity      = 100;

            PasswordText.SelectAll();
        }
Esempio n. 15
0
        public void ForConstructorTrueAndTextEmptyStringShouldReturnEmptyString()
        {
            var    isTrue = new PasswordText("true");
            IMatch actual = isTrue.Match(string.Empty);

            Assert.Equal(string.Empty, actual.RemainingText());
        }
Esempio n. 16
0
        public void ForConstructorEmptyStringAndTextTrueShouldReturnTrue()
        {
            var    isFalse = new PasswordText(string.Empty);
            IMatch actual  = isFalse.Match("true");

            Assert.True(actual.Succes());
        }
Esempio n. 17
0
        public void ForConstructorTrueAndTextNullShouldReturnFalse()
        {
            var    isTrue = new PasswordText("true");
            IMatch actual = isTrue.Match(null);

            Assert.False(actual.Succes());
        }
Esempio n. 18
0
        public void ForConstructorEmptyStringAndTextTrueShouldReturnTextTrue()
        {
            var    isFalse = new PasswordText(string.Empty);
            IMatch actual  = isFalse.Match("true");

            Assert.Equal("true", actual.RemainingText());
        }
Esempio n. 19
0
        public void ForConstructorFalseAndTextFalseShouldReturnTrue()
        {
            var    isFalse = new PasswordText("false");
            IMatch actual  = isFalse.Match("false");

            Assert.True(actual.Succes());
        }
Esempio n. 20
0
        public void ForConstructorEmptyStringAndTextNullShouldReturnFalse()
        {
            var    isFalse = new PasswordText(string.Empty);
            IMatch actual  = isFalse.Match(null);

            Assert.False(actual.Succes());
        }
Esempio n. 21
0
    // Update is called once per frame
    void Update()
    {
        if (!loggingIn && !loggedIn && !Registering)
        {
            if (UserLoginText.GetComponent <TMP_InputField>().text != "" &&
                PasswordText.GetComponent <TMP_InputField>().text != "")
            {
                LoginButton.SetActive(true);
                LoginButtonCover.SetActive(false);
            }
            else
            {
                LoginButton.SetActive(false);
                LoginButtonCover.SetActive(true);
            }
        }

        if (Registering)
        {
            if (RegisterName.GetComponent <TMP_InputField>().text != "" &&
                RegisterPassword.GetComponent <TMP_InputField>().text != "" &&
                RegisterAge.GetComponent <TMP_InputField>().text != "" &&
                RegisterLocation.GetComponent <TMP_InputField>().text != "")
            {
                SubmitCoverButton.SetActive(false);
                SubmitButton.SetActive(true);
            }
            else
            {
                SubmitCoverButton.SetActive(true); SubmitButton.SetActive(false);
            }
        }


        if (loggingIn)
        {
            if (loginConfirmed)
            {
                fakeLoginCount++;
                if (fakeLoginCount > 180)
                {
                    LoggedIn();
                    loggingIn      = false;
                    fakeLoginCount = 0;
                }
            }
        }

        if (loginFailed)
        {
            errorCount++;
            if (errorCount > 250)
            {
                loginFailed = false;
                errorCount  = 0;
                ErrorMessageBacking.SetActive(false);
                ErrorMessageText.SetActive(false);
            }
        }
    }
Esempio n. 22
0
        public void ForConstructorEmptyStringAndTextNullShouldReturnnull()
        {
            var    isFalse = new PasswordText(string.Empty);
            IMatch actual  = isFalse.Match(null);

            Assert.Null(actual.RemainingText());
        }
Esempio n. 23
0
 private void PasswordTextKeyDown(object sender, KeyRoutedEventArgs e)
 {
     if (sender != null)
     {
         try
         {
             if (e.Key == Windows.System.VirtualKey.Enter)
             {
                 if (string.IsNullOrEmpty(UsernameText.Text))
                 {
                     UsernameText.Focus(FocusState.Programmatic);
                 }
                 else if (string.IsNullOrEmpty(PasswordText.Password))
                 {
                     PasswordText.Focus(FocusState.Programmatic);
                 }
                 else
                 {
                     if (DataContext is LoginViewModel context)
                     {
                         if (context != null)
                         {
                             context.RunLogin(null);
                         }
                     }
                 }
             }
         }
         catch { }
     }
 }
Esempio n. 24
0
        public void ForConstructorTrueAndTextTruexShouldReturnx()
        {
            var    isTrue = new PasswordText("true");
            IMatch actual = isTrue.Match("truex");

            Assert.Equal("x", actual.RemainingText());
        }
        void ReleaseDesignerOutlets()
        {
            if (EmailText != null)
            {
                EmailText.Dispose();
                EmailText = null;
            }

            if (LoginBtn != null)
            {
                LoginBtn.Dispose();
                LoginBtn = null;
            }

            if (LoginUpperIamge != null)
            {
                LoginUpperIamge.Dispose();
                LoginUpperIamge = null;
            }

            if (PasswordText != null)
            {
                PasswordText.Dispose();
                PasswordText = null;
            }

            if (SignupBtn != null)
            {
                SignupBtn.Dispose();
                SignupBtn = null;
            }
        }
Esempio n. 26
0
        public void ForConstructorTrueAndTextFalseShouldReturnTextfalse()
        {
            var    isTrue = new PasswordText("true");
            IMatch actual = isTrue.Match("false");

            Assert.Equal("false", actual.RemainingText());
        }
Esempio n. 27
0
 public void Clear()
 {
     IDText.Clear();
     FullNameText.Clear();
     UserNameText.Clear();
     PasswordText.Clear();
 }
Esempio n. 28
0
        public void ConstructorTrueAndTextTrueShouldReturnTrue()
        {
            var    isTrue = new PasswordText("true");
            IMatch actual = isTrue.Match("true");

            Assert.True(actual.Succes());
        }
Esempio n. 29
0
 public override void NavigatedToEvent(object sender, IDictionary <string, object> kwargs)
 {
     base.NavigatedToEvent(sender, kwargs);
     UserText.ClearContent();
     UserName.ClearContent();
     PasswordText.ClearContent();
 }
Esempio n. 30
0
        void ReleaseDesignerOutlets()
        {
            if (LoginButton != null)
            {
                LoginButton.Dispose();
                LoginButton = null;
            }

            if (PasswordText != null)
            {
                PasswordText.Dispose();
                PasswordText = null;
            }

            if (SignUpButton != null)
            {
                SignUpButton.Dispose();
                SignUpButton = null;
            }

            if (UsernameText != null)
            {
                UsernameText.Dispose();
                UsernameText = null;
            }

            if (ViewDatabaseButton != null)
            {
                ViewDatabaseButton.Dispose();
                ViewDatabaseButton = null;
            }
        }