Пример #1
0
        void MyOnLoad(object sender, EventArgs e)
        {
            //TestBoundries();
            if (Environment.CommandLine.Contains("hide"))
            {
                this.Visible = false;
                //this.ShowInTaskbar = false;
            }
            if (Environment.CommandLine.Contains("HIDE"))
            {
                this.Visible       = false;
                this.ShowInTaskbar = false;
            }

            if (!Environment.CommandLine.Contains("config"))
            {
#if test
                button2.Enabled          = false;
                button3.Enabled          = false;
                button4.Enabled          = false;
                button5.Enabled          = false;
                button6.Enabled          = false;
                buttonOptionEdit.Enabled = false;
#endif
            }

            // might take this option out of the starter... and just Start...
#if asdfasdfasdf
            if (Options.Default["System:" + Environment.MachineName]["Bingo Game Core"]["External Game Data"]["Enable Reciever", "0"].Bool)
            {
                //String_Utilities.BuildSessionRangeCondition( null, DateTime.Now, 0 );
                BingoGameCore4.Networking.EltaninReceiver.BingodayChanged
                    += new BingoGameCore4.Networking.ExternalReceiver.OnBingodayChange(ExternalReceiver_BingodayChanged);
                BingoGameCore4.Networking.EltaninReceiver.SessionChanged
                    += new BingoGameCore4.Networking.ExternalReceiver.OnSessionChange(ExternalReceiver_SessionChanged);
                BingoGameCore4.Networking.EltaninReceiver.GameChanged
                    += new BingoGameCore4.Networking.ExternalReceiver.OnGameChange(ExternalReceiver_GameChanged);

                BingoGameCore4.Networking.ExternalReceiver.Start();
            }
#endif
            schedule_dsn = new DsnConnection(StaticDsnConnection.dsn.DataSource);
            schedule     = new OpenSkieScheduler3.ScheduleDataSet(schedule_dsn);
            schedule.Fill();

            BingoGameCore4.RateRank.Setup(schedule_dsn);
            BingoGameCore4.RateRank.game_points = new BingoGameCore4.Database.RankPointsExtended(schedule);
            input_db = new DsnConnection(Options.File("RateRank.ini")[Options.ProgramName + "/config"]["Input Database DSN", "MySQL"].Value);
            Text     = Text + "[" + input_db.DataSource + "]";

            OptionMap options = Options.Database(input_db)[Options.ProgramName];

            StateWriter.WritePackRateDetails = options["Write called_game_player_pack_stats (per card info)", "1"].Bool;


            if (options["config"]["Enable Game Check Timer", "0"].Bool)
            {
                timer_gameEventDataSet = new BingoGameEvent.GameEventDataSet(input_db);
                check_winner           = new System.Windows.Forms.Timer();
                check_winner.Interval  = options["config"]["Game Check Timer Length", "5000"].Integer;
                check_winner.Tick     += new EventHandler(check_winner_Tick);
                check_winner.Start();
            }


            monthCalendar1.ActiveMonth.Year       = DateTime.Now.Year;
            monthCalendar1.ActiveMonth.Month      = DateTime.Now.Month;
            monthCalendar1.MonthChanged          += new Pabo.Calendar.MonthChangedEventHandler(monthCalendar1_MonthChanged);
            monthCalendar1.DaySelected           += new Pabo.Calendar.DaySelectedEventHandler(monthCalendar1_DaySelected);
            listBoxSessions.SelectedIndexChanged += new EventHandler(listBoxSessions_SelectedIndexChanged);
            dataGridView1.SelectionChanged       += new EventHandler(dataGridView1_SelectionChanged);
            dataGridView1.MouseCaptureChanged    += new EventHandler(dataGridView1_MouseCaptureChanged);
        }
Пример #2
0
        int GetSessions(DateTime bingoday, List <DateTime> selectedDays)
        {
            Int32[] width = new Int32[3];

            fillingSessionTable           = true;
            listBoxSessions.SelectionMode = SelectionMode.None;

            ds.Tables[0].Rows.Clear();

            for (int idx = 0; idx < selectedDays.Count; idx++)
            {
                the_day = bingoday = selectedDays[idx];
                schedule.Fill(bingoday);

                foreach (DataRow sms_row in schedule.session_macro_sessions.Rows)
                {
                    DataRow row = sms_row.GetParentRow(schedule.session_macro_sessions.MemberInGroup);
                    // This gets us the session ids in session order
                    // now we need to get the corresponding session info
                    //foreach( DataRow row in schedule.sessions.Rows )
                    {
                        DbDataReader reader = StaticDsnConnection.dsn.KindExecuteReader("select count(*) from player_track as a left outer join player_track as b on a.transnum=b.void_trans"
                                                                                        + " where a.bingoday=" + DsnSQLUtil.MakeDateOnly(selectedDays[idx]) + " and a.void_trans=0 and b.transnum is NULL"
                                                                                        + " and a.session=" + sms_row[SessionDayMacroSessionTable.NumberColumn]);
                        if (reader == null || !reader.HasRows)
                        {
                            StaticDsnConnection.dsn.EndReader(reader);
                            continue;
                        }
                        reader.Read();
                        if (reader.GetInt32(0) == 0)
                        {
                            StaticDsnConnection.dsn.EndReader(reader);
                            continue;
                        }
                        StaticDsnConnection.dsn.EndReader(reader);

                        ds.Tables[0].Rows.Add(
                            new string[] {
                            row["session_name"].ToString(),
                            selectedDays[idx].ToString("MM/dd/yyyy"),
                            sms_row["session_number"].ToString()
                        }
                            );

                        width[0] = Math.Max(width[0], TextRenderer.MeasureText(ds.Tables[0].Rows[ds.Tables[0].Rows.Count - 1][0].ToString(), ListBox.DefaultFont).Width);
                        width[1] = Math.Max(width[1], TextRenderer.MeasureText(ds.Tables[0].Rows[ds.Tables[0].Rows.Count - 1][1].ToString(), ListBox.DefaultFont).Width);
                        width[2] = Math.Max(width[2], TextRenderer.MeasureText(ds.Tables[0].Rows[ds.Tables[0].Rows.Count - 1][2].ToString(), ListBox.DefaultFont).Width);
                    }
                }

                if (selectedDays.Count > 1)
                {
                    listBoxSessions.ColumnWidths[0] = width[0] + 5;
                    listBoxSessions.ColumnWidths[1] = listBoxSessions.ColumnWidth - listBoxSessions.ColumnWidths[0];
                    listBoxSessions.ColumnWidths[2] = width[2] + 5;
                }
                else
                {
                    listBoxSessions.ColumnWidths[0] = listBoxSessions.ColumnWidth;
                    listBoxSessions.ColumnWidths[1] = width[1] + 5;
                    listBoxSessions.ColumnWidths[2] = width[2] + 5;
                }

                the_day = bingoday = selectedDays[0];
            }

            fillingSessionTable           = false;
            listBoxSessions.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended;

            return(listBoxSessions.Items.Count);
        }