Exemplo n.º 1
0
        /* виз. отображение календаря */
        private void init_data()
        {
            STGameParam param = new STGameParam();

            param.idseason   = IS.idseason;
            param.type       = type;
            param.iddivision = iddivision;
            param.ordername  = "IdStage,NRound,DateTimeGame,IdDivision,IdGroup";

            try
            {
                dataGridViewGames.Rows.Clear();

                list = new List <STGame>();
                list = clGame.GetListGames(param);

                if (list.Count > 0)
                {
                    int r = get_count_round(list);

                    dataGridViewGames.Rows.Add(list.Count + r);

                    int  cnt   = 0;
                    bool first = false;

                    int curstage = 0;
                    int curround = 0;

                    for (int i = 0; i < list.Count; i++)
                    {
                        if (first == false)
                        {
                            curstage = (int)list[i].idstage;
                            curround = (int)list[i].round;

                            first = true;

                            init_list_add_capt(list[i], cnt);
                            cnt++;
                        }

                        if (curstage == list[i].idstage && curround == list[i].round)
                        {
                            if (flawour.Equals(list[i]))
                            {
                                gpos = cnt;
                            }

                            init_list_add_row(list[i], cnt);
                            cnt++;
                        }
                        else
                        {
                            curstage = (int)list[i].idstage;
                            curround = (int)list[i].round;

                            init_list_add_capt(list[i], cnt);
                            cnt++;

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

                            init_list_add_row(list[i], cnt);
                            cnt++;
                        }
                    }

                    dataGridViewGames.AllowUserToAddRows = false;
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); }
        }