Exemple #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Form fNar2 = new Nar2(model, path);

            fNar2.Show();
            fNar2.Location = this.Location;
            this.Hide();
            this.Dispose();
        }
        //prikaz kotaca u formi Nar2
        public static int DisplayKotaci(Nar2 refer, string model)
        {
            string path = "";

            path = model + "/" + refer.cBkotaci.Text;

            refer.pBkotaci.Load(@path + ".jpg");

            return(0);
        }
        //prikaz boje u formi Nar2
        public static int DisplayColour(Nar2 refer, string model)
        {
            string path = "";

            path = "BOJE/" + refer.cBboja.Text;

            refer.pBboja.Load(@path + ".jpg");

            return(0);
        }
        //vraca true ukoliko svi comboboxovi sadrzavaju neki string
        public static bool CheckIfAllcB(Nar2 reference)
        {
            bool flag = false;

            if (reference.cBboja.Text != "" && reference.cBkotaci.Text != "" && reference.cBmotor.Text != "" && reference.cBoprema.Text != "" && reference.cBprijenos.Text != "")
            {
                flag = true;
            }

            return(flag);
        }
        //reference da mozemo pristupiti non-static comboboxu
        public static int LoadElements(Nar2 refer, string model)
        {
            //obavezno "protected internal" za comboboxove forme Nar2
            string path = "";

            path = "data/" + model;

            refer.cBmotor.Items.AddRange(File.ReadAllLines(@path + "mot.txt"));
            refer.cBprijenos.Items.AddRange(File.ReadAllLines(@path + "pri.txt"));
            refer.cBoprema.Items.AddRange(File.ReadAllLines(@path + "opr.txt"));
            refer.cBboja.Items.AddRange(File.ReadAllLines(@path + "boj.txt"));
            refer.cBkotaci.Items.AddRange(File.ReadAllLines(@path + "kot.txt"));


            return(0);
        }
        //disable-a comboboxove, botun Prethodno i botun Naruci,
        public static int DisablecBEnableDalje(Nar2 reference)
        {
            //botune isto na Protected Internal

            reference.cBboja.Enabled     = false;
            reference.cBkotaci.Enabled   = false;
            reference.cBmotor.Enabled    = false;
            reference.cBoprema.Enabled   = false;
            reference.cBprijenos.Enabled = false;
            reference.button1.Enabled    = false;
            reference.button2.Enabled    = false;
            reference.button2.Visible    = false;
            reference.button3.Enabled    = true;
            reference.button3.Visible    = true;

            return(0);
        }