예제 #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            Igrac selektirani_igrac = (Igrac)(listBox1.SelectedItem);

            selektirani_igrac.DajPozicija = "SF";
            DAL.DAL d1 = DAL.DAL.Instanca;
            d1.kreirajKonekciju("localhost", "mydb", "root", "FCChelsea1");
            DAL.DAL.IgracDAO cd1 = new DAL.DAL.IgracDAO();
            selektirani_igrac = cd1.update(selektirani_igrac);
            DAL.DAL.IgracDAO cd = new DAL.DAL.IgracDAO();
            Igraci = cd.getAll();
            d1.terminirajKonekciju();
            int broj = listBox1.SelectedIndex;

            foreach (Igrac i in Igraci)
            {
                if (i.DajPozicija == "N/A")
                {
                    Pom_Igraci.Add(i);
                }
            }
            Igraci = Pom_Igraci;
            listBox1.DataSource    = Igraci;
            listBox1.SelectedIndex = broj;
        }
예제 #2
0
파일: Spoji.cs 프로젝트: kleitz/statstron
        private void Spoji_Load(object sender, EventArgs e)
        {
            List <Klub>  Klubi       = new List <Klub>();
            List <Igrac> Igraci_temp = new List <Igrac>();
            List <Igrac> Igraci      = new List <Igrac>();

            DAL.DAL d1 = DAL.DAL.Instanca;
            d1.kreirajKonekciju("localhost", "mydb", "root", "FCChelsea1");
            DAL.DAL.KlubDAO cd1 = new DAL.DAL.KlubDAO();
            Klubi = cd1.getAll();
            d1.terminirajKonekciju();
            listBox1.DataSource = Klubi;
            d1.kreirajKonekciju("localhost", "mydb", "root", "FCChelsea1");
            DAL.DAL.IgracDAO cd2 = new DAL.DAL.IgracDAO();
            Igraci_temp = cd2.getAll();
            d1.terminirajKonekciju();
            foreach (Igrac i in Igraci_temp)
            {
                if (i.Daj_Ekipa_ID == 0)
                {
                    Igraci.Add(i);
                }
            }
            listBox2.DataSource = Igraci;
            selektirani_klub    = (Klub)(listBox1.SelectedItem);
            selektirani_igrac   = (Igrac)(listBox2.SelectedItem);
        }
예제 #3
0
 private void ListaIgraca_Load(object sender, EventArgs e)
 {
     int PG=0, SG=0, SF=0, PF=0, C=0,NA=0,ukupno=0;
     DAL.DAL d1 = DAL.DAL.Instanca;
     d1.kreirajKonekciju("localhost", "mydb", "root", "FCChelsea1");
     DAL.DAL.IgracDAO cd1 = new DAL.DAL.IgracDAO();
     Igraci = cd1.getAll();
     d1.terminirajKonekciju();
     listBox1.DataSource = Igraci;
     foreach (Igrac i in Igraci)
     {
         if (i.DajPozicija == "PG")
             PG++;
         if (i.DajPozicija == "SG")
             SG++;
         if (i.DajPozicija == "SF")
             SF++;
         if (i.DajPozicija == "PF")
             PF++;
         if (i.DajPozicija == "C")
             C++;
         if (i.DajPozicija == "N/A")
             NA++;
         ukupno++;
     }
     label2.Text = "Od " + ukupno + " igrača, " + PG + " su PG, " + SG + " su SG, " + SF + " su SF, " + PF + " su PF, " + C + " su C, a " + NA + " nisu jos obrađeni.";
 }
예제 #4
0
 private void FileSezona_Load(object sender, EventArgs e)
 {
     DAL.DAL d1 = DAL.DAL.Instanca;
     d1.kreirajKonekciju("localhost", "mydb", "root", "FCChelsea1");
     DAL.DAL.IgracDAO cd1 = new DAL.DAL.IgracDAO();
     Igraci = cd1.getAll();
     DAL.DAL.KlubDAO cd2 = new DAL.DAL.KlubDAO();
     Klubovi = cd2.getAll();
     d1.terminirajKonekciju();
     comboBox1.DataSource = Igraci;
 }
예제 #5
0
 private void FileSezona_Load(object sender, EventArgs e)
 {
     DAL.DAL d1 = DAL.DAL.Instanca;
     d1.kreirajKonekciju("localhost", "mydb", "root", "FCChelsea1");
     DAL.DAL.IgracDAO cd1 = new DAL.DAL.IgracDAO();
     Igraci = cd1.getAll();
     DAL.DAL.KlubDAO cd2 = new DAL.DAL.KlubDAO();
     Klubovi = cd2.getAll();
     d1.terminirajKonekciju();
     comboBox1.DataSource = Igraci;
 }
예제 #6
0
 private void UsporedbaIgraca_Load(object sender, EventArgs e)
 {
     comboBox2.SelectedIndex = 0;
     DAL.DAL d1 = DAL.DAL.Instanca;
     d1.kreirajKonekciju("localhost", "mydb", "root", "FCChelsea1");
     DAL.DAL.IgracDAO cd1 = new DAL.DAL.IgracDAO();
     Igraci1 = cd1.getAll();
     d1.terminirajKonekciju();
     d1.kreirajKonekciju("localhost", "mydb", "root", "FCChelsea1");
     DAL.DAL.IgracDAO cd2 = new DAL.DAL.IgracDAO();
     Igraci2 = cd2.getAll();
     d1.terminirajKonekciju();
     comboBox1.DataSource = Igraci1;
     comboBox3.DataSource = Igraci2;
 }
예제 #7
0
        private void ListaIgraca_Load(object sender, EventArgs e)
        {
            int PG = 0, SG = 0, SF = 0, PF = 0, C = 0, NA = 0, ukupno = 0;

            try
            {
                DAL.DAL d1 = DAL.DAL.Instanca;
                d1.kreirajKonekciju("localhost", "mydb", "root", "FCChelsea1");
                DAL.DAL.IgracDAO cd1 = new DAL.DAL.IgracDAO();
                Igraci = cd1.getAll();
                d1.terminirajKonekciju();
                listBox1.DataSource = Igraci;
                foreach (Igrac i in Igraci)
                {
                    if (i.DajPozicija == "PG")
                    {
                        PG++;
                    }
                    if (i.DajPozicija == "SG")
                    {
                        SG++;
                    }
                    if (i.DajPozicija == "SF")
                    {
                        SF++;
                    }
                    if (i.DajPozicija == "PF")
                    {
                        PF++;
                    }
                    if (i.DajPozicija == "C")
                    {
                        C++;
                    }
                    if (i.DajPozicija == "N/A")
                    {
                        NA++;
                    }
                    ukupno++;
                }
                label2.Text = "Od " + ukupno + " igrača, " + PG + " su PG, " + SG + " su SG, " + SF + " su SF, " + PF + " su PF, " + C + " su C, a " + NA + " nisu jos obrađeni.";
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
예제 #8
0
 private void DodaPoziciju_Load(object sender, EventArgs e)
 {
     DAL.DAL d1 = DAL.DAL.Instanca;
     d1.kreirajKonekciju("localhost", "mydb", "root", "FCChelsea1");
     DAL.DAL.IgracDAO cd1 = new DAL.DAL.IgracDAO();
     Igraci = cd1.getAll();
     d1.terminirajKonekciju();
     foreach (Igrac i in Igraci)
     {
         if (i.DajPozicija == "N/A")
         {
             Pom_Igraci.Add(i);
         }
     }
     Igraci = Pom_Igraci;
     listBox1.DataSource = Igraci;
 }
예제 #9
0
 private void PregledSezona_Load(object sender, EventArgs e)
 {
     // TODO: This line of code loads data into the 'mydbDataSet.sezone' table. You can move, or remove it, as needed.
     this.sezoneTableAdapter.Fill(this.mydbDataSet.sezone);
     DAL.DAL d1 = DAL.DAL.Instanca;
     d1.kreirajKonekciju("localhost", "mydb", "root", "FCChelsea1");
     DAL.DAL.IgracDAO cd1 = new DAL.DAL.IgracDAO();
     Igraci = cd1.getAll();
     d1.terminirajKonekciju();
     comboBox1.DataSource = Igraci;
     selektirani_igrac    = (Igrac)(comboBox1.SelectedItem);
     d1.kreirajKonekciju("localhost", "mydb", "root", "FCChelsea1");
     DAL.DAL.SezonskiPodaciDAO cd2 = new DAL.DAL.SezonskiPodaciDAO();
     Sezone = cd2.GetByPlayerID(selektirani_igrac.Daj_Igrac_ID);
     d1.terminirajKonekciju();
     //mydbDataSet.sezone.Clear();
 }
예제 #10
0
 private void button2_Click(object sender, EventArgs e)
 {
     Igrac selektirani_igrac = (Igrac)(listBox1.SelectedItem);
     selektirani_igrac.DajPozicija = "SG";
     DAL.DAL d1 = DAL.DAL.Instanca;
     d1.kreirajKonekciju("localhost", "ooi", "root", "FCChelsea1");
     DAL.DAL.IgracDAO cd1 = new DAL.DAL.IgracDAO();
     selektirani_igrac = cd1.update(selektirani_igrac);
     DAL.DAL.IgracDAO cd = new DAL.DAL.IgracDAO();
     Igraci = cd.getAll();
     d1.terminirajKonekciju();
     int broj = listBox1.SelectedIndex;
     foreach (Igrac i in Igraci)
     {
         if (i.DajPozicija == "N/A")
             Pom_Igraci.Add(i);
     }
     Igraci = Pom_Igraci;
     listBox1.DataSource = Igraci;
     listBox1.SelectedIndex = broj;
 }
예제 #11
0
 private void UsporedbaIgraca_Load(object sender, EventArgs e)
 {
     comboBox2.SelectedIndex = 0;
     DAL.DAL d1 = DAL.DAL.Instanca;
     d1.kreirajKonekciju("localhost", "mydb", "root", "FCChelsea1");
     DAL.DAL.IgracDAO cd1 = new DAL.DAL.IgracDAO();
     Igraci1 = cd1.getAll();
     d1.terminirajKonekciju();
     d1.kreirajKonekciju("localhost", "mydb", "root", "FCChelsea1");
     DAL.DAL.IgracDAO cd2 = new DAL.DAL.IgracDAO();
     Igraci2 = cd2.getAll();
     d1.terminirajKonekciju();
     comboBox1.DataSource = Igraci1;
     comboBox3.DataSource = Igraci2;
 }
예제 #12
0
 private void PregledSezona_Load(object sender, EventArgs e)
 {
     // TODO: This line of code loads data into the 'mydbDataSet.sezone' table. You can move, or remove it, as needed.
     this.sezoneTableAdapter.Fill(this.mydbDataSet.sezone);
     DAL.DAL d1 = DAL.DAL.Instanca;
     d1.kreirajKonekciju("localhost", "mydb", "root", "FCChelsea1");
     DAL.DAL.IgracDAO cd1 = new DAL.DAL.IgracDAO();
     Igraci = cd1.getAll();
     d1.terminirajKonekciju();
     comboBox1.DataSource = Igraci;
     selektirani_igrac = (Igrac)(comboBox1.SelectedItem);
     d1.kreirajKonekciju("localhost", "mydb", "root", "FCChelsea1");
     DAL.DAL.SezonskiPodaciDAO cd2 = new DAL.DAL.SezonskiPodaciDAO();
     Sezone = cd2.GetByPlayerID(selektirani_igrac.Daj_Igrac_ID);
     d1.terminirajKonekciju();
     //mydbDataSet.sezone.Clear();
 }
예제 #13
0
 private void DodaPoziciju_Load(object sender, EventArgs e)
 {
     DAL.DAL d1 = DAL.DAL.Instanca;
     d1.kreirajKonekciju("localhost", "ooi", "root", "FCChelsea1");
     DAL.DAL.IgracDAO cd1 = new DAL.DAL.IgracDAO();
     Igraci = cd1.getAll();
     d1.terminirajKonekciju();
     foreach(Igrac i in Igraci)
     {
         if (i.DajPozicija == "N/A")
             Pom_Igraci.Add(i);
     }
     Igraci = Pom_Igraci;
     listBox1.DataSource = Igraci;
 }