diff --git a/server/AyaNova/biz/GlobalBizSettingsBiz.cs b/server/AyaNova/biz/GlobalBizSettingsBiz.cs index 83a001a9..ba6b990d 100644 --- a/server/AyaNova/biz/GlobalBizSettingsBiz.cs +++ b/server/AyaNova/biz/GlobalBizSettingsBiz.cs @@ -3,6 +3,7 @@ using Microsoft.EntityFrameworkCore; using AyaNova.Util; using AyaNova.Api.ControllerHelpers; using AyaNova.Models; +using System.Collections.Generic; namespace AyaNova.Biz { @@ -70,6 +71,10 @@ namespace AyaNova.Biz } Validate(putObject, dbObject); if (HasErrors) return null; + + List originalTags = dbObject.AllTags(); + List newTags = putObject.AllTags(); + ct.Replace(dbObject, putObject); @@ -87,6 +92,7 @@ namespace AyaNova.Biz //Log modification and save context await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, 1, BizType, AyaEvent.Modified), ct); + await TagBiz.ProcessUpdateTagsInRepositoryAsync(ct, newTags, originalTags); return putObject; } diff --git a/server/AyaNova/models/GlobalBizSettings.cs b/server/AyaNova/models/GlobalBizSettings.cs index fc23779a..635ad23a 100644 --- a/server/AyaNova/models/GlobalBizSettings.cs +++ b/server/AyaNova/models/GlobalBizSettings.cs @@ -118,6 +118,26 @@ namespace AyaNova.Models public string SignatureFooter { get; set; } + public List AllTags(){ + var t=new List(); + t.AddRange(this.CustomerWorkOrderReport1Tags); + t.AddRange(this.CustomerWorkOrderReport2Tags); + t.AddRange(this.CustomerWorkOrderReport3Tags); + t.AddRange(this.CustomerWorkOrderReport4Tags); + t.AddRange(this.CustomerWorkOrderReport5Tags); + t.AddRange(this.CustomerAllowCSRInTags); + t.AddRange(this.CustomerAllowViewWOInTags); + t.AddRange(this.CustomerAllowWOWikiInTags); + t.AddRange(this.CustomerAllowWOAttachmentsInTags); + t.AddRange(this.CustomerAllowUserSettingsInTags); + t.AddRange(this.CustomerAllowNotifyServiceImminentInTags); + t.AddRange(this.CustomerAllowNotifyCSRAcceptedInTags); + t.AddRange(this.CustomerAllowNotifyCSRRejectedInTags); + t.AddRange(this.CustomerAllowNotifyWOCreatedInTags); + t.AddRange(this.CustomerAllowNotifyWOCompletedInTags); + return t; + } + public GlobalBizSettings() { Id = 1;//always 1