Exemple #1
0
        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);
            }
        }
Exemple #2
0
        // Add JMU
        /// <summary>
        /// Recursive Look for the value the last Node. Does NOT change the database.
        /// </summary>
        /// <param name="Parent_node_id"></param>
        /// <param name="p_Path"></param>
        /// <returns>The value of the Option searched for</returns>
        private string recursiveValueOptionTree(int Parent_node_id, string p_Path)
        {
            string       path1, path2, sql, value;
            int          DelimeterSize, parent_id;
            DbDataReader OptionReader;

            DelimeterSize = p_Path.IndexOf("/");
            if (DelimeterSize == -1)
            {
                #region Search for value
                sql = " Select value.string " +
                      " FROM option_map map, option_name name, option_values value " +
                      " WHERE map.parent_node_id = " + Parent_node_id +
                      " AND   map.name_id = name.name_id " +
                      " AND   name.name = '" + p_Path + "'" +
                      " AND   map.value_id = value.value_id ";
                OptionReader = _dsn.KindExecuteReader(sql);
                if (!(OptionReader.HasRows))
                {
                    value = null;
                }
                else
                {
                    value = OptionReader.GetString(OptionReader.GetOrdinal("string"));
                }
                OptionReader.Close();
                OptionReader = null;
                return(value);

                #endregion
            }
            else
            {
                #region Search Recursive ChildNode
                path1 = p_Path.Substring(0, DelimeterSize);
                path2 = p_Path.Substring(DelimeterSize + 1);

                sql = " Select map.node_id " +
                      " FROM option_map map, option_name name " +
                      " WHERE map.parent_node_id = " + Parent_node_id +
                      " AND   map.name_id = name.name_id " +
                      " AND   name.name = '" + path1 + "'";
                OptionReader = _dsn.KindExecuteReader(sql);
                if (!(OptionReader.HasRows))
                {
                    OptionReader.Close();
                    OptionReader = null;
                    return(null);
                }
                else
                {
                    parent_id = OptionReader.GetInt32(OptionReader.GetOrdinal("node_id"));
                    OptionReader.Close();
                    OptionReader = null;
                    return(recursiveValueOptionTree(parent_id, path2));
                }
                #endregion
            }
        }
Exemple #3
0
		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 );
			}
		}