private void BtnSalvar_Click(object sender, EventArgs e) { if (ValidaCampos()) { if (ValidaControles()) { if (_raça != null) { //Alterar Amigo //_raça.NomeRaça = TxtRaca.Text; //MemoryStream ms = new MemoryStream(); //_Control.Alterar(_raça); //Mensagens.MsgAlterado(); //this.Close(); } else { //Incluir Raça oRaça.NomeRaça = TxtRaca.Text; MemoryStream ms = new MemoryStream(); _Control.Incluir(oRaça); Mensagens.MsgIncluido(); LimpaDados(); TxtRaca.Focus(); } } } }
private bool ValidaCampos() { if (TxtRaca.Text == string.Empty) { MessageBox.Show("O campo deve ser preenchido", "Sistema Friend of the Owner", MessageBoxButtons.OK, MessageBoxIcon.Warning); TxtRaca.Select(); return(false); } return(true); }