private void btnAddNewCar_Click(object sender, EventArgs e) {
            NewCarDialog dlg = new NewCarDialog();

            if (dlg.ShowDialog() == DialogResult.OK) {
                carsInStock.Add(dlg.theCar);
            }

            UpdateGrid();
        }
 private void btnAddToInventory_Click(object sender, EventArgs e)
 {
     NewCarDialog d = new NewCarDialog();
     if (d.ShowDialog() == DialogResult.OK)
     {
         _carsInStock.Add(d.TheCar);
         UpdateGrid();
     }
 }
Exemple #3
0
        private void btnAddNewCar_Click(object sender, EventArgs e)
        {
            NewCarDialog d = new NewCarDialog();

            if (d.ShowDialog() == DialogResult.OK)
            {
                carsInStock.Add(d.theCar);
                UpdateGrid();
            }
        }
Exemple #4
0
        private void btnAddNewCar_Click(object sender, EventArgs e)
        {
            NewCarDialog d = new NewCarDialog();

            if (d.ShowDialog() == DialogResult.OK)
            {
                // Добавить новый автомобиль в список
                carsInStock.Add(d.theCar);
                UpdateGrid();
            }
        }
Exemple #5
0
 private void btnAddNewCar_Click(object sender, EventArgs e)
 {
     using (NewCarDialog d = new NewCarDialog())
     {
         if (d.ShowDialog() == DialogResult.OK)
         {
             //  向列表中添加一个新的Car
             CarsInStock.Add(d.theCar);
             UpdateGrid();
         }
     }
 }
Exemple #6
0
 private void btnAddNewCar_Click(object sender, EventArgs e)
 {
     NewCarDialog d = new NewCarDialog();
     if (d.ShowDialog() == DialogResult.OK)
     {
         // Add new car to list.
         carsInStock.Add(d.theCar);
         UpdateGrid();
     }
 }