Beispiel #1
0
        private void button4_Click(object sender, EventArgs e)
        {
            if (textBox3.Text != "")
            {
                Data.CarID = textBox3.Text.Trim();

                carsAll cars = new carsAll();
                cars.MdiParent = main.ActiveForm;
                cars.Show();

                cars.carsSearchId(Data.CarID);
            }
            else if (textBox4.Text != "")
            {
                Data.CarVIN = textBox4.Text.Trim();

                carsAll cars = new carsAll();
                cars.MdiParent = main.ActiveForm;
                cars.Show();

                cars.carsSearchVIN(Data.CarVIN);
            }
            else
            {
                MessageBox.Show("You need to enter Car's Id or Car's Last VIN");
                return;
            }
        }
Beispiel #2
0
        private void textBox3_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Return)
            {
                try
                {
                    if (textBox3.Text != "")
                    {
                        Data.CarID = textBox3.Text.Trim();

                        carsAll cars = new carsAll();
                        cars.MdiParent = main.ActiveForm;
                        cars.Show();

                        cars.carsSearchId(Data.CarID);
                    }
                    else
                    {
                        MessageBox.Show("You need to enter Car's Id");
                        return;
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }