示例#1
0
 private void TestirajFitness_Load(object sender, EventArgs e)
 {
     DAL.DAL d1 = DAL.DAL.Instanca;
     d1.kreirajKonekciju("localhost", "ooi", "root", "FCChelsea1");
     DAL.DAL.Igrac_GADAO cd1 = new DAL.DAL.Igrac_GADAO();
     lista_igraca1 = cd1.getAll();
     lista_igraca2 = cd1.getAll();
     lista_igraca3 = cd1.getAll();
     lista_igraca4 = cd1.getAll();
     lista_igraca5 = cd1.getAll();
     lista_igraca6 = cd1.getAll();
     lista_igraca7 = cd1.getAll();
     lista_igraca8 = cd1.getAll();
     lista_igraca9 = cd1.getAll();
     lista_igraca10 = cd1.getAll();
     lista_igraca11 = cd1.getAll();
     lista_igraca12 = cd1.getAll();
     d1.terminirajKonekciju();
     comboBox1.DataSource = lista_igraca1;
     comboBox2.DataSource = lista_igraca2;
     comboBox3.DataSource = lista_igraca3;
     comboBox4.DataSource = lista_igraca4;
     comboBox5.DataSource = lista_igraca5;
     comboBox6.DataSource = lista_igraca6;
     comboBox7.DataSource = lista_igraca7;
     comboBox8.DataSource = lista_igraca8;
     comboBox9.DataSource = lista_igraca9;
     comboBox10.DataSource = lista_igraca10;
     comboBox11.DataSource = lista_igraca11;
     comboBox12.DataSource = lista_igraca12;
 }
示例#2
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         selektirani_igrac.Daj_1PMade = Convert.ToInt32(num_1PMade.Value);
         selektirani_igrac.Daj_2PMade = Convert.ToInt32(num_2PMade.Value);
         selektirani_igrac.Daj_3PMade = Convert.ToInt32(num_3PMade.Value);
         selektirani_igrac.Daj_1PShot = Convert.ToInt32(num_1PShot.Value);
         selektirani_igrac.Daj_2PShot = Convert.ToInt32(num_2PShot.Value);
         selektirani_igrac.Daj_3PShot = Convert.ToInt32(num_3PShot.Value);
         selektirani_igrac.Daj_DefRTG = Convert.ToDouble(num_DefRTG.Value);
         selektirani_igrac.Daj_OffRTG = Convert.ToDouble(num_OffRTG.Value);
         MessageBox.Show(selektirani_igrac.ToString()+" "+selektirani_igrac.Daj_OffRTG);
         DAL.DAL d1 = DAL.DAL.Instanca;
         d1.kreirajKonekciju("localhost", "ooi", "root", "FCChelsea1");
         DAL.DAL.Igrac_GADAO cd1 = new DAL.DAL.Igrac_GADAO();
         Igrac_GA temp = cd1.update(selektirani_igrac);
         d1.terminirajKonekciju();
         MessageBox.Show("DODAN!");
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
示例#3
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         selektirani_igrac.Daj_1PMade = Convert.ToInt32(num_1PMade.Value);
         selektirani_igrac.Daj_2PMade = Convert.ToInt32(num_2PMade.Value);
         selektirani_igrac.Daj_3PMade = Convert.ToInt32(num_3PMade.Value);
         selektirani_igrac.Daj_1PShot = Convert.ToInt32(num_1PShot.Value);
         selektirani_igrac.Daj_2PShot = Convert.ToInt32(num_2PShot.Value);
         selektirani_igrac.Daj_3PShot = Convert.ToInt32(num_3PShot.Value);
         selektirani_igrac.Daj_DefRTG = Convert.ToDouble(num_DefRTG.Value);
         selektirani_igrac.Daj_OffRTG = Convert.ToDouble(num_OffRTG.Value);
         MessageBox.Show(selektirani_igrac.ToString() + " " + selektirani_igrac.Daj_OffRTG);
         DAL.DAL d1 = DAL.DAL.Instanca;
         d1.kreirajKonekciju("localhost", "ooi", "root", "FCChelsea1");
         DAL.DAL.Igrac_GADAO cd1  = new DAL.DAL.Igrac_GADAO();
         Igrac_GA            temp = cd1.update(selektirani_igrac);
         d1.terminirajKonekciju();
         MessageBox.Show("DODAN!");
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
示例#4
0
 private void TestirajFitness_Load(object sender, EventArgs e)
 {
     DAL.DAL d1 = DAL.DAL.Instanca;
     d1.kreirajKonekciju("localhost", "ooi", "root", "FCChelsea1");
     DAL.DAL.Igrac_GADAO cd1 = new DAL.DAL.Igrac_GADAO();
     lista_igraca1  = cd1.getAll();
     lista_igraca2  = cd1.getAll();
     lista_igraca3  = cd1.getAll();
     lista_igraca4  = cd1.getAll();
     lista_igraca5  = cd1.getAll();
     lista_igraca6  = cd1.getAll();
     lista_igraca7  = cd1.getAll();
     lista_igraca8  = cd1.getAll();
     lista_igraca9  = cd1.getAll();
     lista_igraca10 = cd1.getAll();
     lista_igraca11 = cd1.getAll();
     lista_igraca12 = cd1.getAll();
     d1.terminirajKonekciju();
     comboBox1.DataSource  = lista_igraca1;
     comboBox2.DataSource  = lista_igraca2;
     comboBox3.DataSource  = lista_igraca3;
     comboBox4.DataSource  = lista_igraca4;
     comboBox5.DataSource  = lista_igraca5;
     comboBox6.DataSource  = lista_igraca6;
     comboBox7.DataSource  = lista_igraca7;
     comboBox8.DataSource  = lista_igraca8;
     comboBox9.DataSource  = lista_igraca9;
     comboBox10.DataSource = lista_igraca10;
     comboBox11.DataSource = lista_igraca11;
     comboBox12.DataSource = lista_igraca12;
 }
示例#5
0
 private void GenetickiAlgoritam_Load(object sender, EventArgs e)
 {
     DAL.DAL d1 = DAL.DAL.Instanca;
     d1.kreirajKonekciju("localhost", "ooi", "root", "FCChelsea1");
     DAL.DAL.Igrac_GADAO cd1 = new DAL.DAL.Igrac_GADAO();
     _lista_poc = cd1.getAll();
     d1.terminirajKonekciju();
 }
示例#6
0
 private void UnosPodatakaGA_Load(object sender, EventArgs e)
 {
     DAL.DAL d1 = DAL.DAL.Instanca;
     d1.kreirajKonekciju("localhost", "ooi", "root", "FCChelsea1");
     DAL.DAL.Igrac_GADAO cd1 = new DAL.DAL.Igrac_GADAO();
     lista_igraca = cd1.getAll();
     d1.terminirajKonekciju();
     comboBox1.DataSource = lista_igraca;
     selektirani_igrac = (Igrac_GA)(comboBox1.SelectedItem);
     Osvjezi();
 }
示例#7
0
 private void UnosPodatakaGA_Load(object sender, EventArgs e)
 {
     DAL.DAL d1 = DAL.DAL.Instanca;
     d1.kreirajKonekciju("localhost", "ooi", "root", "FCChelsea1");
     DAL.DAL.Igrac_GADAO cd1 = new DAL.DAL.Igrac_GADAO();
     lista_igraca = cd1.getAll();
     d1.terminirajKonekciju();
     comboBox1.DataSource = lista_igraca;
     selektirani_igrac    = (Igrac_GA)(comboBox1.SelectedItem);
     Osvjezi();
 }
示例#8
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (cb_GA.Checked)
            {
                try
                {
                    Exception n = new Exception();

                    DAL.DAL d1 = DAL.DAL.Instanca;
                    d1.kreirajKonekciju("localhost", "mydb", "root", "FCChelsea1");
                    DAL.DAL.Igrac_GADAO cd1 = new DAL.DAL.Igrac_GADAO();
                    foreach (Igrac_GA i in lista_Za_upis_GA)
                    {
                        i.Daj_ID = Convert.ToInt32(cd1.create(i));
                    }
                    MessageBox.Show("Igraci uspijesno dodani!");
                    d1.terminirajKonekciju();
                }
                catch (Exception n)
                {
                    MessageBox.Show(Convert.ToString(n));
                }
            }
            else
            {
                try
                {
                    Exception n = new Exception();

                    DAL.DAL d1 = DAL.DAL.Instanca;
                    d1.kreirajKonekciju("localhost", "mydb", "root", "FCChelsea1");
                    DAL.DAL.IgracDAO cd1 = new DAL.DAL.IgracDAO();
                    foreach (Igrac i in lista_za_upis)
                    {
                        i.Daj_Igrac_ID = Convert.ToInt32(cd1.create(i));
                    }
                    MessageBox.Show("Igraci uspijesno dodani!");
                    d1.terminirajKonekciju();
                }
                catch (Exception n)
                {
                    MessageBox.Show(Convert.ToString(n));
                }
            }
        }
示例#9
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (cb_GA.Checked) {
                try
                {
                    Exception n = new Exception();

                    DAL.DAL d1 = DAL.DAL.Instanca;
                    d1.kreirajKonekciju("localhost", "mydb", "root", "FCChelsea1");
                    DAL.DAL.Igrac_GADAO cd1 = new DAL.DAL.Igrac_GADAO();
                    foreach (Igrac_GA i in lista_Za_upis_GA)
                    {
                        i.Daj_ID = Convert.ToInt32(cd1.create(i));
                    }
                    MessageBox.Show("Igraci uspijesno dodani!");
                    d1.terminirajKonekciju();
                }
                catch (Exception n)
                {
                    MessageBox.Show(Convert.ToString(n));
                }
            }
            else
            {
                try
                {
                    Exception n = new Exception();

                    DAL.DAL d1 = DAL.DAL.Instanca;
                    d1.kreirajKonekciju("localhost", "mydb", "root", "FCChelsea1");
                    DAL.DAL.IgracDAO cd1 = new DAL.DAL.IgracDAO();
                    foreach (Igrac i in lista_za_upis)
                    {
                        i.Daj_Igrac_ID = Convert.ToInt32(cd1.create(i));
                    }
                    MessageBox.Show("Igraci uspijesno dodani!");
                    d1.terminirajKonekciju();
                }
                catch (Exception n)
                {
                    MessageBox.Show(Convert.ToString(n));
                }
            }
        }
示例#10
0
 private void GenetickiAlgoritam_Load(object sender, EventArgs e)
 {
     DAL.DAL d1 = DAL.DAL.Instanca;
     d1.kreirajKonekciju("localhost", "ooi", "root", "FCChelsea1");
     DAL.DAL.Igrac_GADAO cd1 = new DAL.DAL.Igrac_GADAO();
     _lista_poc = cd1.getAll();
     d1.terminirajKonekciju();
 }