private void AddToolStripMenuItem_Click(object sender, EventArgs e) { var fo = new CarsDialog(); if (fo.ShowDialog() == DialogResult.OK) { carShowroom1.IfSaved = false; carShowroom1.AddCar(fo.Car); carBindingSource.ResetBindings(false); } }
private void EditBut_Click(object sender, EventArgs e) { if (carShowroom1.Cars.Count != 0) { var toEdit = CarsdataGridView.SelectedRows[0].DataBoundItem as Car; var fo = new CarsDialog(toEdit); if (fo.ShowDialog() == DialogResult.OK) { carShowroom1.IfSaved = false; carBindingSource.ResetBindings(false); } } }