Exemple #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); }
        }
Exemple #2
0
        private void set_data(STAwardsResult data)
        {
            string text = null;

            try
            {
                STAward st = clAward.GetAward(data.idaward);
                comboBoxAwards.Text = st.nameaward;

                clPlayer = new CPlayer(connect, data.idplayer);

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

                comboBoxPlayer.Text = text;

                if (data.result != null)
                {
                    text = string.Format("{0:f2}", data.result);
                    textBoxResult.Text = text;
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); }
        }
Exemple #3
0
        private STAward GetSelectionData()
        {
            STAward ret = new STAward();
            int     n;

            try
            {
                foreach (DataGridViewRow item in dataGridViewAward.SelectedRows)
                {
                    n = int.Parse(item.Cells[0].Value.ToString());

                    ret = clWork.GetAward(n);
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); }

            return(ret);
        }