protected void SaveAnimalType(object sender, EventArgs e) { try { bool valid = AnimalType.ValidateAnimalType(txtAnimalType.Text); if (valid) { AnimalType.SaveAnimalType(txtAnimalType.Text); ShowSuccessMessage("The Animal Type saved successfully."); LoadTypes(); txtAnimalType.Text = ""; } else { ShowError("This Animal Type already exists in the database. Please use a unique type."); } } catch (Exception ex) { ShowError("Something went wrong. Please try again."); } }