Пример #1
0
        private void init_data()
        {
            try
            {
                dataGridViewAwardResult.Rows.Clear();

                list = clWork.GetListData(IS.idseason, currdiv.id);

                if (list.Count > 0)
                {
                    g_f = true;

                    dataGridViewAwardResult.Rows.Add(list.Count);

                    for (int i = 0; i < list.Count; i++)
                    {
                        STAward st = clAward.GetAward(list[i].idaward);
                        dataGridViewAwardResult.Rows[i].Cells[0].Value = st.nameaward;


                        clPlayer = new CPlayer(connect, list[i].idplayer);

                        dataGridViewAwardResult.Rows[i].Cells[1].Value = string.Format("{0} {1}",
                                                                                       clPlayer.stPlayer.name, clPlayer.stPlayer.family);


                        clEP = new CEntryPlayers(connect);
                        int x = clEP.IsEntryPlayer(IS.idseason, list[i].idplayer);

                        if (x > 0)
                        {
                            clTeam = new CTeam(connect, x);
                            dataGridViewAwardResult.Rows[i].Cells[2].Value = clTeam.stTeam.name;
                        }

                        if (list[i].result != null)
                        {
                            dataGridViewAwardResult.Rows[i].Cells[3].Value =
                                string.Format("{0:f2}", list[i].result);
                        }

                        dataGridViewAwardResult.Rows[i].Cells[4].Value = list[i].idplayer;

                        if (flawour.Equals(list[i]))
                        {
                            gpos = i;
                        }
                    }

                    dataGridViewAwardResult.ClearSelection();

                    dataGridViewAwardResult.AllowUserToAddRows = false;
                }
                else
                {
                    dataGridViewAwardResult.AllowUserToAddRows = false;
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); }
        }
Пример #2
0
        private void comboBoxName_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                if (comboBoxName.Text.Length > 0)
                {
                    char[] del = { ' ', '(', ')' };

                    string s = comboBoxName.Text.Trim();

                    string[] words = s.Split(del);

                    clPlayer = new CPlayer(connect, words[0].Trim(), words[1].Trim(), words[3].Trim());
                    CEntryPlayers cl = new CEntryPlayers(connect);

                    int idt = cl.IsEntryPlayer(IS.idseason, clPlayer.stPlayer.idplayer);


                    if (idt != 0)
                    {
                        CTeam tm = new CTeam(connect, idt);
                        labelIsDemind.ForeColor = Color.Red;
                        labelIsDemind.Text      = string.Format("{0}", tm.stTeam.name);
                    }
                    else
                    {
                        labelIsDemind.ForeColor = Color.DarkGreen;
                        labelIsDemind.Text      = "свободен";
                    }


                    string str1 = string.Format("{0} {1} {2}", clPlayer.stPlayer.family, clPlayer.stPlayer.name,
                                                clPlayer.stPlayer.payname);

                    labelFIO.Text = str1;

                    CAge age = new CAge();

                    if (clPlayer.stPlayer.datebirth != null)
                    {
                        DateTime dte = (DateTime)clPlayer.stPlayer.datebirth;
                        string   sm  = age.GetFullAge(dte, datein);

                        string str2 = string.Format("{0}, {1}", dte.ToLongDateString(), sm);

                        labelDate.Text = str2;
                    }

                    CCountry clCountry = new CCountry(connect);

                    string str3 = string.Format("{0}, {1}", clPlayer.stPlayer.personalnum,
                                                clCountry.stCountry.shortname);

                    labelPersNum.Text = str3;
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); }
        }
Пример #3
0
        private void comboBoxName_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                if (comboBoxName.Text.Length > 0)
                {
                    char[] del = { ' ', '(', ')' };

                    string s = comboBoxName.Text.Trim();

                    string[] words = s.Split(del);

                    clPlayer = new CPlayer(connect, words[0].Trim(), words[1].Trim(), words[3].Trim());
                    CEntryPlayers cl = new CEntryPlayers(connect);

                    int idt = cl.IsEntryPlayer(IS.idseason, clPlayer.stPlayer.idplayer);


                    if (idt != 0)
                    {
                        CTeam tm = new CTeam(connect, idt);
                        labelIsDemind.ForeColor = Color.Red;
                        labelIsDemind.Text      = string.Format("{0}", tm.stTeam.name);
                    }
                    else
                    {
                        labelIsDemind.ForeColor = Color.DarkGreen;
                        labelIsDemind.Text      = "свободен";
                    }


                    string str1 = string.Format("{0} {1} {2}", clPlayer.stPlayer.family, clPlayer.stPlayer.name,
                                                clPlayer.stPlayer.payname);
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); }
        }
Пример #4
0
        private void comboBoxPlayer_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                char[] del = { ' ', '(', ')' };

                string s = comboBoxPlayer.Text.Trim();

                string[] words = s.Split(del);

                clPlayer = new CPlayer(connect, words[0].Trim(), words[1].Trim(), words[3].Trim());
                CEntryPlayers cl = new CEntryPlayers(connect);

                int idt = cl.IsEntryPlayer(IS.idseason, clPlayer.stPlayer.idplayer);


                if (idt != 0)
                {
                    CTeam tm = new CTeam(connect, idt);
                    textBoxTeam.Text = tm.stTeam.name;
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); }
        }
Пример #5
0
        private List <STDataRating> calculate()
        {
            List <STDataRating> ret = new List <STDataRating>();
            STDataRating        item;

            CPlayer         clPlayer;
            List <STPlayer> lst_player;
            STPlayerParam   paramPlayer = new STPlayerParam();

            paramPlayer.idseason = null;

            CStats         clStats;
            List <STStats> stStats;
            STParamStats   paramStats;

            CEntryPlayers  clEP;
            STEntryPlayers stEP;

            int idteam = 0;

            CTeam clTeam;

            try
            {
                clPlayer = new CPlayer(connect);
                clStats  = new CStats(connect);
                clEP     = new CEntryPlayers(connect);

                lst_player = clPlayer.GetList(paramPlayer);

                foreach (STPlayer st in lst_player)
                {
                    item = new STDataRating();

                    clPlayer  = new CPlayer(connect, st.idplayer);
                    item.name = string.Format("{0} {1} {2}", clPlayer.stPlayer.family, clPlayer.stPlayer.name,
                                              clPlayer.stPlayer.payname);
                    idteam = clEP.IsEntryPlayer(IS.idseason, st.idplayer);
                    if (idteam > 0)
                    {
                        clTeam        = new CTeam(connect, idteam);
                        item.nameteam = clTeam.stTeam.name;
                    }
                    else
                    {
                        item.nameteam = "не заявлен в текущем сезоне";
                    }

                    paramStats          = new STParamStats();
                    paramStats.idplayer = st.idplayer;

                    stStats = clStats.GetStats(paramStats);

                    foreach (STStats stst in stStats)
                    {
                        item.cntgame++;

                        item.points   += stst.points;
                        item.rebounds += stst.rebounds;
                        item.steals   += stst.steals;
                        item.fouls    += stst.psfouls;
                        item.blocks   += stst.blocks;
                        item.assists  += stst.assists;
                    }

                    ret.Add(item);
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); }

            return(ret);
        }