This commit is contained in:
@@ -58,11 +58,11 @@ namespace AyaNova.Biz
|
||||
//
|
||||
|
||||
//put
|
||||
internal async Task<bool> ReplaceAsync(GlobalOpsBackupSettings putObject)
|
||||
internal async Task<GlobalOpsBackupSettings> PutAsync(GlobalOpsBackupSettings putObject)
|
||||
{
|
||||
var dbObject = await ct.GlobalOpsBackupSettings.FirstOrDefaultAsync(m => m.Id == 1);
|
||||
if (dbObject == null)
|
||||
throw new System.Exception("GlobalOpsSettingsBiz::ReplaceAsync -> Global settings object not found in database!!");
|
||||
throw new System.Exception("GlobalOpsSettingsBiz::PutAsync -> Global settings object not found in database!!");
|
||||
|
||||
//If backup time has changed then reset last backup as well as it might block from taking effect
|
||||
if (putObject.BackupTime.Hour != dbObject.BackupTime.Hour && putObject.BackupTime.Minute != dbObject.BackupTime.Minute)
|
||||
@@ -73,12 +73,12 @@ namespace AyaNova.Biz
|
||||
ct.Entry(dbObject).OriginalValues["Concurrency"] = putObject.Concurrency;
|
||||
Validate(dbObject);
|
||||
if (HasErrors)
|
||||
return false;
|
||||
return null;
|
||||
await ct.SaveChangesAsync();
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, 1, BizType, AyaEvent.Modified), ct);
|
||||
//Update the static copy for the server
|
||||
ServerGlobalOpsSettingsCache.Backup=dbObject;
|
||||
return true;
|
||||
return dbObject;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user