示例#1
0
        private void button1_Click(object sender, EventArgs e)
        {
            String make, model, customer, carDealer;
            double price, capacity;

            try
            {
                make = makeBox.Text;
                model = modelBox.Text;
                customer = custBox.Text;
                carDealer = dilerBox.Text;
                price = Convert.ToDouble(priceBox.Text);
                capacity = Convert.ToDouble(capacityBox.Text);
                int idCustomer = cMode.idCustomer(customer);
                int idCarDealer = cMode.idCarDealer(carDealer);

                Car car = new Car();
                car.setMake(make);
                car.setModel(model);
                car.setPrice(price);
                car.setCapacity(capacity);
                car.setidDealer(idCarDealer);
                car.setidCustomer(idCustomer);

                cMode.insercik(car, 2);
                MessageBox.Show("Inserted", "OK", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

            catch
            {
                MessageBox.Show("Something went wrong!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#2
0
 private void button3_Click(object sender, EventArgs e)
 {
     form4 = new Car();
     form4.Show();
 }