예제 #1
0
        private STGroup read_data()
        {
            STGroup ret = new STGroup();

            string text = null;

            try
            {
                /* основные параметры */
                ret.idseason = IS.idseason;

                if (IS.cntdivision > 1)
                {
                    if (comboBoxDivision.Text.Length > 0)
                    {
                        text           = comboBoxDivision.Text.Trim();
                        clDivision     = new CDivision(connect, IS.idseason, text);
                        ret.iddivision = clDivision.stDiv.id;
                    }
                }
                else
                {
                    ret.iddivision = 0;
                }

                if (gstGroup.idgroup > 0)
                {
                    ret.idgroup = gstGroup.idgroup;
                }
                else
                {
                    ret.idgroup = clGroup.GetFreeId((int)IS.idseason);
                }

                if (textBoxNameGroup.Text.Length > 0)
                {
                    ret.namegroup = textBoxNameGroup.Text.Trim();
                }
                else
                {
                    ret.namegroup = "";
                }

                if (comboBoxStage.Text.Length > 0)
                {
                    text = comboBoxStage.Text.Trim();
                    CScheme scheme = new CScheme(connect, (int)IS.idseason, ret.iddivision, text);
                    ret.idstage = scheme.stScheme.idstage;
                }
                else
                {
                    ret.idstage = 0;
                }

                if (textBoxCntTeam.Text.Length > 0)
                {
                    ret.cntteam = int.Parse(textBoxCntTeam.Text.Trim());
                }
                else
                {
                    ret.cntteam = 0;
                }

                if (textBoxCntTeamNext.Text.Length > 0)
                {
                    ret.cntteamnext = int.Parse(textBoxCntTeamNext.Text.Trim());
                }
                else
                {
                    ret.cntteamnext = 0;
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); }

            return(ret);
        }