Example #1
0
        private void PreViewGame_Load(object sender, EventArgs e)
        {
            try
            {
                clTeam = new CTeam(connect);
                clGame = new CGame(connect);

                clIS       = new CInfoSeason(connect);
                clDivision = new CDivision(connect);

                team1 = new STTeam();
                team2 = new STTeam();

                init_combo_season();
                init_combo_division();
                init_combo_group();

                init_combo_team();



                cnt = 0;
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); }
        }
Example #2
0
        private void InitParamSeason()
        {
            string sNewCapture;

            CInfoSeason cis = new CInfoSeason(connect);

            STInfoSeason?NN = cis.GetCurretDataSeason();

            if (NN != null)
            {
                IS = (STInfoSeason)NN;

                string text = string.Format("(Наименование сезона: {0}. Дата начала сезона: {1})", IS.nameseason,
                                            IS.datebegin.ToLongDateString().Trim());

                sNewCapture = sBaseCapture + text;

                this.Text = sNewCapture;
            }
            else
            {
                MessageBox.Show("Текущего сезона не существует!\r\nНеобходимо создать новый, либо установить текущий сезон.",
                                "Внимание", MessageBoxButtons.OK, MessageBoxIcon.Information);

                ChangeSeason wnd = new ChangeSeason(connect, mode);

                DialogResult result = wnd.ShowDialog();

                IS = new STInfoSeason();
                InitParamSeason();
            }
        }
Example #3
0
        public ChangeSeason(SqlConnection cn, ushort md)
        {
            InitializeComponent();

            //IS = data;
            connect = cn;

            mode = md;

            cis = new CInfoSeason(connect);
        }
Example #4
0
        private void ParamSeason_Load(object sender, EventArgs e)
        {
            try
            {
                this.Text = capture;

                cis = new CInfoSeason(connect);

                set_data();
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); }
        }
Example #5
0
        private void RankingTeam_Load(object sender, EventArgs e)
        {
            this.WindowState = FormWindowState.Maximized;

            clIS = new CInfoSeason(connect);
            clRT = new CRankingTeam(connect);

            init_combo_div();

            idseason = 0;
            dr       = DateTime.MinValue;
        }
Example #6
0
        private void ReportReferee_Load(object sender, EventArgs e)
        {
            try
            {
                radioButtonOneSeason.Checked = true;

                clIS = new CInfoSeason(connect);

                init_combo();
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); }
        }
Example #7
0
        private void init_data_in()
        {
            CPlayer       clP  = new CPlayer(connect);
            CEntryPlayers clEP = new CEntryPlayers(connect);
            CInfoSeason   clIS;
            CTeam         clTeam;

            try
            {
                dataGridViewIn.Rows.Clear();

                List <STEntryPlayers> list = clEP.GetListEntryPlayer(gstPlayer.idplayer);

                if (list.Count > 0)
                {
                    dataGridViewIn.Rows.Add(list.Count);

                    for (int i = 0; i < list.Count; i++)
                    {
                        dataGridViewIn.Rows[i].Cells[0].Value = list[i].idseason;

                        clIS = new CInfoSeason(connect, list[i].idseason);
                        STInfoSeason st = (STInfoSeason)clIS.s_IS;
                        dataGridViewIn.Rows[i].Cells[1].Value = st.nameseason;

                        clTeam = new CTeam(connect, list[i].idteam);
                        dataGridViewIn.Rows[i].Cells[2].Value = clTeam.stTeam.name;

                        int cnt = clP.GetCntGames(list[i].idseason, list[i].idteam, gstPlayer.idplayer);
                        dataGridViewIn.Rows[i].Cells[3].Value = cnt.ToString();


                        dataGridViewIn.Rows[i].Cells[4].Value = list[i].datein.ToLongDateString();

                        if (list[i].dateout != null)
                        {
                            DateTime dt = (DateTime)list[i].dateout;
                            dataGridViewIn.Rows[i].Cells[5].Value = dt.ToLongDateString();
                        }
                    }

                    dataGridViewIn.ClearSelection();


                    dataGridViewIn.AllowUserToAddRows = false;
                }
                else
                {
                    dataGridViewIn.AllowUserToAddRows = false;
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); }
        }
Example #8
0
        private void ToolStripMenuItemDeleteSeason_Click(object sender, EventArgs e)
        {
            string text;

            try
            {
                STInfoSeason data = GetSelectionData();

                CInfoSeason cis = new CInfoSeason(connect);

                text = string.Format("Вы действительно желаете удалить сезон: {0}?", data.nameseason);

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

                    init_data();
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); }
        }
Example #9
0
        private void init_data_history()
        {
            string text, tm1, tm2;

            CInfoSeason  clIS = new CInfoSeason(connect);
            STInfoSeason st;

            DateTime dt;

            CPlace clPlace;

            try
            {
                //    if (MessageBox.Show("Обнулить данные?", "Внимание!", MessageBoxButtons.OKCancel, MessageBoxIcon.Question)
                //        == DialogResult.OK)
                //    {
                //        dataGridViewPersonalResult.Rows.Clear();

//                    cnt = 1;
//                }

                dataGridViewPersonalResult.Rows.Clear();

                cnt = 1;

                if (list_data.Count > 0)
                {
                    dataGridViewPersonalResult.Rows.Add(list_data.Count);


                    for (int i = 0; i < list_data.Count; i++)
                    {
                        dataGridViewPersonalResult.Rows[i].Cells[0].Value = cnt.ToString();

                        clIS = new CInfoSeason(connect, list_data[i].idseason);
                        st   = (STInfoSeason)clIS.s_IS;
                        dataGridViewPersonalResult.Rows[i].Cells[1].Value = st.nameseason;

                        dataGridViewPersonalResult.Rows[i].Cells[2].Value = list_data[i].idgame;

                        clTeam = new CTeam(connect, (int)list_data[i].idteam1);
                        tm1    = clTeam.stTeam.name;
                        clTeam = new CTeam(connect, (int)list_data[i].idteam2);
                        tm2    = clTeam.stTeam.name;

                        text = string.Format("{0} {1} - {2} {3}", tm1, list_data[i].apoints, list_data[i].bpoints, tm2);
                        dataGridViewPersonalResult.Rows[i].Cells[3].Value = text;

                        dt   = (DateTime)list_data[i].datetime;
                        text = dt.ToShortDateString();
                        dataGridViewPersonalResult.Rows[i].Cells[4].Value = text;

                        clPlace = new CPlace(connect, (int)list_data[i].idplace);
                        dataGridViewPersonalResult.Rows[i].Cells[5].Value = clPlace.stPlace.name;

                        cnt++;
                    }
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); }
        }