예제 #1
0
        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);
            }
        }
예제 #2
0
 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);
         }
     }
 }