How do I enforce that between two fields, at least one of them is mandatory (is it filled out)? For example, the fields Celular
and Telefone
can not be saved empty, only one of them.
My code:
//..
}
else ((txtNome.Text == "") || (maskedCPF.Text == "") || (maskedCEP.Text == "") || (txtNum.Text == "") || (maskedCelular.Text == "") || (txtTelefone.Text == ""))
{
MessageBox.Show("Os Campos com * são de Preenchimentos Obrigatórios!");
}
In this case he is obliging the two fields (Cellular and Phone) to be filled. I want it to be possible to save with the filled cell field and the empty phone field or vice versa.