コード例 #1
0
        private void btODA_Click(object sender, EventArgs e)
        {
            if (rBsas.Checked == true) //ako idemo po sasiji
            {
                //provjera
                if (tBsas.TextLength != 17 || cBgar.Text == "")
                {
                    MessageBox.Show("Neispravan unos!");
                    return;
                }

                if (cBgar.Text == "Da")
                {
                    ifGarancija = true;
                }
                else
                {
                    ifGarancija = false;
                }

                ifDiesel = ServisLoad.OdrediTipPoSasiji(this);
                _model   = ServisLoad.OdrediModelPoSasiji(this);

                //pozivanje forme prepoznato!
                Form fServis2 = new Servis2(_model, ifDiesel);
                fServis2.Show();
                fServis2.Location = this.Location;

                ServisLoad.Activate1(this, ifDiesel);
            }
            else //ako idemo manualno
            {
                //provjera
                if (cBgar.Text == "" || cBmod.Text == "" || cBtip.Text == "")
                {
                    MessageBox.Show("Neispravan unos!");
                    return;
                }

                if (cBgar.Text == "Da")
                {
                    ifGarancija = true;
                }
                else
                {
                    ifGarancija = false;
                }

                if (cBtip.Text == "Diesel")
                {
                    ifDiesel = true;
                }
                else
                {
                    ifDiesel = false;
                }

                _model = cBmod.Text;

                ServisLoad.Activate2(this, ifDiesel);
            }
        }