private void button1_Click(object sender, EventArgs e) { if (_newCar.CarID > 0) { _newCar.UpdateCar(); } else { _newCar.InsertCar(); foreach (CarDriveInfo drive in _listCaDrive) { drive.CarID = _newCar.CarID; drive.InsertNewCarDrive(); } } }