private void btnGravar_Click(object sender, EventArgs e) { ModAluno aluno = new ModAluno(); try { aluno.Id = Convert.ToInt32(txtID.Text); } catch { aluno.Id = 0; } try { aluno.Cadastro = Convert.ToDateTime(txtCadastro.Text); } catch { aluno.Cadastro = null; } aluno.Nome = txtNome.Text; aluno.Email = txtEmail.Text; if (Validacao.ValidarModelo(aluno)==true) { // Coloque aqui sua rotina para salvar seus dados MessageBox.Show("Registro salvo com sucesso !", "Atenção", MessageBoxButtons.OK, MessageBoxIcon.Information); } }