Exemple #1
0
        private void set_data()
        {
            if (gstGroup.idgroup > 0)
            {
                clDivision            = new CDivision(connect, IS.idseason, gstGroup.iddivision);
                comboBoxDivision.Text = clDivision.stDiv.name;

                textBoxNameGroup.Text = gstGroup.namegroup;

                CScheme scheme = new CScheme(connect, (int)IS.idseason, gstGroup.iddivision, gstGroup.idstage);

                comboBoxStage.Text = scheme.stScheme.namestage;

                textBoxCntTeam.Text     = gstGroup.cntteam.ToString();
                textBoxCntTeamNext.Text = gstGroup.cntteamnext.ToString();
            }
            else
            {
                comboBoxDivision.Text   = null;
                textBoxNameGroup.Text   = null;
                textBoxCntTeam.Text     = null;
                comboBoxStage.Text      = null;
                textBoxCntTeamNext.Text = null;
            }

            textBoxNameGroup.Focus();
        }
Exemple #2
0
        private void init_combo_stage()
        {
            try
            {
                comboBoxStage.Items.Clear();
                comboBoxStage.Text = null;

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

                if (list.Count > 0)
                {
                    comboBoxStage.Items.Add("");

                    comboBoxStage.Enabled = true;

                    foreach (STScheme item in list)
                    {
                        comboBoxStage.Items.Add(item.namestage);
                    }
                }
                else
                {
                    comboBoxStage.Enabled = false;
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); }
        }
Exemple #3
0
        private void RatingsTeam_Load(object sender, EventArgs e)
        {
            try
            {
                clDiv    = new CDivision(connect);
                clScheme = new CScheme(connect);
                tp       = new CTypeGames();

                checkBoxStage.Checked = false;
                checkBoxType.Checked  = false;

                comboBoxStage.Enabled = false;
                comboBoxType.Enabled  = false;
                comboBoxType.Text     = null;
                comboBoxStage.Text    = null;

                init_combo_division();
                init_combo_type();

                iddivision = 0;
                type       = -1;
                idstage    = 0;
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); }
        }
Exemple #4
0
        public Scheme(SqlConnection cn, STInfoSeason inf, ushort md)
        {
            InitializeComponent();

            connect = cn;
            IS      = inf;
            mode    = md;

            clScheme = new CScheme(connect);
        }
Exemple #5
0
        private void init_data()
        {
            try
            {
                g_f = false;

                dataGridViewGroups.Rows.Clear();

                list = clGroup.GetListGroup(IS.idseason);

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

                    dataGridViewGroups.Rows.Add(list.Count);

                    for (int i = 0; i < list.Count; i++)
                    {
                        dataGridViewGroups.Rows[i].Cells[0].Value = (i + 1).ToString();

                        dataGridViewGroups.Rows[i].Cells[1].Value = list[i].namegroup;

                        clDivision = new CDivision(connect, IS.idseason, list[i].iddivision);
                        dataGridViewGroups.Rows[i].Cells[2].Value = clDivision.stDiv.name;

                        clScheme = new CScheme(connect, IS.idseason, list[i].iddivision, list[i].idstage);
                        dataGridViewGroups.Rows[i].Cells[3].Value = clScheme.stScheme.namestage;

                        dataGridViewGroups.Rows[i].Cells[4].Value = list[i].cntteam.ToString();

                        dataGridViewGroups.Rows[i].Cells[5].Value = list[i].cntteamnext.ToString();

                        clCompgroup = new CCompositionGroup(connect, IS.idseason, list[i].iddivision,
                                                            list[i].idgroup);

                        dataGridViewGroups.Rows[i].Cells[6].Value =
                            clCompgroup.lstCompositionGroup.Count.ToString();

                        dataGridViewGroups.Rows[i].Cells[7].Value = list[i].idgroup.ToString();

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

                    dataGridViewGroups.AllowUserToAddRows = false;
                }
                else
                {
                    dataGridViewGroups.AllowUserToAddRows = false;
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); }
        }
Exemple #6
0
        private void DlgScheme_Load(object sender, EventArgs e)
        {
            try
            {
                this.Text = caption;

                clScheme = new CScheme(connect);
                cl       = new CTypeGames();

                init_combo();

                set_data();
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); }
        }
Exemple #7
0
        private void init_list_add_capt(STGame item, int i)
        {
            string text = null;

            CScheme clScheme = new CScheme(connect, IS.idseason, (int)item.iddivision, (int)item.idstage);

            try
            {
                /* вставляем дату и тур */
                text = string.Format("{0}, {1} тур", clScheme.stScheme.namestage, item.round);
                dataGridViewGames.Rows[i].Cells[0].Value             = text;
                dataGridViewGames.Rows[i].DefaultCellStyle.BackColor = Color.Azure;
            }
            catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); }
        }
Exemple #8
0
 private void comboBoxStage_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         if (comboBoxStage.Text.Length > 0)
         {
             clScheme = new CScheme(connect, IS.idseason, iddivision, comboBoxStage.Text.Trim());
             idstage  = clScheme.stScheme.idstage;
         }
         else
         {
             idstage = 0;
         }
     }
     catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); }
 }
Exemple #9
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); }
        }
Exemple #10
0
        private void DlgGroup_Load(object sender, EventArgs e)
        {
            try
            {
                this.Text = caption;

                clGroup    = new CGroup(connect);
                clScheme   = new CScheme(connect);
                clDivision = new CDivision(connect);

                init_combo_division();

                init_combo_scheme(0);

                set_data();
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); }
        }
Exemple #11
0
        private STScheme GetSelectionData()
        {
            STScheme ret = new STScheme();

            int n;

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

                    CScheme sp = new CScheme(connect, (int)IS.idseason, idCurrDiv, n);

                    ret = sp.stScheme;
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); }

            return(ret);
        }
Exemple #12
0
        private void comboBoxStage_SelectedIndexChanged(object sender, EventArgs e)
        {
            string name = null;

            try
            {
                if (comboBoxStage.Text.Length > 0)
                {
                    name     = comboBoxStage.Text.Trim();
                    clScheme = new CScheme(connect, IS.idseason, gDiv, name);

                    gStage = clScheme.stScheme.idstage;

                    if (gType == 0)
                    {
                        init_combo_group();
                    }

                    init_combo_round(clScheme.stScheme.cntround);
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); }
        }
Exemple #13
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);
        }
Exemple #14
0
        /* вспомогательные функции виз. отображения календаря */
        private void init_list_add_row(STGame item, int i)
        {
            string text  = null;
            string team1 = null;
            string team2 = null;

            Color color = Color.Black;

            try
            {
                if (item.idteamwins > 0)
                {
                    color = Color.Black;
                }
                else
                {
                    color = Color.Red;
                }

                dataGridViewCalendarGames.Rows[i].DefaultCellStyle.ForeColor = color;

                /* вставляем номер игры */
                dataGridViewCalendarGames.Rows[i].Cells[1].Value = item.idgame;
                /* дата и время игры */
                if (item.datetime != null)
                {
                    DateTime dt = (DateTime)item.datetime;
                    text = string.Format("{0}:{1:00}", dt.Hour, dt.Minute);
                    dataGridViewCalendarGames.Rows[i].Cells[2].Value = text;
                }
                /* игра и результат */
                if (item.idteam1 != null)
                {
                    clTeam = new CTeam(connect, (int)item.idteam1);
                    team1  = clTeam.stTeam.name;
                }
                if (item.idteam2 != null)
                {
                    clTeam = new CTeam(connect, (int)item.idteam2);
                    team2  = clTeam.stTeam.name;
                }

                text = string.Format("{0} {1} - {2} {3}", team1, item.apoints, item.bpoints, team2);

                /* выводим команды которые играют */
                dataGridViewCalendarGames.Rows[i].Cells[3].Value = text;

                /* группа */
                if (item.idgroup != null)
                {
                    clGroup = new CGroup(connect, (int)IS.idseason, (int)item.iddivision, (int)item.idgroup);
                    text    = string.Format("{0}", clGroup.stGroup.namegroup);

                    dataGridViewCalendarGames.Rows[i].Cells[4].Value = text;
                }

                if (item.idstage != null)
                {
                    clScheme = new CScheme(connect, IS.idseason, (int)item.iddivision, (int)item.idstage);
                    text     = string.Format("{0}", clScheme.stScheme.namestage);
                    dataGridViewCalendarGames.Rows[i].Cells[5].Value = text;
                }

                /* место игры */
                if (item.idplace != null)
                {
                    clPlace = new CPlace(connect, (int)item.idplace);
                    clCity  = new CCity(connect, clPlace.stPlace.idcity);
                    text    = clPlace.stPlace.name;
                    if (clCity.stFullCity.name != null)
                    {
                        text += string.Format(" ({0},{1})", clCity.stFullCity.name,
                                              clCity.stFullCity.shortnamecountry);
                    }

                    dataGridViewCalendarGames.Rows[i].Cells[6].Value = text;
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); }
        }
Exemple #15
0
        private void PrepareEditGame(STGame data)
        {
            string text;

            try
            {
                /* номер игры */
                textBoxNum.Text = data.idgame.ToString();
                /* дата\врем¤ игры */
                if (data.datetime != null)
                {
                    dateTimePickerDate.Value = new DateTime(data.datetime.Value.Year, data.datetime.Value.Month,
                                                            data.datetime.Value.Day, 0, 0, 0, 0);
                    dateTimePickerTime.Value = new DateTime(data.datetime.Value.Year, data.datetime.Value.Month,
                                                            data.datetime.Value.Day, data.datetime.Value.Hour, data.datetime.Value.Minute, 0, 0);
                }
                /* дивизион */
                if (data.iddivision != null)
                {
                    clDivision            = new CDivision(connect, IS.idseason, (int)data.iddivision);
                    comboBoxDivision.Text = clDivision.stDiv.name;
                }
                /* стади¤ */
                if (data.idstage != null)
                {
                    clScheme           = new CScheme(connect, IS.idseason, (int)data.iddivision, (int)data.idstage);
                    comboBoxStage.Text = clScheme.stScheme.namestage;
                }
                /* группа */
                if (data.idgroup != null)
                {
                    clGroup            = new CGroup(connect, IS.idseason, (int)data.iddivision, (int)data.idgroup);
                    comboBoxGroup.Text = clGroup.stGroup.namegroup;
                }
                /* номер тура */
                if (data.round != null)
                {
                    comboBoxRound.Text = data.round.ToString();
                }
                /* площадка */
                if (data.idplace != null)
                {
                    clPlace            = new CPlace(connect, (int)data.idplace);
                    comboBoxPlace.Text = clPlace.stPlace.name;
                }
                /* команда 1 */
                if (data.idteam1 != null)
                {
                    clTeam             = new CTeam(connect, (int)data.idteam1);
                    comboBoxTeam1.Text = clTeam.stTeam.name;
                }
                /* команда 2 */
                if (data.idteam2 != null)
                {
                    clTeam             = new CTeam(connect, (int)data.idteam2);
                    comboBoxTeam2.Text = clTeam.stTeam.name;
                }

                /* данный команд */
                if (data.aper1 != null)
                {
                    textBoxAPer1.Text = data.aper1.ToString();
                }
                if (data.aper2 != null)
                {
                    textBoxAPer2.Text = data.aper2.ToString();
                }
                if (data.adopper != null)
                {
                    textBoxADopPer.Text = data.adopper.ToString();
                }
                if (data.ateamfouls1 != null)
                {
                    textBoxAF1.Text = data.ateamfouls1.ToString();
                }
                if (data.ateamfouls2 != null)
                {
                    textBoxAF2.Text = data.ateamfouls2.ToString();
                }
                if (data.ateamfouls3 != null)
                {
                    textBoxAF3.Text = data.ateamfouls3.ToString();
                }
                if (data.ateamfouls4 != null)
                {
                    textBoxAF4.Text = data.ateamfouls4.ToString();
                }

                if (data.bper1 != null)
                {
                    textBoxBPer1.Text = data.bper1.ToString();
                }
                if (data.bper2 != null)
                {
                    textBoxBPer2.Text = data.bper2.ToString();
                }
                if (data.bdopper != null)
                {
                    textBoxBDopPer.Text = data.bdopper.ToString();
                }
                if (data.bteamfouls1 != null)
                {
                    textBoxBF1.Text = data.bteamfouls1.ToString();
                }
                if (data.bteamfouls2 != null)
                {
                    textBoxBF2.Text = data.bteamfouls2.ToString();
                }
                if (data.bteamfouls3 != null)
                {
                    textBoxBF3.Text = data.bteamfouls3.ToString();
                }
                if (data.bteamfouls4 != null)
                {
                    textBoxBF4.Text = data.bteamfouls4.ToString();
                }

                if (data.apointsper1 != null)
                {
                    textBoxAPoints1.Text = data.apointsper1.ToString();
                }
                if (data.apointsper2 != null)
                {
                    textBoxAPoints2.Text = data.apointsper2.ToString();
                }
                if (data.apointsper3 != null)
                {
                    textBoxAPoints3.Text = data.apointsper3.ToString();
                }
                if (data.apointsper4 != null)
                {
                    textBoxAPoints4.Text = data.apointsper4.ToString();
                }
                if (data.apointsdopper != null)
                {
                    textBoxADopPoints.Text = data.apointsdopper.ToString();
                }
                if (data.apoints != null)
                {
                    textBoxAPoints.Text = data.apoints.ToString();
                }

                if (data.bpointsper1 != null)
                {
                    textBoxBPoints1.Text = data.bpointsper1.ToString();
                }
                if (data.bpointsper2 != null)
                {
                    textBoxBPoints2.Text = data.bpointsper2.ToString();
                }
                if (data.bpointsper3 != null)
                {
                    textBoxBPoints3.Text = data.bpointsper3.ToString();
                }
                if (data.bpointsper4 != null)
                {
                    textBoxBPoints4.Text = data.bpointsper4.ToString();
                }
                if (data.bpointsdopper != null)
                {
                    textBoxBDopPoints.Text = data.bpointsdopper.ToString();
                }
                if (data.bpoints != null)
                {
                    textBoxBPoints.Text = data.bpoints.ToString();
                }
                /* флаг технического результата */
                if (data.flagteh != null)
                {
                    if (data.flagteh == 1)
                    {
                        checkBoxTeh.Checked = true;
                    }
                }

                /* команда - победитель */
                if (data.idteamwins != null)
                {
                    clTeam             = new CTeam(connect, (int)data.idteamwins);
                    labelTeamWins.Text = clTeam.stTeam.name;
                }

                /* судьи */
                if (data.idstreferee != null)
                {
                    clReferee = new CReferee(connect, (int)data.idstreferee);
                    text      = string.Format("{0} {1}", clReferee.stRef.family, clReferee.stRef.name);
                    comboBoxStReferee.Text = text;
                }
                if (data.idreferee1 != null)
                {
                    clReferee             = new CReferee(connect, (int)data.idreferee1);
                    text                  = string.Format("{0} {1}", clReferee.stRef.family, clReferee.stRef.name);
                    comboBoxReferee1.Text = text;
                }
                if (data.idreferee2 != null)
                {
                    clReferee             = new CReferee(connect, (int)data.idreferee2);
                    text                  = string.Format("{0} {1}", clReferee.stRef.family, clReferee.stRef.name);
                    comboBoxReferee2.Text = text;
                }
                /* оценки судь¤м */
                if (data.srrefereepoints != null)
                {
                    textBoxPointsStrefree.Text = data.srrefereepoints.ToString();
                }
                if (data.referee1points != null)
                {
                    textBoxPointsReferee1.Text = data.referee1points.ToString();
                }
                if (data.referee2points != null)
                {
                    textBoxPointsReferee2.Text = data.referee2points.ToString();
                }

                /* секретарь */
                if (data.idwriting != null)
                {
                    clParticipant         = new CParticipant(connect, (int)data.idwriting);
                    text                  = string.Format("{0} {1}", clParticipant.stPart.family, clParticipant.stPart.name);
                    comboBoxSecretar.Text = text;
                }
                /* секретарь */
                if (data.idoperpanel != null)
                {
                    clParticipant          = new CParticipant(connect, (int)data.idoperpanel);
                    text                   = string.Format("{0} {1}", clParticipant.stPart.family, clParticipant.stPart.name);
                    comboBoxOperPanel.Text = text;
                }
                /* видеооператор */
                if (data.idopervideo != null)
                {
                    clParticipant          = new CParticipant(connect, (int)data.idopervideo);
                    text                   = string.Format("{0} {1}", clParticipant.stPart.family, clParticipant.stPart.name);
                    comboBoxOperVideo.Text = text;
                }
                /* врач */
                if (data.idmedical != null)
                {
                    clParticipant      = new CParticipant(connect, (int)data.idmedical);
                    text               = string.Format("{0} {1}", clParticipant.stPart.family, clParticipant.stPart.name);
                    comboBoxMedic.Text = text;
                }
                /* диктор */
                if (data.iddiktor != null)
                {
                    clParticipant       = new CParticipant(connect, (int)data.iddiktor);
                    text                = string.Format("{0} {1}", clParticipant.stPart.family, clParticipant.stPart.name);
                    comboBoxDiktor.Text = text;
                }
                /* подсчЄт статистики */
                if (data.idstatister != null)
                {
                    clParticipant        = new CParticipant(connect, (int)data.idstatister);
                    text                 = string.Format("{0} {1}", clParticipant.stPart.family, clParticipant.stPart.name);
                    comboBoxStatist.Text = text;
                }

                /* остальна¤ статистика */
                if (data.cntlook != null)
                {
                    textBoxCntLook.Text = data.cntlook.ToString();
                }
                if (data.changelider != null)
                {
                    textBoxChangeLider.Text = data.changelider.ToString();
                }
                if (data.maxpointsteam1 != null)
                {
                    textBoxMaxPointsA.Text = data.maxpointsteam1.ToString();
                }
                if (data.maxpointsteam2 != null)
                {
                    textBoxMaxPointsB.Text = data.maxpointsteam2.ToString();
                }
                if (data.equalsresult != null)
                {
                    textBoxEqualsResult.Text = data.equalsresult.ToString();
                }
                if (data.maxdiff != null)
                {
                    textBoxMaxDiff.Text = data.maxdiff.ToString();
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); }
        }
Exemple #16
0
        private STGame read_data()
        {
            STGame ret = new STGame();

            try
            {
                /* сезон */
                ret.idseason = IS.idseason;
                /* тип игры */
                ret.type = gType;
                /* номер игры */
                if (textBoxNum.Text.Length > 0)
                {
                    ret.idgame = int.Parse(textBoxNum.Text.Trim());
                }
                /* дата\врем¤ игры */
                ret.datetime = new DateTime(dateTimePickerDate.Value.Year, dateTimePickerDate.Value.Month,
                                            dateTimePickerDate.Value.Day, dateTimePickerTime.Value.Hour, dateTimePickerTime.Value.Minute,
                                            0, 0);
                /* дивизион */
                if (comboBoxDivision.Text.Length > 0)
                {
                    clDivision     = new CDivision(connect, IS.idseason, comboBoxDivision.Text);
                    ret.iddivision = clDivision.stDiv.id;
                }
                else
                {
                    ret.iddivision = 0;
                }
                /* стади¤ */
                if (comboBoxStage.Text.Length > 0)
                {
                    clScheme    = new CScheme(connect, IS.idseason, (int)ret.iddivision, comboBoxStage.Text.Trim());
                    ret.idstage = clScheme.stScheme.idstage;
                }
                else
                {
                    ret.idstage = null;
                }
                /* группа */
                if (comboBoxGroup.Text.Length > 0)
                {
                    clGroup     = new CGroup(connect, IS.idseason, (int)ret.iddivision, comboBoxGroup.Text.Trim());
                    ret.idgroup = clGroup.stGroup.idgroup;
                }
                else
                {
                    ret.idgroup = null;
                }
                /* номер тура */
                if (comboBoxRound.Text.Length > 0)
                {
                    ret.round = int.Parse(comboBoxRound.Text.Trim());
                }
                else
                {
                    ret.round = null;
                }
                /* площадка */
                if (comboBoxPlace.Text.Length > 0)
                {
                    clPlace     = new CPlace(connect, comboBoxPlace.Text.Trim());
                    ret.idplace = clPlace.stPlace.id;
                }
                else
                {
                    ret.idplace = null;
                }
                /* команда 1 */
                if (comboBoxTeam1.Text.Length > 0)
                {
                    clTeam      = new CTeam(connect, comboBoxTeam1.Text.Trim());
                    ret.idteam1 = clTeam.stTeam.id;
                }
                else
                {
                    ret.idteam1 = null;
                }
                /* команда 2 */
                if (comboBoxTeam2.Text.Length > 0)
                {
                    clTeam      = new CTeam(connect, comboBoxTeam2.Text.Trim());
                    ret.idteam2 = clTeam.stTeam.id;
                }
                else
                {
                    ret.idteam2 = null;
                }
                /* данный команд */
                if (textBoxAPer1.Text.Length > 0)
                {
                    ret.aper1 = int.Parse(textBoxAPer1.Text.Trim());
                }
                else
                {
                    ret.aper1 = null;
                }
                if (textBoxAPer2.Text.Length > 0)
                {
                    ret.aper2 = int.Parse(textBoxAPer2.Text.Trim());
                }
                else
                {
                    ret.aper2 = null;
                }
                if (textBoxADopPer.Text.Length > 0)
                {
                    ret.adopper = int.Parse(textBoxADopPer.Text.Trim());
                }
                else
                {
                    ret.adopper = null;
                }
                if (textBoxAF1.Text.Length > 0)
                {
                    ret.ateamfouls1 = int.Parse(textBoxAF1.Text.Trim());
                }
                else
                {
                    ret.ateamfouls1 = null;
                }
                if (textBoxAF2.Text.Length > 0)
                {
                    ret.ateamfouls2 = int.Parse(textBoxAF2.Text.Trim());
                }
                else
                {
                    ret.ateamfouls2 = null;
                }
                if (textBoxAF3.Text.Length > 0)
                {
                    ret.ateamfouls3 = int.Parse(textBoxAF3.Text.Trim());
                }
                else
                {
                    ret.ateamfouls3 = null;
                }
                if (textBoxAF4.Text.Length > 0)
                {
                    ret.ateamfouls4 = int.Parse(textBoxAF4.Text.Trim());
                }
                else
                {
                    ret.ateamfouls4 = null;
                }

                if (textBoxBPer1.Text.Length > 0)
                {
                    ret.bper1 = int.Parse(textBoxBPer1.Text.Trim());
                }
                else
                {
                    ret.bper1 = null;
                }
                if (textBoxBPer2.Text.Length > 0)
                {
                    ret.bper2 = int.Parse(textBoxBPer2.Text.Trim());
                }
                else
                {
                    ret.bper2 = null;
                }
                if (textBoxBDopPer.Text.Length > 0)
                {
                    ret.bdopper = int.Parse(textBoxBDopPer.Text.Trim());
                }
                else
                {
                    ret.bdopper = null;
                }
                if (textBoxBF1.Text.Length > 0)
                {
                    ret.bteamfouls1 = int.Parse(textBoxBF1.Text.Trim());
                }
                else
                {
                    ret.bteamfouls1 = null;
                }
                if (textBoxBF2.Text.Length > 0)
                {
                    ret.bteamfouls2 = int.Parse(textBoxBF2.Text.Trim());
                }
                else
                {
                    ret.bteamfouls2 = null;
                }
                if (textBoxBF3.Text.Length > 0)
                {
                    ret.bteamfouls3 = int.Parse(textBoxBF3.Text.Trim());
                }
                else
                {
                    ret.bteamfouls3 = null;
                }
                if (textBoxBF4.Text.Length > 0)
                {
                    ret.bteamfouls4 = int.Parse(textBoxBF4.Text.Trim());
                }
                else
                {
                    ret.bteamfouls4 = null;
                }

                if (textBoxAPoints1.Text.Length > 0)
                {
                    ret.apointsper1 = int.Parse(textBoxAPoints1.Text.Trim());
                }
                else
                {
                    ret.apointsper1 = null;
                }
                if (textBoxAPoints2.Text.Length > 0)
                {
                    ret.apointsper2 = int.Parse(textBoxAPoints2.Text.Trim());
                }
                else
                {
                    ret.apointsper2 = null;
                }
                if (textBoxAPoints3.Text.Length > 0)
                {
                    ret.apointsper3 = int.Parse(textBoxAPoints3.Text.Trim());
                }
                else
                {
                    ret.apointsper3 = null;
                }
                if (textBoxAPoints4.Text.Length > 0)
                {
                    ret.apointsper4 = int.Parse(textBoxAPoints4.Text.Trim());
                }
                else
                {
                    ret.apointsper4 = null;
                }
                if (textBoxADopPoints.Text.Length > 0)
                {
                    ret.apointsdopper = int.Parse(textBoxADopPoints.Text.Trim());
                }
                else
                {
                    ret.apointsdopper = null;
                }
                if (textBoxAPoints.Text.Length > 0)
                {
                    ret.apoints = int.Parse(textBoxAPoints.Text.Trim());
                }
                else
                {
                    ret.apoints = null;
                }

                if (textBoxBPoints1.Text.Length > 0)
                {
                    ret.bpointsper1 = int.Parse(textBoxBPoints1.Text.Trim());
                }
                else
                {
                    ret.bpointsper1 = null;
                }
                if (textBoxBPoints2.Text.Length > 0)
                {
                    ret.bpointsper2 = int.Parse(textBoxBPoints2.Text.Trim());
                }
                else
                {
                    ret.bpointsper2 = null;
                }
                if (textBoxBPoints3.Text.Length > 0)
                {
                    ret.bpointsper3 = int.Parse(textBoxBPoints3.Text.Trim());
                }
                else
                {
                    ret.bpointsper3 = null;
                }
                if (textBoxBPoints4.Text.Length > 0)
                {
                    ret.bpointsper4 = int.Parse(textBoxBPoints4.Text.Trim());
                }
                else
                {
                    ret.bpointsper4 = null;
                }
                if (textBoxBDopPoints.Text.Length > 0)
                {
                    ret.bpointsdopper = int.Parse(textBoxBDopPoints.Text.Trim());
                }
                else
                {
                    ret.bpointsdopper = null;
                }
                if (textBoxBPoints.Text.Length > 0)
                {
                    ret.bpoints = int.Parse(textBoxBPoints.Text.Trim());
                }
                else
                {
                    ret.bpoints = null;
                }
                /* флаг технического результата */
                if (checkBoxTeh.Checked == true)
                {
                    ret.flagteh = 1;
                }
                else
                {
                    ret.flagteh = 0;
                }

                /* команда - победитель */
                if (ret.apoints > ret.bpoints)
                {
                    ret.idteamwins = ret.idteam1;
                }
                else if (ret.apoints < ret.bpoints)
                {
                    ret.idteamwins = ret.idteam2;
                }
                else
                {
                    ret.idteamwins = null;
                }

                /* судьи */
                if (comboBoxStReferee.Text.Length > 0)
                {
                    ret.idstreferee = get_referee(comboBoxStReferee.Text.Trim());
                }
                else
                {
                    ret.idstreferee = null;
                }
                if (comboBoxReferee1.Text.Length > 0)
                {
                    ret.idreferee1 = get_referee(comboBoxReferee1.Text.Trim());
                }
                else
                {
                    ret.idreferee1 = null;
                }
                if (comboBoxReferee2.Text.Length > 0)
                {
                    ret.idreferee2 = get_referee(comboBoxReferee2.Text.Trim());
                }
                else
                {
                    ret.idreferee2 = null;
                }
                /* оценки судь¤м */
                if (textBoxPointsStrefree.Text.Length > 0)
                {
                    ret.srrefereepoints = double.Parse(textBoxPointsStrefree.Text.Trim());
                }
                else
                {
                    ret.srrefereepoints = null;
                }
                if (textBoxPointsReferee1.Text.Length > 0)
                {
                    ret.referee1points = double.Parse(textBoxPointsReferee1.Text.Trim());
                }
                else
                {
                    ret.referee1points = null;
                }
                if (textBoxPointsReferee2.Text.Length > 0)
                {
                    ret.referee2points = double.Parse(textBoxPointsReferee2.Text.Trim());
                }
                else
                {
                    ret.referee2points = null;
                }

                /* секретарь */
                if (comboBoxSecretar.Text.Length > 0)
                {
                    ret.idwriting = get_participant(comboBoxSecretar.Text.Trim());
                }
                else
                {
                    ret.idwriting = null;
                }
                /* секретарь */
                if (comboBoxOperPanel.Text.Length > 0)
                {
                    ret.idoperpanel = get_participant(comboBoxOperPanel.Text.Trim());
                }
                else
                {
                    ret.idoperpanel = null;
                }
                /* видеооператор */
                if (comboBoxOperVideo.Text.Length > 0)
                {
                    ret.idopervideo = get_participant(comboBoxOperVideo.Text.Trim());
                }
                else
                {
                    ret.idopervideo = null;
                }
                /* врач */
                if (comboBoxMedic.Text.Length > 0)
                {
                    ret.idmedical = get_participant(comboBoxMedic.Text.Trim());
                }
                else
                {
                    ret.idmedical = null;
                }
                /* диктор */
                if (comboBoxDiktor.Text.Length > 0)
                {
                    ret.iddiktor = get_participant(comboBoxDiktor.Text.Trim());
                }
                else
                {
                    ret.iddiktor = null;
                }
                /* подсчЄт статистики */
                if (comboBoxStatist.Text.Length > 0)
                {
                    ret.idstatister = get_participant(comboBoxStatist.Text.Trim());
                }
                else
                {
                    ret.idstatister = null;
                }

                /* остальна¤ статистика */
                if (textBoxCntLook.Text.Length > 0)
                {
                    ret.cntlook = int.Parse(textBoxCntLook.Text.Trim());
                }
                else
                {
                    ret.cntlook = null;
                }
                if (textBoxChangeLider.Text.Length > 0)
                {
                    ret.changelider = int.Parse(textBoxChangeLider.Text.Trim());
                }
                else
                {
                    ret.changelider = null;
                }
                if (textBoxMaxPointsA.Text.Length > 0)
                {
                    ret.maxpointsteam1 = int.Parse(textBoxMaxPointsA.Text.Trim());
                }
                else
                {
                    ret.maxpointsteam1 = null;
                }
                if (textBoxMaxPointsB.Text.Length > 0)
                {
                    ret.maxpointsteam2 = int.Parse(textBoxMaxPointsB.Text.Trim());
                }
                else
                {
                    ret.maxpointsteam2 = null;
                }
                if (textBoxEqualsResult.Text.Length > 0)
                {
                    ret.equalsresult = int.Parse(textBoxEqualsResult.Text.Trim());
                }
                else
                {
                    ret.equalsresult = null;
                }
                if (textBoxMaxDiff.Text.Length > 0)
                {
                    ret.maxdiff = int.Parse(textBoxMaxDiff.Text.Trim());
                }
                else
                {
                    ret.maxdiff = null;
                }

                fread = true;
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); fread = false; }

            return(ret);
        }
Exemple #17
0
        private STParamReportBestPlayer read_param()
        {
            STParamReportBestPlayer ret = new STParamReportBestPlayer();

            try
            {
                ret.idseason = IS.idseason;

                if (comboBoxTypeGame.Text.Length > 0)
                {
                    ret.type = tp.GetTypeCode(comboBoxTypeGame.Text.Trim());
                }
                else
                {
                    ret.type = -1;
                }

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

                if (comboBoxStage.Text.Length > 0)
                {
                    clScheme    = new CScheme(connect, ret.idseason, ret.iddivision, comboBoxStage.Text.Trim());
                    ret.idstage = clScheme.stScheme.idstage;
                }

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

                if (textBoxLimit2.Text.Length > 0)
                {
                    ret.limit2 = double.Parse(textBoxLimit2.Text.Trim());
                }
                else
                {
                    ret.limit2 = 0;
                }

                if (textBoxLimit3.Text.Length > 0)
                {
                    ret.limit3 = double.Parse(textBoxLimit3.Text.Trim());
                }
                else
                {
                    ret.limit3 = 0;
                }

                if (textBoxLimitFt.Text.Length > 0)
                {
                    ret.limitft = double.Parse(textBoxLimitFt.Text.Trim());
                }
                else
                {
                    ret.limitft = 0;
                }

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

                if (textBoxCntPlayer.Text.Length > 0)
                {
                    ret.cntplayer = int.Parse(textBoxCntPlayer.Text.Trim());
                }
                else
                {
                    ret.cntplayer = 0;
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); }

            return(ret);
        }