private void txtNewClientPhoneW_Validating(object sender, CancelEventArgs e) { RegularExpressionHelper helper = new RegularExpressionHelper(); // Phone is required if (((txtNewClientPhoneW.Text).Length > 15) || !helper.IsPhoneFormat(txtNewClientPhoneW.Text)) { errorProvider12.SetError(txtNewClientPhoneW, "Incorrect Phone Format"); e.Cancel = true; return; } // Phone is Valid errorProvider12.SetError(txtNewClientPhoneW, ""); }
private void txtNewCoordinatorFax_Validating(object sender, CancelEventArgs e) { RegularExpressionHelper helper = new RegularExpressionHelper(); // Fax is required if (((txtNewCoordinatorFax.Text).Length > 15) || !helper.IsPhoneFormat(txtNewCoordinatorFax.Text)) { errorProvider21.SetError(txtNewCoordinatorFax, "Incorrect Fax Format"); e.Cancel = true; return; } // Fax is Valid errorProvider21.SetError(txtNewCoordinatorFax, ""); }