Ejemplo n.º 1
0
        private void BtnSalvar_Click(object sender, RoutedEventArgs e)
        {
            string email    = tbxEmail.Text;
            string telefone = tbxTelefone.Text;

            if (ValidatesCustom.ValidPhone(telefone))
            {
                MessageBox.Show($"{tbxNome.Text.ToUpper()}! O telefone {telefone} é VÁLIDO.", "Informação", MessageBoxButton.OK, MessageBoxImage.Information);
                resTelefone.Text = "True";
            }

            else
            {
                MessageBox.Show($"ATENÇÃO {tbxNome.Text.ToUpper()}, o telefone {tbxTelefone.Text} é INVÁLIDO.", "Erro", MessageBoxButton.OK, MessageBoxImage.Error);
                resTelefone.Text = "False";
            }

            if (ValidatesCustom.ValidEmail(email))
            {
                MessageBox.Show($"{tbxNome.Text.ToUpper()}! O email {email} é VÁLIDO.", "Informação", MessageBoxButton.OK, MessageBoxImage.Information);
                resEmail.Text = "True";
            }

            else
            {
                MessageBox.Show($"ATENÇÃO {tbxNome.Text.ToUpper()}, o email {tbxEmail.Text} é INVÁLIDO.", "Erro", MessageBoxButton.OK, MessageBoxImage.Error);
                resEmail.Text = "False";
            }
        }
Ejemplo n.º 2
0
        private void BtSalvar_Click(object sender, RoutedEventArgs e)
        {
            var email  = tbxEmail.Text;
            var numero = tbxEmail.Text;


            if (ValidatesCustom.ValidEmail(email))
            {
                MessageBox.Show("E-mail correto!");
            }
            else
            {
                MessageBox.Show("E-mail incorreto!");
            }

            if (ValidatesCustom.ValidNumero(numero))
            {
                MessageBox.Show("Número correto!");
            }
            else
            {
                MessageBox.Show("Número incorreto!");
            }
        }