Exemplo n.º 1
0
        private void ValidateRequiredFields(TextBox txtUsername, PasswordBox txtPassword, TextBox txtFirstName, TextBox txtLastName, out bool Validated)
        {
            Validated = false;
            if(txtUsername.Text.IsNullOrEmpty()){
                txtUsername.FlagAsError();
                return;
            } txtUsername.FlagAsCorrect();

            if (txtPassword.Password.IsNullOrEmpty()) {
                txtPassword.FlagAsError();
                return;
            } txtPassword.FlagAsCorrect();

            if (txtFirstName.Text.IsNullOrEmpty()) {
                txtFirstName.FlagAsError();
                return;
            } txtFirstName.FlagAsCorrect();

            if (txtLastName.Text.IsNullOrEmpty()) {
                txtLastName.FlagAsError();
                return;
            } txtLastName.FlagAsCorrect();
            Validated = true;
        }
Exemplo n.º 2
0
 private void ValidatePasswords(PasswordBox txtPassword, PasswordBox txtConfirmPassword, out bool Validated)
 {
     Validated = false;
     if (txtPassword.Password != txtConfirmPassword.Password) {
         txtPassword.FlagAsError();
         txtConfirmPassword.FlagAsError();
         return;
     }
     Validated = true;
 }