private void textBoxAddEmail_TextChanged(object sender, EventArgs e) { ValidateField(EmailPattern, textBoxAddEmail); bool invalidExpression = _carService.ExistsCustomer(textBoxAddEmail.Text); buttonAddNewCustomer.Enabled = !invalidExpression; labelAddCustomerDisplayInfo.Text = invalidExpression ? "Email is taken." : string.Empty; }
public bool ExistsCustomer(string email) { return(_api.ExistsCustomer(email)); }