private void btnAgregar_Click(object sender, EventArgs e) { using (FormVehiculoMarcaAddEdit form = new FormVehiculoMarcaAddEdit(null)) { if (form.ShowDialog() == DialogResult.OK) { marcaVehiculoBindingSource.DataSource = db.Marca_Vehiculo.ToList(); } } }
private void btnEditar_Click(object sender, EventArgs e) { var m = marcaVehiculoBindingSource.Current; if (m == null) { return; } using (FormVehiculoMarcaAddEdit form = new FormVehiculoMarcaAddEdit(m as Marca_Vehiculo)) { if (form.ShowDialog() == DialogResult.OK) { marcaVehiculoBindingSource.DataSource = db.Marca_Vehiculo.ToList(); } } }