Example #1
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);
     }
 }
Example #2
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();
 }
Example #3
0
        private void openFileDialog1_FileOk(object sender, CancelEventArgs e)
        {
            string linija = "";
            int    broj   = 0;
            bool   ide    = true;

            try
            {
                using (StreamReader sr = new StreamReader(openFileDialog1.FileName))
                {
                    while (ide)
                    {
                        linija = sr.ReadLine();
                        if (linija == null)
                        {
                            ide = false;
                        }
                        string prezime = linija.Split(',')[0];
                        string ime     = linija.Split(',')[1];
                        broj++;
                        Igrac    igrac_za_unos    = new Igrac(ime, prezime);
                        Igrac_GA igrac_za_unos_GA = new Igrac_GA();
                        igrac_za_unos_GA.Daj_Ime_i_prezime = ime + " " + prezime;
                        lista_za_upis.Add(igrac_za_unos);
                        lista_Za_upis_GA.Add(igrac_za_unos_GA);
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("The file could not be read:");
                Console.WriteLine(ex.Message);
            }
            foreach (Igrac i in lista_za_upis)
            {
                richTextBox1.Text += lista_za_upis.IndexOf(i) + ". " + i + " \n";
            }
        }
Example #4
0
 private void openFileDialog1_FileOk(object sender, CancelEventArgs e)
 {
     string linija = "";
     int broj = 0;
     bool ide = true;
     try
     {
         using (StreamReader sr = new StreamReader(openFileDialog1.FileName))
         {
             while (ide)
             {
                 linija = sr.ReadLine();
                 if (linija == null) ide = false;
                 string prezime = linija.Split(',')[0];
                 string ime = linija.Split(',')[1];
                 broj++;
                 Igrac igrac_za_unos = new Igrac(ime, prezime);
                 Igrac_GA igrac_za_unos_GA = new Igrac_GA();
                 igrac_za_unos_GA.Daj_Ime_i_prezime = ime + " " + prezime;
                 lista_za_upis.Add(igrac_za_unos);
                 lista_Za_upis_GA.Add(igrac_za_unos_GA);
             }
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine("The file could not be read:");
         Console.WriteLine(ex.Message);
     }
     foreach (Igrac i in lista_za_upis)
     {
         richTextBox1.Text += lista_za_upis.IndexOf(i) + ". " + i + " \n";
     }
 }
Example #5
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();
 }
Example #6
0
 private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
 {
     selektirani_igrac = (Igrac_GA)(comboBox1.SelectedItem);
     Osvjezi();
 }
Example #7
0
 private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
 {
     selektirani_igrac = (Igrac_GA)(comboBox1.SelectedItem);
     Osvjezi();
 }