示例#1
0
        private void BtnGravar_Click(object sender, EventArgs e)
        {
            Animal a = new Animal();


            if (!String.IsNullOrEmpty(txtID.Text))
            {
                a.AnimalID = Convert.ToInt32(txtID.Text);
            }

            a.Nome           = txtNome.Text;
            a.Idade          = Convert.ToInt32(numIdade.Value);
            a.TipoAnimalID   = Convert.ToInt32(cbxTipoAnimal.SelectedValue);
            a.ProprietarioID = Convert.ToInt32(txtIDProp.Text);



            ans.Gravar(a);

            LimparCampos();
        }
示例#2
0
        private void BtnCadastrar_Click(object sender, EventArgs e)
        {
            animalServico.Gravar(
                new Modelo.Animal()
            {
                ClienteID    = Codcliente,
                Proprietario = ClienteNome,

                Nome     = txtNome.Text,
                Idade    = Convert.ToInt16(txtIdade.Text),
                Tipo     = cbxTipo.Text,
                Sub_tipo = cbxSubtipo.Text,
                Raca     = txtRaca.Text,
                Date     = DateTime.Now
            });;
            txtNome.Clear();
            txtIdade.Clear();

            txtRaca.Clear();



            RefreshDataGridView();
        }