Example #1
0
        private void set_data()
        {
            try
            {
                if (gstScheme.idstage > 0)
                {
                    textBoxNameStage.Text = gstScheme.namestage;

                    comboBoxTypes.Text = cl.GetTypeName(gstScheme.type);

                    textBoxCntRound.Text = gstScheme.cntround.ToString();

                    if (gstScheme.iddivision == 0)
                    {
                        checkBoxTug.CheckState = CheckState.Checked;
                    }
                    else
                    {
                        checkBoxTug.CheckState = CheckState.Unchecked;
                    }
                }
                else
                {
                    textBoxCntRound.Text   = null;
                    textBoxNameStage.Text  = null;
                    comboBoxTypes.Text     = null;
                    checkBoxTug.CheckState = CheckState.Unchecked;
                }

                textBoxNameStage.Focus();
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); }
        }
Example #2
0
        private void init_data(int iddivision)
        {
            dataGridViewScheme.Rows.Clear();

            CScheme         clScheme = new CScheme(connect);
            List <STScheme> list     = clScheme.GetListScheme((int)IS.idseason, iddivision);

            ListCompare lt = new ListCompare();

            CTypeGames clTp = new CTypeGames();

            try
            {
                list.Sort(lt);

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

                    dataGridViewScheme.Rows.Add(list.Count);

                    for (int i = 0; i < list.Count; i++)
                    {
                        dataGridViewScheme.Rows[i].Cells[0].Value = clTp.GetTypeName(list[i].type);

                        dataGridViewScheme.Rows[i].Cells[1].Value = list[i].namestage;

                        dataGridViewScheme.Rows[i].Cells[2].Value = list[i].cntround.ToString();

                        dataGridViewScheme.Rows[i].Cells[3].Value = list[i].idstage.ToString();

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

                    dataGridViewScheme.AllowUserToAddRows = false;
                }
                else
                {
                    dataGridViewScheme.AllowUserToAddRows = false;
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); }
        }