private void txtEmail_Validated(object sender, EventArgs e) { if (this.txtEmail.Text != String.Empty) { if (this.ValidateEmail(this.txtEmail.Text)) { if (!Crud.CheckEmailPerson(this.txtEmail.Text)) { MessageBox.Show("This email already registered.", "Attention", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); this.txtEmail.Clear(); this.txtEmail.Focus(); } } else { MessageBox.Show("Invalid email.", "Attention", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); this.txtEmail.Clear(); this.txtEmail.Focus(); } } else { MessageBox.Show("E-mail is empty.", "Attention", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); this.txtEmail.Clear(); this.txtEmail.Focus(); } }
private bool?CheckPersonEmail(string email) { return(Crud.CheckEmailPerson(email)); }