Beispiel #1
0
        private void ToolStripMenuItemDeleteFileInfo_Click(object sender, EventArgs e)
        {
            string text = null;
            try
            {
                STFileInfo data = GetSelectionData();

                if (data.filename != null)
                {
                    text = string.Format("Вы действиетльно желаете файл {0}?", data.filename);

                    if (MessageBox.Show(text, "Внимание!", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning)
                        == DialogResult.OK)
                    {
                        clWork.Delete(data);
                        init_data();

                        CGame clGame = new CGame(connect);
                        clGame.Delete(data.idseason, data.filename);

                        CStats clStats = new CStats(connect);
                        clStats.Delete(data.idseason, data.filename);

                        CCardTrow lcCardTrow = new CCardTrow(connect);
                        lcCardTrow.Delete(data.idseason, data.filename);

                        CStatsCoach clStatsCoach = new CStatsCoach(connect);
                        clStatsCoach.Delete(data.idseason, data.filename);

                        CStatsReferee lcStatsReferee = new CStatsReferee(connect);
                        lcStatsReferee.Delete(data.idseason, data.filename);
                    }
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); }
        }
Beispiel #2
0
        private STLoadFileInfo write_file(string filename)
        {
            STStats        stStats;
            STLoadFileInfo ret = new STLoadFileInfo();

            try
            {
                ret.iErrorCode = 0;

                CSmartStats clSS = new CSmartStats(filename);

                STGame stGame = clSS.stGame;

                // вычисляем дивизион
                CGame  clGame = new CGame(connect);
                STGame rgame  = clGame.GetGame(IS.idseason, stGame.idgame);
                int    iddiv  = (int)rgame.iddivision;

                lst_records = clRecords.GetRecords(iddiv);

                // Записываем игру
                clGame.UpdateSGM(stGame, stGame.idseason, stGame.idgame);

                // Записываем статистику
                CStats clStats = new CStats(connect);

                List <STStats> lst = clSS.stStatsTeam1;

                foreach (STStats item in lst)
                {
                    if (item.ptime > 0)
                    {
                        stStats = verify_player(item);

                        verify_records(stStats);

                        clStats.Insert(stStats);
                    }
                }

                lst = clSS.stStatsTeam2;

                foreach (STStats item in lst)
                {
                    if (item.ptime > 0)
                    {
                        stStats = verify_player(item);

                        verify_records(stStats);

                        clStats.Insert(stStats);
                    }
                }

                // Записываем карту бросков
                CCardTrow clCardTrow = new CCardTrow(connect);

                STCardTrow card = clSS.stCardTrow1;
                clCardTrow.Insert(card);
                card = clSS.stCardTrow2;
                clCardTrow.Insert(card);

                // Записываем статистику тренеров
                CStatsCoach clStatCoach = new CStatsCoach(connect);

                STStatsCoach coach = clSS.stCoach1;
                clStatCoach.Insert(coach);
                coach = clSS.stCoach2;
                clStatCoach.Insert(coach);

                // Записываем статистику судей
                CStatsReferee clStatReferee = new CStatsReferee(connect);

                STStatsReferee referee = clSS.stReferee1_t1;
                clStatReferee.Insert(referee);
                referee = clSS.stReferee1_t2;
                clStatReferee.Insert(referee);
                referee = clSS.stReferee2_t1;
                clStatReferee.Insert(referee);
                referee = clSS.stReferee2_t2;
                clStatReferee.Insert(referee);
                referee = clSS.stStReferee_t1;
                clStatReferee.Insert(referee);
                referee = clSS.stStReferee_t2;
                clStatReferee.Insert(referee);
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); }

            return(ret);
        }