public int CurrentMontlyRunInDb()
        {
            EnsureMontlyStatsTableExists();

            var notExportetYet = _dynaSql.SqlExecuteScalar($"Select month from {MONTHLY_STATS_TABLE_NAME} limit 1");

            if (!int.TryParse(notExportetYet, out int ret))
            {
                ret = -1;
            }
            return(ret);
        }
Пример #2
0
        public string ReadSettings(string key)
        {
            string cmd = null;

            try
            {
                cmd = $"select value from {TABLE_NAME} where key = @key";
                return(_dynaSql.SqlExecuteScalar(cmd, new List <DynaSql.DynaParameter>
                {
                    new DynaSql.DynaParameter {
                        Name = "key", Value = key
                    }
                }));
            }
            catch (Exception e)
            {
                Log.To.Main.AddException($"Failed saving settings data. {cmd}", e);
                throw;
            }
        }