示例#1
0
        private void buttonDodajAutomobil_Click(object sender, EventArgs e)
        {
            if (comboMarka.SelectedIndex != 0 && comboModel.SelectedIndex != 0 && comboTip.SelectedIndex != 0 && tbCijena.Text != "" && labelSnaga.Text != "")
            {
                Automobil auto = new Automobil();
                auto.UpisiNoviAutomobil(Convert.ToInt32(label4.Text), Convert.ToInt32(labelSnaga.Text), rtbOpis.Text, Convert.ToInt32(tbCijena.Text));


                MessageBox.Show("Uspješno ste dodali novi automobil!");

                comboMarka.SelectedIndex = 0;
                comboModel.SelectedIndex = -1;
                comboTip.SelectedIndex   = 0;
                tbCijena.Text            = "";
                trackBar1.Value          = 0;
                rtbOpis.Text             = "";
            }
        }