コード例 #1
0
        private void ControleDeelnemer(object sender, RoutedEventArgs e)
        {
            bool veldenOk = true;
            int  huisNr;

            if (txtCity.Text.Trim(" -".ToArray()) == "")
            {
                veldenOk = false;
            }
            else if (txtFirstName.Text.Trim(" -".ToArray()) == "")
            {
                veldenOk = false;
            }
            else if (txtLastName.Text.Trim(" -".ToArray()) == "")
            {
                veldenOk = false;
            }
            else if (txtPostalCode.Text.Trim(" -".ToArray()) == "")
            {
                veldenOk = false;
            }
            else if (txtStreet.Text == "")
            {
                veldenOk = false;
            }
            else if (int.TryParse(txtStreetNumber.Text.ToString(), out huisNr) == false)
            {
                veldenOk = false;
            }
            else if (beheerControls.CheckEmailAdres(txtEmail.Text.ToString()) == false)
            {
                veldenOk = false;
            }

            if (veldenOk)
            {
                EnableDisableButtons(true);
            }
            else
            {
                btnSave.IsEnabled = false;
            }
        }