diff --git a/server/AyaNova/biz/GlobalOpsSettingsBiz.cs b/server/AyaNova/biz/GlobalOpsSettingsBiz.cs index f0b15458..3e696cfa 100644 --- a/server/AyaNova/biz/GlobalOpsSettingsBiz.cs +++ b/server/AyaNova/biz/GlobalOpsSettingsBiz.cs @@ -47,7 +47,7 @@ namespace AyaNova.Biz //not in db then get the default if (ret == null) { - throw new System.Exception("GlobalOpsSettingsBiz::GetAsync -> Global settings object not found in database!!"); + throw new System.Exception("GlobalOpsSettingsBiz::GetAsync -> Global OPS settings object not found in database!!"); } return ret; } diff --git a/server/AyaNova/util/ServerGlobalOpsSettings.cs b/server/AyaNova/util/ServerGlobalOpsSettings.cs index 33c55d34..cf9ed118 100644 --- a/server/AyaNova/util/ServerGlobalOpsSettings.cs +++ b/server/AyaNova/util/ServerGlobalOpsSettings.cs @@ -1,7 +1,4 @@ -using System.Collections.Generic; -using System.IO; -using Microsoft.Extensions.Configuration; -using Microsoft.EntityFrameworkCore; +using System; using System.Linq; using AyaNova.Models; @@ -17,28 +14,34 @@ namespace AyaNova.Util internal static class ServerGlobalOpsSettings { - internal static bool SearchCaseSensitiveOnly { get; set; } + internal static DateTime BackupTime { get; set; } + internal static DateTime LastBackup { get; set; } + internal static int BackupSetsToKeep { get; set; } + internal static bool BackupAttachments { get; set; } /// /// Populate and / or create the settings /// - internal static void Initialize(GlobalBizSettings global, AyContext ct = null) + internal static void Initialize(GlobalOpsSettings global, AyContext ct = null) { if (global == null) { //fetch or create as not provided (meaning this was called from Startup.cs) - global = ct.GlobalBizSettings.FirstOrDefault(z => z.Id == 1); + global = ct.GlobalOpsSettings.FirstOrDefault(z => z.Id == 1); if (global == null) { - global = new GlobalBizSettings(); - ct.GlobalBizSettings.Add(global); + global = new GlobalOpsSettings(); + ct.GlobalOpsSettings.Add(global); ct.SaveChanges(); } } //We have the object, now copy the static values here - SearchCaseSensitiveOnly = global.SearchCaseSensitiveOnly; + BackupAttachments = global.BackupAttachments; + BackupSetsToKeep = global.BackupSetsToKeep; + BackupTime = global.BackupTime; + LastBackup = global.LastBackup; }