Esempio n. 1
0
        private void ValidateControls()
        {
            if (string.IsNullOrWhiteSpace(txtLastName.Text))
            {
                epLastName.SetError(txtLastName, "Pole Nazwisko jest wymagane.");
            }
            else
            {
                epLastName.Clear();
            }

            if (string.IsNullOrWhiteSpace(txtFirstName.Text))
            {
                epFirstName.SetError(txtFirstName, "Pole Imię jest wymagane.");
            }
            else
            {
                epFirstName.Clear();
            }

            if (string.IsNullOrWhiteSpace(txtPesel.Text) && !ValidatorsHelper.IsValidPESEL(txtPesel.Text))
            {
                epPESEL.SetError(txtPesel, "Cyfra kontrolna numeru pesel jest nieprawidłowa");
            }
            else
            {
                epPESEL.Clear();
            }
        }
Esempio n. 2
0
        private void txtPesel_Validated(object sender, EventArgs e)
        {
            string pesel = txtPesel.Text;

            if (string.IsNullOrWhiteSpace(pesel) && !ValidatorsHelper.IsValidPESEL(pesel))
            {
                epPESEL.SetError(txtPesel, "Cyfra kontrolna numeru pesel jest nieprawidłowa");
            }
            else
            {
                epPESEL.Clear();
            }
        }