private void SaveSubjbtn_Click(object sender, EventArgs e) { try { saveParish(); loadfrm(); ParishTB.Clear(); MessageBox.Show("Successfully Added to Parishes!"); ParishTB.Focus(); } catch (Exception) { MessageBox.Show("ERROR" + "\n\n" + "Parish entered cannot be saved"); } }
private string ValidateName(string input) { if (input != null) { if (Regex.IsMatch(input, spattern) == true) { result = input; } else { ValidData(); ParishTB.Clear(); ParishTB.Focus(); } } else { ValidData(); ParishTB.Clear(); ParishTB.Focus(); } return(result); }