Beispiel #1
0
 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();
             }
         }
     }
 }
Beispiel #2
0
 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);
 }