FreakOut.classes.DatabaseConnector.IsPlatformDisabled C# (CSharp) Method

IsPlatformDisabled() public method

public IsPlatformDisabled ( int gamedbid ) : bool
gamedbid int
return bool
        public bool IsPlatformDisabled(int gamedbid)
        {
            LogInstance.WriteToFile(1, "Is the platform with the id " + gamedbid + " disabled?", LogSource);
            if (!connectionopen)
            {
                DBConnector.Open();
                connectionopen = true;
            }

            FbTransaction DBTransaction = DBConnector.BeginTransaction();
            FbCommand DBCommand = new FbCommand("SELECT active FROM platforms WHERE gamedbid=" + gamedbid, DBConnector, DBTransaction);
            FbDataReader DBReader = DBCommand.ExecuteReader();

            while (DBReader.Read())
            {
                if (DBReader.GetInt32(0) == 0)
                {
                    DBConnector.Close();
                    connectionopen = false;
                    return true;
                }
                else
                {
                    DBConnector.Close();
                    connectionopen = false;
                    return false;
                }
            }

            DBConnector.Close();
            connectionopen = false;
            LogInstance.WriteToFile(3, "Unable to locate the platform with the id " + gamedbid + ". Returning false.", LogSource);
            return false;
        }