using System.Data;
using System.Linq;

namespace ZocMonLib
{
    public class StorageCommandsSupport : IStorageCommandsSupport
    {
        public string SelectCurrentReduceStatus(IDbConnection conn)
        {
            var result = DatabaseSqlHelper.CreateListWithConnection<bool>(conn, StorageCommandsSqlServerQuery.CurrentlyReducingSql);
            if (result.Any())
                return result.First() ? "1" : "0";
            return "";
        }

        public void UpdateCurrentReduceStatus(string value, IDbConnection conn)
        {
            DatabaseSqlHelper.ExecuteNonQueryWithConnection(conn, StorageCommandsSqlServerQuery.UpdateReducingSql, new { IsReducing = value == "1" });
        }
    }
}
using System.Data;
using System.Linq;

namespace ZocMonLib
{
    public class StorageCommandsSupport : IStorageCommandsSupport
    {
        public string SelectCurrentReduceStatus(IDbConnection conn)
        {
            const string sql = @"SELECT TOP(1) IsReducing FROM Settings";

            var result = DatabaseSqlHelper.Query<bool>(conn, sql);
            if (result.Any())
                return result.First() ? "1" : "0";
            return "";
        }

        public void UpdateCurrentReduceStatus(string value, IDbConnection conn)
        {
            //TODO this doesn't take into account if it doesn't exist
            const string sql = @"UPDATE Settings SET IsReducing = @isReducing";

            DatabaseSqlHelper.Execute(conn, sql, param: new { isReducing = value == "1" });
        }
    }
}
Switch over support commands from using the query class
Switch over support commands from using the query class
