public static int GetCurrentSeason(int playListId) { string query = $"SELECT max(pst_season_number) FROM B_PLAYLIST_STATS WHERE pst_playList_Id = '{playListId}'"; OracleDataReader dataReader = SQLExecutor.GetSQLResults(query); if (dataReader.GetValue(0) != DBNull.Value) { return(dataReader.GetInt32(0)); } else { return(0); } }
public static int GetLastUnixTime() { string query = $"SELECT max(req_timestamp) FROM B_REQUESTS"; OracleDataReader dataReader = SQLExecutor.GetSQLResults(query); if (dataReader.GetValue(0) != DBNull.Value) { return(dataReader.GetInt32(0)); } else { return(0); } }
public static int GetLatestMatchesCount(int playListId, int seasonNumber) { string query = $"SELECT max(pst_matches_played) FROM B_PLAYLIST_STATS WHERE pst_playList_Id = '{playListId}' AND pst_season_number = '{seasonNumber}'"; OracleDataReader dataReader = SQLExecutor.GetSQLResults(query); Int32 currentMatchCount; if (dataReader.GetValue(0) != DBNull.Value) { currentMatchCount = dataReader.GetInt32(0); } else { currentMatchCount = 0; } return(currentMatchCount); }