public frmPerros() { InitializeComponent(); dtpFechaNacDog.MaxDate = DateTime.Now; dtpFechaNacDog.MinDate = DateTime.Today.AddYears(-16); control_Dog = new ControladorDog(this); control_Dog.presentarTablaDog(); control = new Controlador(this); control.cargarComboRaza(); cmbSexo.SelectedIndex = 0; }
private void BtnAddDog_Click(object sender, EventArgs e) { if ((TxtNombreP.Text != "") && (cmbRaza.SelectedItem.ToString() != "") && (txtColor.Text != "") && (TxtPrecio.Text != "") && (TxtOrigen.Text != "") && (rbSi.Checked != false || rbNo.Checked != false)) { control_Dog.crearPerro(); control_Dog = new ControladorDog(this); control_Dog.presentarTablaDog(); control_Dog.LimpiarCampos(); } else { MessageBox.Show("¿Complete todos los campos?", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }