示例#1
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            {
                Mascota pMascota = new Mascota();
                pMascota.Nombre      = txtNombre.Text.Trim();
                pMascota.Chip        = txtChip.Text.Trim();
                pMascota.Fecha_Nac   = dtpFecha_nac.Value.Year + "/" + dtpFecha_nac.Value.Month + "/" + dtpFecha_nac.Value.Day;
                pMascota.Propietario = txtDnip.Text.Trim();

                int resultado = MascotaReg.Agregar(pMascota);
                if (resultado > 0)
                {
                    MessageBox.Show("Cliente Guardado Con Exito!!", "Guardado", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show("No se pudo guardar el cliente", "Fallo!!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
            }
        }
示例#2
0
 private void btnBuscar_Click(object sender, EventArgs e)
 {
     dgvBuscar.DataSource = MascotaReg.Buscar(txtNombre.Text, txtChip.Text);
 }