Exemple #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            this.listBoxStatus.Items.Clear();

            this.labelStatus.Text = "Getting selected date...";
            Pabo.Calendar.SelectedDatesCollection dates = this.monthCalendar1.SelectedDates;
            if (dates.Count == 0)
            {
                return;
            }
            int session = 0;

            all_sessions = false;
            if (String.Compare(listBoxSessions.SelectedItem.ToString(), "All", true) == 0)
            {
                all_sessions = true;
            }
            else
            {
                session = Convert.ToInt32(listBoxSessions.SelectedItem.ToString());
            }

            if (all_sessions)
            {
                session = 1;
            }

            while (session > 0)
            {
                labelStatus2.Text     = "Loading session " + session + " on " + dates[0].Date;
                this.labelStatus.Text = "Loading bingo game list for session...";
                labelStatus.Refresh();
                bgl = new BingoGameList();
                bgl.Load(dates[0], session);

                //PatternEditor pe = new PatternEditor( );
                //pe.ShowDialog();

                this.labelStatus.Text = "Loading players for session...";
                this.listBoxStatus.Items.Add(this.labelStatus.Text);
                labelStatus.Refresh();
                bp = new BingoPlayers(dates[0], session, bgl);

                //BingoCore bc = new BingoCore( DateTime.Now, Convert.ToInt32( this.comboBox1.Text ) );

                /*
                 *              List<BingoPack> packs = BingoPack.GetPackList();
                 *              listBoxPacks.DataSource = packs;
                 *
                 *              if( last_packlist != null )
                 *                      foreach( BingoPack pack in last_packlist )
                 *                      {
                 * listBoxPacks.SetSelected( packs.IndexOf( pack ), true );
                 *                      }
                 */
                this.labelStatus.Text = "Select Packs and go...";
                this.listBoxStatus.Items.Add(this.labelStatus.Text);
                if (all_sessions)
                {
                    /*
                     * if( last_packlist == null )
                     * {
                     *      SelectPacks sp = new SelectPacks();
                     *      sp.ShowDialog();
                     *      listBoxPacks.ClearSelected();
                     *      foreach( BingoPack pack in sp.listBoxPacks.SelectedItems )
                     *      {
                     *              listBoxPacks.SetSelected( packs.IndexOf( pack ), true );
                     *      }
                     * }
                     */
                    this.Refresh();
                    RunSession();
                    this.Refresh();
                    session++;
                    if (session > sessions.Length)
                    {
                        session = 0;
                    }
                }
                else
                {
                    RunSession();
                    session = 0;
                }
            }
            labelStatus.Text = "Complete...";
            this.listBoxStatus.Items.Add(this.labelStatus.Text);
            labelStatus2.Text = "Complete...";
            //BingoGameCore.BingoCore.Load( dates[0].Date, 1 );
        }