protected void btnEnviar_Click(object sender, EventArgs e) { try { if (CamposObrigatoriosForamInformados()) { ValidarArquivos(); // Enviar a inscrição var inscricao = new Business.Inscricao(); var numeroInscricao = inscricao.EnviarInscricao(PreencherModel()); lblNumeroInscricao.Text = $" Nº INSCRIÇÃO: {numeroInscricao}"; } } catch (SqlTypeException) { ClientScript.RegisterClientScriptBlock(typeof(Page), "alert", $"<script>alert('Data de Nascimento inválida!');</script>"); } catch (Exception ex) { ClientScript.RegisterClientScriptBlock(typeof(Page), "alert", $"<script>alert('{ex.Message}');</script>"); } }