static void MonitorSalesSession() { while (true) { DbDataReader reader = session_sales_monitor_dsn.KindExecuteReader( "SELECT session_order,bingoday FROM session_day_sessions where open_for_sales_flag=1" ); // DbDataReader reader = session_sales_monitor_dsn.KindExecuteReader( "SELECT session_number,bingoday FROM operational_configuration" //+ " join session_day_sessions" //+ " on current_session_day_sessions_id=session_day_sessions.ID " ); if (reader != null && reader.HasRows) { int new_session; DateTime new_bingoday; reader.Read(); new_session = reader.GetInt32(0); new_bingoday = reader.GetDateTime(1); if (new_session != session_number || new_bingoday != bingoday) { session_number = new_session; bingoday = new_bingoday; schedule = new ScheduleDataSet(session_sales_monitor_dsn, bingoday, session_number); bingo_session = new BingoGameCore4.BingoSession(schedule.sessions.Rows[0]); session_event = new BingoGameCore4.BingoSessionEvent(bingo_session, true); session_event.ball_data = ball_device; } } session_sales_monitor_dsn.EndReader(reader); Thread.Sleep(2000); } }
public static void UpdateRanks() { if( input_db != null ) { DbDataReader r = input_db.KindExecuteReader( "select min(bingoday),max(bingoday) from called_game_balls" ); if( r == null ) return; DateTime start = new DateTime(); DateTime end = new DateTime(); if( r!= null && r.HasRows ) { if( r.Read() ) { start = r.GetDateTime( 0 ); end = r.GetDateTime( 1 ); } } for( DateTime current = start; current < end; current = current.AddDays( 7 ) ) { UpdateRanks( current, 1 ); } input_db.EndReader( r ); } }